mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-08-28 11:03:14 -04:00
Add a reconfig_tx_stall test that detects the possibility of a TX stall after ring reconfiguration. The key observation is that drivers using netif_tx_start_all_queues() are prone to experiencing a stall when reconfiguration completes compared to drivers using netif_tx_wake_all_queues(). start_all_queues only clears DRV_XOFF, while wake_all_queues also calls __netif_schedule() to kick the qdisc. Without the kick, qdisc backlog present at reconfig time can stay stuck until a new trigger is issued. The test caps the TX ring at 64 entries so it fills quickly, then installs FQ on a target TX queue and sends UDP packets with SO_TXTIME scheduled in the future. With napi_defer_hard_irqs slowing completions, the small ring can fill when FQ releases the burst, leaving requeued qdisc backlog with no FQ timer to rescue it. A subsequent ring reconfig must wake the queues to drain the backlog. Simply starting the queues can leave it stuck. Some drivers lack backpressure on the TX path and may not be able to build up the qdisc backlog the test relies on. In that case report an expected failure (xfail) instead of a hard failure. Testing on some of the existing drivers: Driver-A does not have the bug, Driver-B has the bug, Driver-C had the bug but it is fixed now. Driver-A: ./drivers/net/ring_reconfig.py -t reconfig_tx_stall TAP version 13 1..1 Sent 1024 SO_TXTIME packets (+100ms) Backlog before reconfig: 1176378 bytes ok 1 ring_reconfig.reconfig_tx_stall Totals: pass:1 fail:0 xfail:0 xpass:0 skip:0 error:0 Driver-B: TAP version 13 1..1 Sent 128 SO_TXTIME packets (+100ms) Sent 128 SO_TXTIME packets (+200ms) Backlog before reconfig: 148372 bytes Check| At ./drivers/net/ring_reconfig.py, line 397, in reconfig_tx_stall: Check| ksft_eq(0, backlog, Check failed 0 != 148372 qdisc backlog stuck on queue 1 after ring .... not ok 1 ring_reconfig.reconfig_tx_stall Totals: pass:0 fail:1 xfail:0 xpass:0 skip:0 error:0 Driver-C: TAP version 13 1..1 Sent 128 SO_TXTIME packets (+100ms) Backlog before reconfig: 192278 bytes ok 1 ring_reconfig.reconfig_tx_stall Totals: pass:1 fail:0 xfail:0 xpass:0 skip:0 error:0 Signed-off-by: Mohsin Bashir <hmohsin@meta.com> Link: https://patch.msgid.link/20260731021543.1058526-1-mohsin.bashr@gmail.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>