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

luca.boccassi at gmail.com luca.boccassi at gmail.com
Thu Nov 5 17:41:37 CET 2026


Hi,

FYI, your patch has been queued to stable release 24.11.9

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 11/07/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/bluca/dpdk-stable

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/7abe716e1b3a71b863e46334bc3a2f4b018284fe

Thanks.

Luca Boccassi

---
>From 7abe716e1b3a71b863e46334bc3a2f4b018284fe 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 bf66a7e67fd..6dc98fdbdd8 100644
--- a/drivers/net/vhost/rte_eth_vhost.c
+++ b/drivers/net/vhost/rte_eth_vhost.c
@@ -473,19 +473,17 @@ eth_vhost_tx(void *q, struct rte_mbuf **bufs, uint16_t nb_bufs)
 		/* Do VLAN tag insertion */
 		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;
 		}
 
 		if (r->internal->tx_sw_csum)
 			vhost_dev_tx_sw_csum(m);
 
-
-		bufs[nb_send] = m;
-		++nb_send;
+		bufs[i] = m;
 	}
+	nb_send = i;
 
 	/* Enqueue packets to guest RX queue */
 	while (nb_send) {
@@ -505,7 +503,7 @@ eth_vhost_tx(void *q, struct rte_mbuf **bufs, uint16_t nb_bufs)
 	for (i = 0; likely(i < nb_tx); i++)
 		nb_bytes += bufs[i]->pkt_len;
 
-	nb_missed = nb_bufs - nb_tx;
+	nb_missed = nb_send;
 
 	r->stats.pkts += nb_tx;
 	r->stats.bytes += nb_bytes;
-- 
2.47.3

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2026-11-05 16:42:45.431904004 +0000
+++ 0010-net-vhost-preserve-Tx-ownership-on-VLAN-failure.patch	2026-11-05 16:42:44.893059950 +0000
@@ -1 +1 @@
-From ee1ac294ccf557e9aeed02fa2f43fe2b7f4a0ec1 Mon Sep 17 00:00:00 2001
+From 7abe716e1b3a71b863e46334bc3a2f4b018284fe 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 bf66a7e67fd..6dc98fdbdd8 100644
@@ -32 +33 @@
-@@ -488,19 +488,17 @@ eth_vhost_tx(void *q, struct rte_mbuf **bufs, uint16_t nb_bufs)
+@@ -473,19 +473,17 @@ eth_vhost_tx(void *q, struct rte_mbuf **bufs, uint16_t nb_bufs)
@@ -57 +58 @@
-@@ -520,7 +518,7 @@ eth_vhost_tx(void *q, struct rte_mbuf **bufs, uint16_t nb_bufs)
+@@ -505,7 +503,7 @@ eth_vhost_tx(void *q, struct rte_mbuf **bufs, uint16_t nb_bufs)


More information about the stable mailing list