Thread View: linux.kernel.netdev
1 messages
1 total messages
Started by Pierpaolo Iannelli
Thu, 26 Nov 2026 15:18
[PATCH net] net: dpaa2-eth: recycle the UMEM frame on XDP_PASS in zero-copy
Author: Pierpaolo Iannelli
Date: Thu, 26 Nov 2026 15:18
Date: Thu, 26 Nov 2026 15:18
44 lines
12453 bytes
12453 bytes
dpaa2_xsk_rx() copies the frame into an skb and hands it to the networking
stack, but never returns the UMEM frame to the hardware buffer pool. The
frame is neither redirected nor recycled, and ch->buf_count is left
untouched, so dpaa2_eth_refill_pool() never runs: after
DPAA2_ETH_NUM_BUFS (1280) XDP_PASS packets per channel the pool is empty
and the queue stops receiving.
The non-zero-copy path does the same copy through dpaa2_eth_copybreak()
and calls dpaa2_eth_recycle_buf() after dpaa2_eth_receive_skb(); the
error path of dpaa2_xsk_rx() recycles the buffer as well. Do the same on
the XDP_PASS success path.
Not tested on DPAA2 hardware: the defect was found by reading the code
and reproduced with a userspace harness that extracts the real function
from the tree, compiles it against mocks and simulates the pool
accounting.
Fixes: beb1930f966d ("dpaa2-eth: recycle the RX buffer only after all processing done")
Cc: stable@vger.kernel.org # 6.1+
Signed-off-by: Pierpaolo Iannelli <pierpaoloiannelli18@gmail.com>
---
If a hardware test is required, I do not have a DPAA2 board and would need
help from someone who does.
drivers/net/ethernet/freescale/dpaa2/dpaa2-xsk.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/net/ethernet/freescale/dpaa2/dpaa2-xsk.c b/drivers/net/ethernet/freescale/dpaa2/dpaa2-xsk.c
index 4b0ae7d9a..ce9094cca 100644
--- a/drivers/net/ethernet/freescale/dpaa2/dpaa2-xsk.c
+++ b/drivers/net/ethernet/freescale/dpaa2/dpaa2-xsk.c
@@ -142,6 +142,9 @@ static void dpaa2_xsk_rx(struct dpaa2_eth_priv *priv,
/* Send the skb to the Linux networking stack */
dpaa2_eth_receive_skb(priv, ch, fd, vaddr, fq, percpu_stats, skb);
+ /* The packet was copied into the skb, return the frame to the pool. */
+ dpaa2_eth_recycle_buf(priv, ch, addr);
+
return;
err_alloc_skb:
--
2.34.1
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