From: Michael Chan <michael.chan@broadcom•com>
To: davem@davemloft•net
Cc: netdev@vger•kernel.org, edumazet@google•com, kuba@kernel•org,
pabeni@redhat•com, pavan.chebbi@broadcom•com,
andrew.gospodarek@broadcom•com,
Ajit Khaparde <ajit.khaparde@broadcom•com>,
Somnath Kotur <somnath.kotur@broadcom•com>
Subject: [PATCH net 2/3] bnxt_en: Set TSO max segs on devices with limits
Date: Tue, 18 Jun 2024 14:53:12 -0700 [thread overview]
Message-ID: <20240618215313.29631-3-michael.chan@broadcom.com> (raw)
In-Reply-To: <20240618215313.29631-1-michael.chan@broadcom.com>
[-- Attachment #1: Type: text/plain, Size: 1975 bytes --]
Firmware will now advertise a non-zero TSO max segments if the
device has a limit. 0 means no limit. The latest 5760X chip
(early revs) has a limit of 2047 that cannot be exceeded. If
exceeded, the chip will send out just a small number of segments.
Call netif_set_tso_max_segs() if the device has a limit.
Fixes: 2012a6abc876 ("bnxt_en: Add 5760X (P7) PCI IDs")
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom•com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom•com>
Signed-off-by: Michael Chan <michael.chan@broadcom•com>
---
drivers/net/ethernet/broadcom/bnxt/bnxt.c | 3 +++
drivers/net/ethernet/broadcom/bnxt/bnxt.h | 1 +
2 files changed, 4 insertions(+)
diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
index c437ca1c0fd3..89d29d6d7517 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
@@ -8996,6 +8996,7 @@ static int __bnxt_hwrm_func_qcaps(struct bnxt *bp)
memcpy(vf->mac_addr, resp->mac_address, ETH_ALEN);
#endif
}
+ bp->tso_max_segs = le16_to_cpu(resp->max_tso_segs);
hwrm_func_qcaps_exit:
hwrm_req_drop(bp, req);
@@ -15363,6 +15364,8 @@ static int bnxt_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
dev->priv_flags |= IFF_UNICAST_FLT;
netif_set_tso_max_size(dev, GSO_MAX_SIZE);
+ if (bp->tso_max_segs)
+ netif_set_tso_max_segs(dev, bp->tso_max_segs);
dev->xdp_features = NETDEV_XDP_ACT_BASIC | NETDEV_XDP_ACT_REDIRECT |
NETDEV_XDP_ACT_RX_SG;
diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.h b/drivers/net/ethernet/broadcom/bnxt/bnxt.h
index bbc7edccd5a4..9cf0acfa04e5 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt.h
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.h
@@ -2318,6 +2318,7 @@ struct bnxt {
u8 rss_hash_key_updated:1;
u16 max_mtu;
+ u16 tso_max_segs;
u8 max_tc;
u8 max_lltc; /* lossless TCs */
struct bnxt_queue_info q_info[BNXT_MAX_QUEUE];
--
2.30.1
[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4209 bytes --]
next prev parent reply other threads:[~2024-06-18 21:54 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-18 21:53 [PATCH net 0/3] bnxt_en: Bug fixes for net Michael Chan
2024-06-18 21:53 ` [PATCH net 1/3] bnxt_en: Update firmware interface to 1.10.3.44 Michael Chan
2024-06-19 20:02 ` Simon Horman
2024-06-18 21:53 ` Michael Chan [this message]
2024-06-20 0:13 ` [PATCH net 2/3] bnxt_en: Set TSO max segs on devices with limits Jakub Kicinski
2024-06-20 6:50 ` Michael Chan
2024-06-20 13:45 ` Jakub Kicinski
2024-06-20 8:11 ` Eric Dumazet
2024-06-18 21:53 ` [PATCH net 3/3] bnxt_en: Restore PTP tx_avail count in case of skb_pad() error Michael Chan
2024-06-19 20:02 ` Simon Horman
2024-06-19 20:04 ` Simon Horman
2024-06-20 14:00 ` [PATCH net 0/3] bnxt_en: Bug fixes for net patchwork-bot+netdevbpf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240618215313.29631-3-michael.chan@broadcom.com \
--to=michael.chan@broadcom$(echo .)com \
--cc=ajit.khaparde@broadcom$(echo .)com \
--cc=andrew.gospodarek@broadcom$(echo .)com \
--cc=davem@davemloft$(echo .)net \
--cc=edumazet@google$(echo .)com \
--cc=kuba@kernel$(echo .)org \
--cc=netdev@vger$(echo .)kernel.org \
--cc=pabeni@redhat$(echo .)com \
--cc=pavan.chebbi@broadcom$(echo .)com \
--cc=somnath.kotur@broadcom$(echo .)com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox