linux/drivers/net
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
..
arcnet
bonding netlink: make range pointers in policies const 2023-10-26 16:24:09 -07:00
caif
can Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2023-10-12 17:07:34 -07:00
dsa net: dsa: lan9303: consequently nested-lock physical MDIO 2023-11-02 10:48:09 +01:00
ethernet tg3: Fix the TX ring stall 2023-11-07 22:19:16 +00:00
fddi
fjes netdev: replace napi_reschedule with napi_schedule 2023-10-11 17:28:06 -07:00
hamradio hamradio: replace deprecated strncpy with strscpy_pad 2023-10-17 17:59:55 -07:00
hippi
hyperv hv_netvsc: fix netvsc_send_completion to avoid multiple message length checks 2023-10-11 09:19:01 +01:00
ieee802154 net: ieee802154: adf7242: Fix some potential buffer overflow in adf7242_stats_show() 2023-10-22 11:28:43 +01:00
ipa net: ipa: Annotate struct ipa_power with __counted_by 2023-10-02 11:24:54 -07:00
ipvlan ipvlan: properly track tx_errors 2023-10-27 14:49:09 -07:00
mctp mctp i3c: MCTP I3C driver 2023-10-17 12:45:03 +02:00
mdio net: mdio: fill in missing MODULE_DESCRIPTION()s 2023-11-01 21:50:57 -07:00
netdevsim net: fill in MODULE_DESCRIPTION()s in kuba@'s modules 2023-10-28 11:29:27 +01:00
pcs net: pcs: xpcs: Add 2500BASE-X case in get state for XPCS drivers 2023-10-27 15:59:44 -07:00
phy net: phy: fill in missing MODULE_DESCRIPTION()s 2023-11-01 21:50:56 -07:00
plip
ppp net: implement lockless SO_PRIORITY 2023-10-01 19:09:54 +01:00
pse-pd
slip
team
thunderbolt
usb Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2023-10-26 13:46:28 -07:00
vmxnet3
vxlan vxlan: Cleanup IFLA_VXLAN_PORT_RANGE entry in vxlan_get_size() 2023-10-27 15:36:38 -07:00
wan netdev: replace napi_reschedule with napi_schedule 2023-10-11 17:28:06 -07:00
wireguard
wireless net: fill in MODULE_DESCRIPTION()s in kuba@'s modules 2023-10-28 11:29:27 +01:00
wwan net: wwan: replace deprecated strncpy with strscpy 2023-10-20 18:15:05 -07:00
xen-netback xen-netback: add software timestamp capabilities 2023-10-13 10:19:50 +01:00
amt.c net: fill in MODULE_DESCRIPTION()s under drivers/net/ 2023-10-28 11:29:28 +01:00
bareudp.c bareudp: use ports to lookup route 2023-10-26 15:21:09 +02:00
dummy.c net: fill in MODULE_DESCRIPTION()s under drivers/net/ 2023-10-28 11:29:28 +01:00
eql.c net: fill in MODULE_DESCRIPTION()s under drivers/net/ 2023-10-28 11:29:28 +01:00
geneve.c geneve: use generic function for tunnel IPv6 route lookup 2023-10-23 08:48:57 +01:00
gtp.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2023-10-26 13:46:28 -07:00
ifb.c net: fill in MODULE_DESCRIPTION()s under drivers/net/ 2023-10-28 11:29:28 +01:00
Kconfig netkit, bpf: Add bpf programmable net device 2023-10-24 16:06:03 -07:00
LICENSE.SRC
loopback.c
macsec.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2023-10-12 17:07:34 -07:00
macvlan.c
macvtap.c net: fill in MODULE_DESCRIPTION()s under drivers/net/ 2023-10-28 11:29:28 +01:00
Makefile netkit, bpf: Add bpf programmable net device 2023-10-24 16:06:03 -07:00
mdio.c
mhi_net.c
mii.c
net_failover.c
netconsole.c netconsole: Attach cmdline target to dynamic target 2023-10-13 17:26:38 -07:00
netkit.c netkit: Remove explicit active/peer ptr initialization 2023-10-26 15:58:39 +02:00
nlmon.c
ntb_netdev.c
rionet.c
sb1000.c
Space.c net: appletalk: remove cops support 2023-10-04 11:49:20 -07:00
sungem_phy.c net: fill in MODULE_DESCRIPTION()s under drivers/net/ 2023-10-28 11:29:28 +01:00
tap.c net: fill in MODULE_DESCRIPTION()s under drivers/net/ 2023-10-28 11:29:28 +01:00
tun.c tun: prevent negative ifindex 2023-10-17 17:44:51 -07:00
veth.c net: veth: use newly added page pool API for veth with xdp 2023-10-23 19:14:49 -07:00
virtio_net.c virtio_net: use u64_stats_t infra to avoid data-races 2023-10-27 10:58:15 +01:00
vrf.c
vsockmon.c
xen-netfront.c