[PATCH net V2 0/2] veth: Fix TXQ stall race condition and add recovery
Jesper Dangaard Brouer
hawk at kernel.org
Mon Oct 27 13:05:25 PDT 2025
This patchset addresses a race condition introduced in commit dc82a33297fc
("veth: apply qdisc backpressure on full ptr_ring to reduce TX drops"). In
production, this has been observed to cause a permanently stalled transmit
queue (TXQ) on ARM64 (Ampere Altra Max) systems, leading to a "lost wakeup"
scenario where the TXQ remains in the QUEUE_STATE_DRV_XOFF state and traffic
halts.
The root cause, which is fixed in patch 2, is a racy use of the
__ptr_ring_empty() API from the producer side (veth_xmit). The producer
stops the queue and then checks the ptr_ring consumer's head, but this is
not guaranteed to be correct, when observed from the producer side,
when the NAPI consumer on another CPU has just finished consuming.
This series fixes the bug and make the driver more resilient to recover.
The patches are ordered to first add recovery mechanisms, then fix the
underlying race.
V2:
- Drop patch that changed up/down NDOs
- For race fix add a smb_rmb and improve commit message reasoning for race cases
V1: https://lore.kernel.org/all/176123150256.2281302.7000617032469740443.stgit@firesoul/
---
Jesper Dangaard Brouer (2):
veth: enable dev_watchdog for detecting stalled TXQs
veth: more robust handing of race to avoid txq getting stuck
drivers/net/veth.c | 53 +++++++++++++++++++++++++++++-----------------
1 file changed, 34 insertions(+), 19 deletions(-)
--
More information about the linux-arm-kernel
mailing list