patch 'net/netvsc: retry when no matching MAC found' has been queued to stable release 25.11.3
Kevin Traynor
ktraynor at redhat.com
Thu Jul 23 19:14:53 CEST 2026
Hi,
FYI, your patch has been queued to stable release 25.11.3
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 07/27/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/4bcc9cf46fa50a3cc8e40aa787f2a6f9a26c0334
Thanks.
Kevin
---
>From 4bcc9cf46fa50a3cc8e40aa787f2a6f9a26c0334 Mon Sep 17 00:00:00 2001
From: Long Li <longli at microsoft.com>
Date: Fri, 15 May 2026 12:28:39 -0700
Subject: [PATCH] net/netvsc: retry when no matching MAC found
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
[ upstream commit f5d76ab02f19cd102d1d781ad182238791b80360 ]
On multi-NIC Azure VMs, a single MANA PCI device (7870:00:00.0) hosts
multiple VF interfaces. After PCI rescan, these interfaces register
at different times — the management NIC's VF appears first, followed
by the test NIC's VF.
Previously, when netvsc_hotplug_retry scanned the net/ directory and
found interfaces with non-matching MACs, it would exit the readdir
loop and free the hotadd context, permanently giving up. The matching
VF interface had not appeared yet.
Now, when the readdir loop ends without finding a matching MAC (dir
is NULL after loop), schedule another retry instead of giving up.
This uses a separate mac_retry counter (limit 120, ~2 minutes) so
the main retry loop remains unlimited.
Fixes: a2a23a794b3a ("net/netvsc: support VF device hot add/remove")
Signed-off-by: Long Li <longli at microsoft.com>
---
drivers/net/netvsc/hn_ethdev.c | 36 +++++++++++++++++++++++++++++++++-
drivers/net/netvsc/hn_var.h | 1 +
2 files changed, 36 insertions(+), 1 deletion(-)
diff --git a/drivers/net/netvsc/hn_ethdev.c b/drivers/net/netvsc/hn_ethdev.c
index e16a59691e..923753916d 100644
--- a/drivers/net/netvsc/hn_ethdev.c
+++ b/drivers/net/netvsc/hn_ethdev.c
@@ -93,4 +93,10 @@ struct netvsc_mp_param {
#define NETVSC_HOTADD_RETRY_INTERVAL 1000000
+/* Max retries when net/ directory exists but no matching MAC found.
+ * On multi-NIC PCI devices, a second VF may register later.
+ * 120 retries = ~2 minutes.
+ */
+#define NETVSC_MAX_MAC_RETRY 120
+
struct hn_xstats_name_off {
char name[RTE_ETH_XSTATS_NAME_SIZE];
@@ -752,6 +758,34 @@ static void netvsc_hotplug_retry(void *args)
}
+ /* If we opened the net directory but didn't find a matching MAC,
+ * the VF interface may not have appeared yet (e.g. on a multi-NIC
+ * PCI device, the second VF registers later). Retry.
+ */
+ if (di != NULL) {
+ closedir(di);
+ di = NULL;
+ if (dir == NULL) {
+ /* readdir returned NULL — loop ended without match */
+ hot_ctx->mac_retry++;
+ if (hot_ctx->mac_retry < NETVSC_MAX_MAC_RETRY) {
+ PMD_DRV_LOG(DEBUG,
+ "%s: no matching MAC found in %s, "
+ "retrying in 1 second (mac_retry %d/%d)",
+ __func__, buf,
+ hot_ctx->mac_retry,
+ NETVSC_MAX_MAC_RETRY);
+ rte_eal_alarm_set(NETVSC_HOTADD_RETRY_INTERVAL,
+ netvsc_hotplug_retry,
+ hot_ctx);
+ return;
+ }
+ PMD_DRV_LOG(NOTICE,
+ "%s: no matching MAC found after %d retries, giving up",
+ __func__, hot_ctx->mac_retry);
+ }
+ }
+
free_hotadd_ctx:
- if (di)
+ if (di != NULL)
closedir(di);
diff --git a/drivers/net/netvsc/hn_var.h b/drivers/net/netvsc/hn_var.h
index ef55dee28e..574b909c82 100644
--- a/drivers/net/netvsc/hn_var.h
+++ b/drivers/net/netvsc/hn_var.h
@@ -128,4 +128,5 @@ struct hv_hotadd_context {
struct rte_devargs da;
int eal_hot_plug_retry;
+ int mac_retry;
};
--
2.55.0
---
Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- - 2026-07-23 17:57:59.544702236 +0100
+++ 0030-net-netvsc-retry-when-no-matching-MAC-found.patch 2026-07-23 17:57:58.642348766 +0100
@@ -1 +1 @@
-From f5d76ab02f19cd102d1d781ad182238791b80360 Mon Sep 17 00:00:00 2001
+From 4bcc9cf46fa50a3cc8e40aa787f2a6f9a26c0334 Mon Sep 17 00:00:00 2001
@@ -8,0 +9,2 @@
+[ upstream commit f5d76ab02f19cd102d1d781ad182238791b80360 ]
+
@@ -25 +26,0 @@
-Cc: stable at dpdk.org
@@ -34 +35 @@
-index 16fb2b344d..72743872bb 100644
+index e16a59691e..923753916d 100644
@@ -48 +49 @@
-@@ -769,6 +775,34 @@ static void netvsc_hotplug_retry(void *args)
+@@ -752,6 +758,34 @@ static void netvsc_hotplug_retry(void *args)
More information about the stable
mailing list