patch 'net/netvsc: fix resource leaks on MTU change' has been queued to stable release 24.11.5

luca.boccassi at gmail.com luca.boccassi at gmail.com
Thu Mar 19 23:02:39 CET 2026


Hi,

FYI, your patch has been queued to stable release 24.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 03/21/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/6f8053cb5b1a5261d3d8a592df6b5a123cca7721

Thanks.

Luca Boccassi

---
>From 6f8053cb5b1a5261d3d8a592df6b5a123cca7721 Mon Sep 17 00:00:00 2001
From: Long Li <longli at microsoft.com>
Date: Tue, 3 Mar 2026 12:54:08 -0800
Subject: [PATCH] net/netvsc: fix resource leaks on MTU change

[ upstream commit 980b54aaa21e92382e11f55d316e5ba38de990c6 ]

hn_dev_mtu_set() has several resource management bugs:

1. Calls rte_free(hv->channels[0]) without rte_vmbus_chan_close()
   first, skipping the VMBus close protocol.

2. Does not free hv->primary->rxbuf_info before hn_detach(), causing
   hn_nvs_conn_rxbuf() in hn_reinit() to leak the old allocation.

3. Does not call hn_chim_uninit()/hn_chim_init() around the
   detach/reinit sequence, leaving a stale chimney bitmap that may
   not match the new chim_cnt.

Fix all three issues.

Fixes: 45c83603087e ("net/netvsc: support MTU set")

Signed-off-by: Long Li <longli at microsoft.com>
---
 drivers/net/netvsc/hn_ethdev.c | 18 ++++++++++++++++--
 1 file changed, 16 insertions(+), 2 deletions(-)

diff --git a/drivers/net/netvsc/hn_ethdev.c b/drivers/net/netvsc/hn_ethdev.c
index 43b0911b90..bfce541f2a 100644
--- a/drivers/net/netvsc/hn_ethdev.c
+++ b/drivers/net/netvsc/hn_ethdev.c
@@ -1186,14 +1186,23 @@ hn_dev_mtu_set(struct rte_eth_dev *dev, uint16_t mtu)
 	if (ret)
 		return ret;
 
+	/* Free chimney bitmap and rxbuf_info before NVS detach */
+	hn_chim_uninit(dev);
+	rte_free(hv->primary->rxbuf_info);
+	hv->primary->rxbuf_info = NULL;
+
 	/* Release channel resources */
 	hn_detach(hv);
 
 	/* Close any secondary vmbus channels */
-	for (i = 1; i < hv->num_queues; i++)
+	for (i = 1; i < hv->num_queues; i++) {
 		rte_vmbus_chan_close(hv->channels[i]);
+		hv->channels[i] = NULL;
+	}
+	hv->num_queues = 1;
 
 	/* Close primary vmbus channel */
+	rte_vmbus_chan_close(hv->channels[0]);
 	rte_free(hv->channels[0]);
 
 	/* Unmap and re-map vmbus device */
@@ -1217,16 +1226,21 @@ hn_dev_mtu_set(struct rte_eth_dev *dev, uint16_t mtu)
 		return ret;
 	}
 
+	hv->primary->chan = hv->channels[0];
 	rte_vmbus_set_latency(hv->vmbus, hv->channels[0], hv->latency);
 
 	ret = hn_reinit(dev, mtu);
-	if (!ret)
+	if (!ret) {
+		hn_chim_init(dev);
 		goto out;
+	}
 
 	/* In case of error, attempt to restore original MTU */
 	ret = hn_reinit(dev, orig_mtu);
 	if (ret)
 		PMD_DRV_LOG(ERR, "Restoring original MTU failed for netvsc");
+	else
+		hn_chim_init(dev);
 
 	ret = hn_vf_mtu_set(dev, orig_mtu);
 	if (ret)
-- 
2.47.3

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2026-03-19 22:00:49.489174106 +0000
+++ 0047-net-netvsc-fix-resource-leaks-on-MTU-change.patch	2026-03-19 22:00:47.814359367 +0000
@@ -1 +1 @@
-From 980b54aaa21e92382e11f55d316e5ba38de990c6 Mon Sep 17 00:00:00 2001
+From 6f8053cb5b1a5261d3d8a592df6b5a123cca7721 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 980b54aaa21e92382e11f55d316e5ba38de990c6 ]
+
@@ -21 +22,0 @@
-Cc: stable at dpdk.org
@@ -29 +30 @@
-index a6ed0356bc..61c90bf16e 100644
+index 43b0911b90..bfce541f2a 100644
@@ -32 +33 @@
-@@ -1244,14 +1244,23 @@ hn_dev_mtu_set(struct rte_eth_dev *dev, uint16_t mtu)
+@@ -1186,14 +1186,23 @@ hn_dev_mtu_set(struct rte_eth_dev *dev, uint16_t mtu)
@@ -57 +58 @@
-@@ -1275,16 +1284,21 @@ hn_dev_mtu_set(struct rte_eth_dev *dev, uint16_t mtu)
+@@ -1217,16 +1226,21 @@ hn_dev_mtu_set(struct rte_eth_dev *dev, uint16_t mtu)


More information about the stable mailing list