linux/drivers
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
..
accel drm for 6.7-rc1 2023-11-01 06:28:35 -10:00
accessibility
acpi asm-generic updates for v6.7 2023-11-01 15:28:33 -10:00
amba amba: bus: balance firmware node reference counting 2023-10-17 13:37:35 -05:00
android vfs-6.7.ctime 2023-10-30 09:47:13 -10:00
ata ATA changes for 6.7-rc1 2023-11-01 12:50:12 -10:00
atm atm: fore200e: Drop unnecessary of_match_device() 2023-10-10 12:41:17 +02:00
auxdisplay auxdisplay: panel: Replace deprecated strncpy() with strtomem_pad() 2023-09-29 14:48:31 -07:00
base SoC driver updates for 6.7 2023-11-01 14:46:51 -10:00
bcma
block for-6.7/block-2023-10-30 2023-11-01 12:30:07 -10:00
bluetooth Bluetooth: btmtksdio: enable bluetooth wakeup in system suspend 2023-10-23 11:04:51 -07:00
bus SoC driver updates for 6.7 2023-11-01 14:46:51 -10:00
cache riscv: RISCV_NONSTANDARD_CACHE_OPS shouldn't depend on RISCV_DMA_NONCOHERENT 2023-10-26 09:42:37 +02:00
cdrom cdrom: Remove now superfluous sentinel element from ctl_table array 2023-10-02 20:04:58 -06:00
cdx cdx: add support for bus mastering 2023-09-28 12:12:07 -06:00
char asm-generic updates for v6.7 2023-11-01 15:28:33 -10:00
clk SoC driver updates for 6.7 2023-11-01 14:46:51 -10:00
clocksource arm64 updates for 6.7: 2023-11-01 09:34:55 -10:00
comedi
connector Fix NULL pointer dereference in cn_filter() 2023-10-24 10:53:45 +02:00
counter First set of Counter fixes for 6.6 2023-10-02 13:13:15 +02:00
cpufreq asm-generic updates for v6.7 2023-11-01 15:28:33 -10:00
cpuidle cpuidle: dt: Replace deprecated strncpy() with strscpy() 2023-09-29 14:48:31 -07:00
crypto virtio-crypto: handle config changed by work queue 2023-10-18 11:30:06 -04:00
cxl cxl/acpi: Annotate struct cxl_cxims_data with __counted_by 2023-09-22 14:31:04 -07:00
dax
dca
devfreq PM / devfreq: rockchip-dfi: add support for RK3588 2023-10-19 21:21:16 +09:00
dio
dma dmaengine fixes for v6.6 2023-10-13 08:52:57 -07:00
dma-buf dma-buf: add dma_fence_timestamp helper 2023-10-05 11:05:58 +02:00
dpll dpll: netlink/core: change pin frequency set behavior 2023-10-15 16:08:25 +01:00
edac hardening updates for v6.7-rc1 2023-10-30 19:09:55 -10:00
eisa
extcon
firewire scsi: sd: Introduce manage_shutdown device flag 2023-10-27 10:00:19 +09:00
firmware asm-generic updates for v6.7 2023-11-01 15:28:33 -10:00
fpga fpga: Fix memory leak for fpga_region_test_class_find() 2023-10-24 19:32:39 +02:00
fsi
gnss
gpio gpio updates for v6.7-rc1 2023-10-31 17:21:54 -10:00
gpu asm-generic updates for v6.7 2023-11-01 15:28:33 -10:00
greybus
hid drm for 6.7-rc1 2023-11-01 06:28:35 -10:00
hsi
hte hte: Changes for v6.7-rc1 2023-10-31 18:32:51 -10:00
hv
hwmon hwmon updates for v6.7-rc1 2023-10-31 17:44:17 -10:00
hwspinlock
hwtracing coresight: tmc-etr: Disable warnings for allocation failures 2023-09-20 10:46:30 +01:00
i2c gpio updates for v6.7-rc1 2023-10-31 17:21:54 -10:00
i3c i3c: Add support for bus enumeration & notification 2023-10-17 12:45:03 +02:00
idle intel_idle: Add ibrs_off module parameter to force-disable IBRS 2023-10-07 11:33:28 +02:00
iio iio: afe: rescale: Accept only offset channels 2023-10-17 20:25:32 +01:00
infiniband Networking changes for 6.7. 2023-10-31 05:10:11 -10:00
input asm-generic updates for v6.7 2023-11-01 15:28:33 -10:00
interconnect
iommu asm-generic updates for v6.7 2023-11-01 15:28:33 -10:00
ipack
irqchip arm64 updates for 6.7: 2023-11-01 09:34:55 -10:00
isdn hardening updates for v6.7-rc1 2023-10-30 19:09:55 -10:00
leds leds: Drop BUG_ON check for LED_COLOR_ID_MULTI 2023-09-19 15:16:23 +01:00
macintosh
mailbox ACPI updates for 6.7-rc1 2023-10-31 15:33:26 -10:00
mcb mcb: remove is_added flag from mcb_device struct 2023-10-05 09:50:14 +02:00
md - Update DM core to directly call the map function for both the linear 2023-11-01 12:55:54 -10:00
media asm-generic updates for v6.7 2023-11-01 15:28:33 -10:00
memory Memory controller drivers for v6.7 2023-10-16 23:00:46 +02:00
memstick memstick: jmb38x_ms: Annotate struct jmb38x_ms with __counted_by 2023-09-27 12:13:18 +02:00
message
mfd Couple of small fixes, including: 2023-10-05 11:03:20 -07:00
misc asm-generic updates for v6.7 2023-11-01 15:28:33 -10:00
mmc mmc: Merge branch fixes into next 2023-10-27 12:00:35 +02:00
most
mtd gpio updates for v6.7-rc1 2023-10-31 17:21:54 -10:00
mux
net tg3: Fix the TX ring stall 2023-11-07 22:19:16 +00:00
nfc
ntb
nubus
nvdimm
nvme for-6.7/block-2023-10-30 2023-11-01 12:30:07 -10:00
nvmem nvmem: imx: correct nregs for i.MX6ULL 2023-10-16 21:00:08 +02:00
of Devicetree updates for 6.7: 2023-10-31 18:50:13 -10:00
opp OPP: No need to defer probe from _opp_attach_genpd() 2023-10-17 11:11:28 +05:30
parisc parisc/power: Trivial whitespace cleanups and license update 2023-10-30 14:54:40 +01:00
parport
pci asm-generic updates for v6.7 2023-11-01 15:28:33 -10:00
pcmcia
peci
perf arm64 updates for 6.7: 2023-11-01 09:34:55 -10:00
phy phy fixes for 6.6 2023-10-22 07:11:10 -10:00
pinctrl gpio updates for v6.7-rc1 2023-10-31 17:21:54 -10:00
platform platform-drivers-x86 for v6.7-1 2023-10-31 17:53:00 -10:00
pmdomain SoC driver updates for 6.7 2023-11-01 14:46:51 -10:00
pnp PNP: replace deprecated strncpy() with memcpy() 2023-10-20 19:50:40 +02:00
power power: reset: vexpress: Use device_get_match_data() 2023-10-21 00:57:55 +02:00
powercap powercap: intel_rapl: Downgrade BIOS locked limits pr_warn() to pr_debug() 2023-10-24 22:07:07 +02:00
pps
ps3
ptp ptp: prevent string overflow 2023-10-19 15:51:52 -07:00
pwm
rapidio
ras
regulator regulator: Merge up pending fix 2023-10-30 13:14:27 +00:00
remoteproc
reset reset: Annotate struct reset_control_array with __counted_by 2023-10-24 14:10:04 -07:00
rpmsg
rtc
s390 s390/qeth: Fix typo 'weed' in comment 2023-11-07 22:17:20 +00:00
sbus
scsi ATA changes for 6.7-rc1 2023-11-01 12:50:12 -10:00
sh
siox
slimbus
soc SoC driver updates for 6.7 2023-11-01 14:46:51 -10:00
soundwire soundwire: bus: Make IRQ handling conditionally built 2023-09-21 11:31:33 +02:00
spi spi: Merge up fix 2023-10-30 13:20:58 +00:00
spmi
ssb ssb: relax SSB_EMBEDDED dependencies 2023-10-19 10:26:26 +03:00
staging drm for 6.7-rc1 2023-11-01 06:28:35 -10:00
target scsi: target: Convert to bdev_open_by_path() 2023-10-28 13:29:19 +02:00
tc
tee ARM: SoC fixes for 6.6, part 2 2023-10-12 11:52:23 -07:00
thermal Thermal control updates for 6.7-rc1 2023-10-31 15:28:37 -10:00
thunderbolt thunderbolt: Fix for v6.6-rc7 2023-10-17 19:25:42 +02:00
tty asm-generic updates for v6.7 2023-11-01 15:28:33 -10:00
ufs scsi: ufs: core: Correct clear TM error log 2023-10-09 21:33:30 -04:00
uio
usb drm for 6.7-rc1 2023-11-01 06:28:35 -10:00
vdpa vdpa/mlx5: Fix firmware error on creation of 1k VQs 2023-10-18 11:29:41 -04:00
vfio vfio: Fix smatch errors in vfio_combine_iova_ranges() 2023-10-09 15:56:09 -06:00
vhost Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2023-10-26 13:46:28 -07:00
video asm-generic updates for v6.7 2023-11-01 15:28:33 -10:00
virt hardening updates for v6.7-rc1 2023-10-30 19:09:55 -10:00
virtio virtio_pci: fix the common cfg map size 2023-10-18 11:30:12 -04:00
vlynq
w1
watchdog
xen xen: branch for v6.7-rc1 2023-11-01 10:46:48 -10:00
zorro
Kconfig - Move Kconfig files into the pmdomain subsystem 2023-11-01 13:09:46 -10:00
Makefile dpll: core: Add DPLL framework base functions 2023-09-17 11:50:20 +01:00