🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: linux.kernel.netdev
1 messages
1 total messages Started by memoriaru Sun, 08 Nov 2026 18:45
[PATCH net 1/2] net: sparx5: fix RX ring stall on frames from inactive ports
#12825
Author: memoriaru
Date: Sun, 08 Nov 2026 18:45
67 lines
11480 bytes
From: Zhang Hewei <79190669+memoriaru@users.noreply.github.com>

When the FDMA RX path receives a frame whose source port does not map
to an active netdev, sparx5_fdma_rx_get_frame() logs an error, flushes
the extraction FIFO and returns false - without advancing the FDMA
software cursor and without releasing the skb, which has already been
extended with skb_put().

The DCB for this frame still carries its hardware DONE bit, so the next
NAPI poll picks up the same DCB, takes the same inactive-port branch and
returns false again. The software cursor never moves past this DCB, so
RX traffic on all ports stalls until the module is reloaded. The
sparx5_xtr_flush() call only drains the QS_XTR hardware FIFO and does
not touch the DCB ring or the software cursor, so it does not clear the
stall.

Treat a bogus frame as consumed: free the skb, clear its slot in the
rx->skb[][] array and return true, so the NAPI loop advances past the
DB the same way it does for any other received frame. The slot is
refilled by sparx5_fdma_rx_dataptr_cb() when the DCB is recycled.

Found by code inspection; the stall needs the hardware to emit a frame
with an invalid source port, which cannot be triggered without hardware.

Fixes: 10615907e9b5 ("net: sparx5: switchdev: adding frame DMA functionality")
Signed-off-by: Zhang Hewei <79190669+memoriaru@users.noreply.github.com>
---
--- a/drivers/net/ethernet/microchip/sparx5/sparx5_fdma.c

+++ b/drivers/net/ethernet/microchip/sparx5/sparx5_fdma.c

@@ -159,7 +159,14 @@

 	if (!port || !port->ndev) {

 		dev_err(sparx5->dev, "Data on inactive port %d\n", fi.src_port);

 		sparx5_xtr_flush(sparx5, XTR_QUEUE);

-		return false;

+		/*

+		 * The frame is bogus: free it and let the caller advance

+		 * past this DB. Returning false here would stall the RX

+		 * ring, as this DCB is never consumed by the software.

+		 */

+		dev_kfree_skb_any(skb);

+		rx->skb[fdma->dcb_index][fdma->db_index] = NULL;

+		return true;

 	}

 	skb->dev = port->ndev;

 	skb_pull(skb, IFH_LEN * sizeof(u32));


-- 
2.39.5 (Apple Git-154)
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads