]> www.infradead.org Git - users/willy/pagecache.git/commitdiff
bnxt_en: Set TSO max segs on devices with limits
authorMichael Chan <michael.chan@broadcom.com>
Tue, 18 Jun 2024 21:53:12 +0000 (14:53 -0700)
committerJakub Kicinski <kuba@kernel.org>
Thu, 20 Jun 2024 13:46:08 +0000 (06:46 -0700)
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>
Link: https://lore.kernel.org/r/20240618215313.29631-3-michael.chan@broadcom.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/broadcom/bnxt/bnxt.c
drivers/net/ethernet/broadcom/bnxt/bnxt.h

index c437ca1c0fd3996ad6447de5dd7747b0e16bf978..89d29d6d75175bcf96e96378463bd69d3c66d7cf 100644 (file)
@@ -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;
index bbc7edccd5a4d0b24b3b1274bafe6f4acce6ad85..9cf0acfa04e574eed3f943333ecb78754498268e 100644 (file)
@@ -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];