From: Vitaliy Sochnev <sochnev.v.74@gmail.com>
To: Lorenzo Bianconi <lorenzo@kernel.org>, netdev@vger.kernel.org
Cc: upstream@airoha.com, Andrew Lunn <andrew+netdev@lunn.ch>,
"David S . Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
linux-mediatek@lists.infradead.org,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org,
Vitaliy Sochnev <sochnev.v.74@gmail.com>
Subject: [PATCH net v2 0/3] net: airoha: fix silent RX loss on the shared CPU ring
Date: Tue, 1 Sep 2026 00:46:58 +0100 [thread overview]
Message-ID: <20260831234701.206021-1-sochnev.v.74@gmail.com> (raw)
In-Reply-To: <20260830095717.37218-1-sochnev.v.74@gmail.com>
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
next prev parent reply other threads:[~2026-08-31 21:47 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-30 9:57 [PATCH 0/4] net: airoha: fix silent RX packet loss on ring 4 Vitaliy Sochnev
2026-08-30 9:57 ` [PATCH net 1/4] net: airoha: handle RX_NO_CPU_DSCP interrupt, not just RX_DONE Vitaliy Sochnev
2026-08-30 13:26 ` Lorenzo Bianconi
2026-08-30 9:57 ` [PATCH net-next 2/4] net: airoha: recover RX ring after hw completion race Vitaliy Sochnev
2026-08-30 14:18 ` Lorenzo Bianconi
2026-08-30 9:57 ` [PATCH net-next 3/4] net: airoha: add rx_stall_recover ethtool counter Vitaliy Sochnev
2026-08-30 9:57 ` [PATCH net-next 4/4] net: airoha: grow RX ring 4 to 128 descriptors Vitaliy Sochnev
2026-08-30 14:24 ` Lorenzo Bianconi
2026-08-31 23:46 ` Vitaliy Sochnev [this message]
2026-08-31 23:46 ` [PATCH net v2 1/3] net: airoha: handle RX_NO_CPU_DSCP interrupt, not just RX_DONE Vitaliy Sochnev
2026-08-31 23:47 ` [PATCH net v2 2/3] net: airoha: recover RX ring after hw completion stall Vitaliy Sochnev
2026-09-01 7:38 ` Lorenzo Bianconi
2026-09-01 18:33 ` Vitaliy Sochnev
2026-08-31 23:47 ` [PATCH net v2 3/3] net: airoha: grow the small RX rings Vitaliy Sochnev
2026-09-01 7:23 ` Lorenzo Bianconi
2026-09-01 18:32 ` [PATCH net v3 0/2] net: airoha: fix silent RX loss on the shared CPU ring Vitaliy Sochnev
2026-09-01 18:32 ` [PATCH net v3 1/2] net: airoha: handle RX_NO_CPU_DSCP interrupt, not just RX_DONE Vitaliy Sochnev
2026-09-01 18:32 ` [PATCH net v3 2/2] net: airoha: grow the small RX rings Vitaliy Sochnev
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260831234701.206021-1-sochnev.v.74@gmail.com \
--to=sochnev.v.74@gmail.com \
--cc=andrew+netdev@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=lorenzo@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=upstream@airoha.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox