Thread View: linux.kernel.netdev
1 messages
1 total messages
Started by memoriaru
Mon, 09 Nov 2026 08:02
[PATCH net v2 1/2] net: sparx5: fix RX ring stall on frames from inactive ports
Author: memoriaru
Date: Mon, 09 Nov 2026 08:02
Date: Mon, 09 Nov 2026 08:02
53 lines
11689 bytes
11689 bytes
From: Zhang Hewei <memoriaru@foxmail.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 <memoriaru@foxmail.com>
---
drivers/net/ethernet/microchip/sparx5/sparx5_fdma.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/microchip/sparx5/sparx5_fdma.c b/drivers/net/ethernet/microchip/sparx5/sparx5_fdma.c
index 15ec9b0..bd021df 100644
--- a/drivers/net/ethernet/microchip/sparx5/sparx5_fdma.c
+++ b/drivers/net/ethernet/microchip/sparx5/sparx5_fdma.c
@@ -159,7 +159,14 @@ static bool sparx5_fdma_rx_get_frame(struct sparx5 *sparx5, struct sparx5_rx *rx
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