* [PATCH net] net: dpaa2-eth: recycle the UMEM frame on XDP_PASS in zero-copy
@ 2026-11-26 15:18 Pierpaolo Iannelli
2026-12-04 12:00 ` patchwork-bot+netdevbpf
0 siblings, 1 reply; 2+ messages in thread
From: Pierpaolo Iannelli @ 2026-11-26 15:18 UTC (permalink / raw)
To: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni
Cc: Ioana Ciornei, Andrew Lunn, netdev, Pierpaolo Iannelli
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
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH net] net: dpaa2-eth: recycle the UMEM frame on XDP_PASS in zero-copy
2026-11-26 15:18 [PATCH net] net: dpaa2-eth: recycle the UMEM frame on XDP_PASS in zero-copy Pierpaolo Iannelli
@ 2026-12-04 12:00 ` patchwork-bot+netdevbpf
0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+netdevbpf @ 2026-12-04 12:00 UTC (permalink / raw)
To: Pierpaolo Iannelli
Cc: davem, edumazet, kuba, pabeni, ioana.ciornei, andrew+netdev,
netdev
Hello:
This patch was applied to netdev/net.git (main)
by Paolo Abeni <pabeni@redhat.com>:
On Thu, 26 Nov 2026 16:18:16 +0100 you wrote:
> 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.
>
> [...]
Here is the summary with links:
- [net] net: dpaa2-eth: recycle the UMEM frame on XDP_PASS in zero-copy
https://git.kernel.org/netdev/net/c/5a3d7fad06b5
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-12-04 12:00 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-26 15:18 [PATCH net] net: dpaa2-eth: recycle the UMEM frame on XDP_PASS in zero-copy Pierpaolo Iannelli
2026-12-04 12:00 ` patchwork-bot+netdevbpf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox