Thread View: linux.kernel.netdev
1 messages
1 total messages
Started by Zhiqi Zhang
Mon, 30 Nov 2026 07:44
[PATCH net] net: dpaa2-eth: recycle XDP_TX buffers on partial enqueue
Author: Zhiqi Zhang
Date: Mon, 30 Nov 2026 07:44
Date: Mon, 30 Nov 2026 07:44
49 lines
12426 bytes
12426 bytes
dpaa2_eth_xdp_flush() clears xdp_fds->num before returning. That
makes the XDP_TX flush path lose the number of descriptors it tried
to enqueue. When enqueue retries stop after only a subset of the batch
has been accepted, dpaa2_eth_xdp_tx_flush() therefore skips its
cleanup loop and leaves the remaining frame buffers unrecycled while
still accounting only the successful descriptors.
Keep the batch length valid until the caller has handled the result.
The XDP_TX path already clears its queue after recycling the failed
descriptors; clear the redirect batch in dpaa2_eth_xdp_xmit() after
updating stats so its behaviour stays unchanged.
Fixes: 74a1c059168b ("dpaa2-eth: add bulking to XDP_TX")
Signed-off-by: Zhiqi Zhang <zhiqizhangg@gmail.com>
---
AI assistance disclosure: I found the bug. Codex modified the code.
I reviewed the change.
Build-tested with ARCH=arm64 allmodconfig object builds.
I did not test on hardware.
drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c b/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c
index bb3c55d84d..0e50e33cc6 100644
--- a/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c
+++ b/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c
@@ -355,7 +355,6 @@ static int dpaa2_eth_xdp_flush(struct dpaa2_eth_priv *priv,
}
total_enqueued += enqueued;
}
- xdp_fds->num = 0;
return total_enqueued;
}
@@ -2895,6 +2894,7 @@ static int dpaa2_eth_xdp_xmit(struct net_device *net_dev, int n,
percpu_stats->tx_packets += enqueued;
for (i = 0; i < enqueued; i++)
percpu_stats->tx_bytes += dpaa2_fd_get_len(&fds[i]);
+ xdp_redirect_fds->num = 0;
return enqueued;
}
base-commit: 25faec9ce61c01fb45abf812a222c5b43c3cd5c5
--
2.54.0 (Apple Git-157)
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