patch 'net/vhost: preserve Tx ownership on VLAN failure' has been queued to stable release 25.11.5

Kevin Traynor ktraynor at redhat.com
Thu Dec 3 14:02:44 CET 2026


Hi,

FYI, your patch has been queued to stable release 25.11.5

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 12/08/26. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://github.com/kevintraynor/dpdk-stable

This queued commit can be viewed at:
https://github.com/kevintraynor/dpdk-stable/commit/ed9db01d58931ae06366deb27a46cb4ad9949300

Thanks.

Kevin

---
>From ed9db01d58931ae06366deb27a46cb4ad9949300 Mon Sep 17 00:00:00 2001
From: Weijun Pan <wpan3636 at gmail.com>
Date: Sun, 26 Jul 2026 12:02:58 -0500
Subject: [PATCH] net/vhost: preserve Tx ownership on VLAN failure

[ upstream commit ee1ac294ccf557e9aeed02fa2f43fe2b7f4a0ec1 ]

The Tx path compacts the input mbuf array after software VLAN
insertion fails. Later packets are moved into the failed packet's
slot while the failed mbuf is freed.

The returned count then no longer identifies a prefix of the original
burst. An application freeing the unsent suffix can therefore free
duplicate or stale mbuf pointers.

Stop preprocessing at the first VLAN insertion failure and leave the
failed mbuf and the remaining suffix owned by the caller. Count only
packets prepared for vhost enqueue but not accepted as missed.

Bugzilla ID: 1884
Fixes: f63d356ee993 ("net/vhost: insert/strip VLAN header in software")

Signed-off-by: Weijun Pan <wpan3636 at gmail.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin at redhat.com>
---
 drivers/net/vhost/rte_eth_vhost.c | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)

diff --git a/drivers/net/vhost/rte_eth_vhost.c b/drivers/net/vhost/rte_eth_vhost.c
index 82e9fc929a..101a8bec87 100644
--- a/drivers/net/vhost/rte_eth_vhost.c
+++ b/drivers/net/vhost/rte_eth_vhost.c
@@ -475,8 +475,7 @@ eth_vhost_tx(void *q, struct rte_mbuf **bufs, uint16_t nb_bufs)
 		if (m->ol_flags & RTE_MBUF_F_TX_VLAN) {
 			int error = rte_vlan_insert(&m);
-			if (unlikely(error)) {
-				rte_pktmbuf_free(m);
-				continue;
-			}
+
+			if (unlikely(error))
+				break;
 		}
 
@@ -484,8 +483,7 @@ eth_vhost_tx(void *q, struct rte_mbuf **bufs, uint16_t nb_bufs)
 			vhost_dev_tx_sw_csum(m);
 
-
-		bufs[nb_send] = m;
-		++nb_send;
+		bufs[i] = m;
 	}
+	nb_send = i;
 
 	/* Enqueue packets to guest RX queue */
@@ -507,5 +505,5 @@ eth_vhost_tx(void *q, struct rte_mbuf **bufs, uint16_t nb_bufs)
 		nb_bytes += bufs[i]->pkt_len;
 
-	nb_missed = nb_bufs - nb_tx;
+	nb_missed = nb_send;
 
 	r->stats.pkts += nb_tx;
-- 
2.56.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2026-12-03 12:52:45.998946417 +0000
+++ 0238-net-vhost-preserve-Tx-ownership-on-VLAN-failure.patch	2026-12-03 12:52:39.196590700 +0000
@@ -1 +1 @@
-From ee1ac294ccf557e9aeed02fa2f43fe2b7f4a0ec1 Mon Sep 17 00:00:00 2001
+From ed9db01d58931ae06366deb27a46cb4ad9949300 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit ee1ac294ccf557e9aeed02fa2f43fe2b7f4a0ec1 ]
+
@@ -20 +21,0 @@
-Cc: stable at dpdk.org
@@ -29 +30 @@
-index 87284fec17..a468a92fe2 100644
+index 82e9fc929a..101a8bec87 100644
@@ -32 +33 @@
-@@ -489,8 +489,7 @@ eth_vhost_tx(void *q, struct rte_mbuf **bufs, uint16_t nb_bufs)
+@@ -475,8 +475,7 @@ eth_vhost_tx(void *q, struct rte_mbuf **bufs, uint16_t nb_bufs)
@@ -44 +45 @@
-@@ -498,8 +497,7 @@ eth_vhost_tx(void *q, struct rte_mbuf **bufs, uint16_t nb_bufs)
+@@ -484,8 +483,7 @@ eth_vhost_tx(void *q, struct rte_mbuf **bufs, uint16_t nb_bufs)
@@ -55 +56 @@
-@@ -521,5 +519,5 @@ eth_vhost_tx(void *q, struct rte_mbuf **bufs, uint16_t nb_bufs)
+@@ -507,5 +505,5 @@ eth_vhost_tx(void *q, struct rte_mbuf **bufs, uint16_t nb_bufs)



More information about the stable mailing list