[PATCH net v2 0/3] net: airoha: fix silent RX loss on the shared CPU ring
From: Vitaliy Sochnev
Date: Mon Aug 31 2026 - 20:05:27 EST
All three target net. v1 split them across net/net-next; with the ring
size now shown to be load bearing, they belong together.
Answers to the v1 review:
- "fill_rx_queue() overwrites the DONE bit written by hw" - no. I
implemented that check anyway (bail out in fill_rx_queue(), clear the
bit in rx_process()) and it never fired once, while the ring was
demonstrably stalled: the descriptor at q->head never had
QDMA_DESC_DONE_MASK set, so there was nothing to catch. Worse,
clearing desc->ctrl outright also wipes QDMA_DESC_LEN_MASK, which
fill_rx_queue() writes as the buffer size and hw reads back - RX then
delivers poisoned pages. That version is dropped.
- "have you tried to just increase the queue size" - yes, and that is
the fix. Ring 4 at 16 stalls roughly every 35 s under repeated PPPoE
dial-up and negotiation never completes; at 128 nothing triggered
across 500 forced reconnects over 20 h. Patch 3.
- "is QDMA_DESC_DROP_MASK set when the issue occurs" - no, never, for
the whole duration of the stall.
- default RX_DSCP_NUM raised 16 -> 32 per the vendor SDK, as asked.
- recovery pause measured at 986-1131 us over 13 events, against the
50 ms read_poll_timeout() ceiling.
- style: RCT, verbose comments gone, and the !q->ndesc check dropped -
the bit is only set from rx_process(), which cannot run on a ring
without descriptors.
One cost worth flagging: the detector adds an uncached REG_RX_DMA_IDX
read to every rx_process() call that ends on a non-DONE descriptor. airoha_qdma_rx_napi_poll() loops while the last
pass reaped anything, so that is once or twice per NAPI poll, on every
ring, not just the one that can stall. Gating it on the previous poll
having reaped nothing would keep it off busy rings and only delays
detection by about one poll, since q->tail is frozen from the moment
the stall begins. I left it ungated as I have no profiling either way -
happy to add the gate if you prefer it.
A question for the airoha folks: during the stall REG_RX_DMA_IDX keeps advancing while
REG_RX_CPU_IDX stays put and the consumer never sees another DONE. Is
there a documented condition under which hw stops writing completions
back to a ring, or a constraint on RX_CPU_IDX that the driver is
violating by leaving one descriptor unposted?
The rx_stall_recover ethtool counter from v1 is dropped here - new ABI
does not belong in a fix - and will follow for net-next.
Tested on Nokia XG-040G-MF (AN7583) on a live PPPoE line, in both
configurations: as sent, and with stock ring sizes so the recovery path
actually executes.
Vitaliy Sochnev (3):
net: airoha: handle RX_NO_CPU_DSCP interrupt, not just RX_DONE
net: airoha: recover RX ring after hw completion stall
net: airoha: grow the small RX rings
drivers/net/ethernet/airoha/airoha_eth.c | 114 ++++++++++++++++++++--
drivers/net/ethernet/airoha/airoha_eth.h | 11 ++-
drivers/net/ethernet/airoha/airoha_regs.h | 2 +
3 files changed, 120 insertions(+), 7 deletions(-)
--
2.55.0