* [PATCH] net/af_xdp: fix external mbuf transmit
@ 2026-01-05 12:54 David Marchand
0 siblings, 0 replies; only message in thread
From: David Marchand @ 2026-01-05 12:54 UTC (permalink / raw)
To: dev; +Cc: stable, Ciara Loftus, Maryam Tahhan, Xiaolong Ye, Kevin Laatz
A mbuf may be pointing at external buffer like when forwarding a TSO
packet coming from a vhost-user port in OVS (see
RTE_VHOST_USER_EXTBUF_SUPPORT).
Checking the mbuf mempool to trigger the zero copy optimisation is
broken: the driver will (at best) read 0s or (at worse) crash when
reading more data than what the direct buffer can contain.
Fixes: d8a210774e1d ("net/af_xdp: support unaligned umem chunks")
Cc: stable@dpdk.org
Signed-off-by: David Marchand <david.marchand@redhat.com>
---
drivers/net/af_xdp/rte_eth_af_xdp.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/af_xdp/rte_eth_af_xdp.c b/drivers/net/af_xdp/rte_eth_af_xdp.c
index f2a8fb95d1..10dbcf1333 100644
--- a/drivers/net/af_xdp/rte_eth_af_xdp.c
+++ b/drivers/net/af_xdp/rte_eth_af_xdp.c
@@ -608,7 +608,7 @@ af_xdp_tx_zc(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
for (i = 0; i < nb_pkts; i++) {
mbuf = bufs[i];
- if (mbuf->pool == umem->mb_pool) {
+ if (RTE_MBUF_DIRECT(mbuf) && mbuf->pool == umem->mb_pool) {
desc = reserve_and_fill(txq, mbuf, umem, NULL);
if (!desc) {
kick_tx(txq, cq);
--
2.52.0
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2026-01-05 12:54 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-01-05 12:54 [PATCH] net/af_xdp: fix external mbuf transmit David Marchand
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).