From: Zhang Hewei <redacted>
The FDMA RX path on both sparx5 and its lan969x sibling stalls the RX
ring forever when the hardware delivers a frame whose source port does
not map to an active netdev.
In both drivers the RX NAPI loop only advances the software cursor
(fdma_db_advance/fdma_dcb_advance) after a frame has been successfully
delivered. When the source-port lookup fails:
- sparx5 (sparx5_fdma_rx_get_frame()) logs an error, flushes the
extraction FIFO and returns false without touching the cursor,
leaving an skb_put()-extended skb behind in the rx->skb[][] array;
- lan969x (lan969x_fdma_rx_get_frame()) recycles the page and returns
NULL, which makes the poll loop break without touching the cursor.
Since the DCB still carries its hardware DONE bit, every subsequent
NAPI poll picks the same DCB again, takes the same inactive-port branch
and stops again: RX traffic on all ports stalls until the driver module
is reloaded. sparx5_xtr_flush() only drains the QS_XTR hardware FIFO
and does not clear the stall.
Patch 1 treats a bogus frame on sparx5 as consumed: free the skb, clear
the array slot and return true so the NAPI loop advances past the DB as
it does for any other received frame; the slot is refilled by the
dataptr callback when the DCB is recycled. Patch 2 splits the two NULL
meanings on lan969x (allocation failure, which keeps its retry-later
break, vs bogus frame) and advances past bogus frames in the poll loop.
Found by code inspection; the stall needs the hardware to emit a frame
with an invalid source port, which cannot be triggered without hardware.
Review from someone with access to sparx5/lan969x systems would be
appreciated.
Zhang Hewei (2):
net: sparx5: fix RX ring stall on frames from inactive ports
net: lan969x: fix RX ring stall on frames from inactive ports
drivers/net/ethernet/microchip/sparx5/lan969x/lan969x_fdma.c | 18 ++++++++++++++--
drivers/net/ethernet/microchip/sparx5/sparx5_fdma.c | 9 ++++++++-
2 files changed, 25 insertions(+), 2 deletions(-)
--
2.39.5 (Apple Git-154)