1
0
Fork 0
mirror of synced 2025-03-06 20:59:54 +01:00
linux/drivers/net/ethernet/broadcom
Alex Pakhunov c542b39b60 tg3: Fix the TX ring stall
The TX ring maintained by the tg3 driver can end up in the state, when it
has packets queued for sending but the NIC hardware is not informed, so no
progress is made. This leads to a multi-second interruption in network
traffic followed by dev_watchdog() firing and resetting the queue.

The specific sequence of steps is:

1. tg3_start_xmit() is called at least once and queues packet(s) without
   updating tnapi->prodmbox (netdev_xmit_more() returns true)
2. tg3_start_xmit() is called with an SKB which causes tg3_tso_bug() to be
   called.
3. tg3_tso_bug() determines that the SKB is too large, ...

        if (unlikely(tg3_tx_avail(tnapi) <= frag_cnt_est)) {

   ... stops the queue, and returns NETDEV_TX_BUSY:

        netif_tx_stop_queue(txq);
        ...
        if (tg3_tx_avail(tnapi) <= frag_cnt_est)
                return NETDEV_TX_BUSY;

4. Since all tg3_tso_bug() call sites directly return, the code updating
   tnapi->prodmbox is skipped.

5. The queue is stuck now. tg3_start_xmit() is not called while the queue
   is stopped. The NIC is not processing new packets because
   tnapi->prodmbox wasn't updated. tg3_tx() is not called by
   tg3_poll_work() because the all TX descriptions that could be freed has
   been freed:

        /* run TX completion thread */
        if (tnapi->hw_status->idx[0].tx_consumer != tnapi->tx_cons) {
                tg3_tx(tnapi);

6. Eventually, dev_watchdog() fires triggering a reset of the queue.

This fix makes sure that the tnapi->prodmbox update happens regardless of
the reason tg3_start_xmit() returned.

Signed-off-by: Alex Pakhunov <alexey.pakhunov@spacex.com>
Signed-off-by: Vincent Wong <vincent.wong2@spacex.com>
Reviewed-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2023-11-07 22:19:16 +00:00
..
asp2 net: ethernet: broadcom: Convert to platform remove callback returning void 2023-09-20 09:06:37 +01:00
bnx2x Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2023-08-24 10:51:39 -07:00
bnxt bnxt_en: Fix 2 stray ethtool -S counters 2023-10-26 19:43:38 -07:00
genet net: bcmgenet: Remove custom ndo_poll_controller() 2023-10-08 17:42:43 +01:00
b44.c broadcom: b44: Use b44_writephy() return value 2023-08-16 07:08:29 +01:00
b44.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
bcm63xx_enet.c bcm63xx_enet: replace deprecated strncpy with strscpy 2023-10-09 19:38:35 -07:00
bcm63xx_enet.h bcm63xx_enet: convert to build_skb 2021-01-07 12:39:53 -08:00
bcm4908_enet.c net: ethernet: broadcom: Convert to platform remove callback returning void 2023-09-20 09:06:37 +01:00
bcm4908_enet.h net: broadcom: rename BCM4908 driver & update DT binding 2021-02-11 15:04:17 -08:00
bcmsysport.c net: dsa: Use conduit and user terms 2023-10-24 13:08:14 -07:00
bcmsysport.h net: systemport: Add support for RDMA overflow statistic counter 2022-10-31 20:05:03 -07:00
bgmac-bcma-mdio.c net: ethernet: bgmac: Fix refcount leak in bcma_mdio_mii_register 2022-06-06 14:38:15 -07:00
bgmac-bcma.c net: bgmac: fix BCM5358 support by setting correct flags 2023-02-09 22:25:31 -08:00
bgmac-platform.c net: ethernet: broadcom: Convert to platform remove callback returning void 2023-09-20 09:06:37 +01:00
bgmac.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2023-08-24 10:51:39 -07:00
bgmac.h bgmac: fix *initial* chip reset to support BCM5358 2023-02-28 11:10:05 +01:00
bnx2.c net: remove __skb_frag_set_page() 2023-05-13 19:47:56 +01:00
bnx2.h bnx2: Drop redundant pci_enable_pcie_error_reporting() 2023-03-08 23:34:38 -08:00
bnx2_fw.h
cnic.c dma-mapping updates for Linux 2.6 2022-12-13 09:05:19 -08:00
cnic.h
cnic_defs.h net: cnic: fix spelling mistake "reserverd" -> "reserved" 2020-02-17 21:59:16 -08:00
cnic_if.h
Kconfig bcmasp: BCMASP should depend on ARCH_BRCMSTB 2023-07-26 21:46:41 -07:00
Makefile net: bcmasp: Add support for ASP2.0 Ethernet controller 2023-07-17 07:39:04 +01:00
sb1250-mac.c net: ethernet: broadcom: Convert to platform remove callback returning void 2023-09-20 09:06:37 +01:00
tg3.c tg3: Fix the TX ring stall 2023-11-07 22:19:16 +00:00
tg3.h tg3: Improve PTP TX timestamping logic 2023-10-15 14:30:24 +01:00
unimac.h net: broadcom: share header defining UniMAC registers 2021-01-08 19:17:28 -08:00