Skip to content

Commit 5ceb9ea

Browse files
committed
net/netvsc: retry on SIOCGIFHWADDR failure during VF hotplug
When the MANA VF net directory appears after PCI rescan, udev may rename the interface (e.g. eth1 → ens1) before DPDK can query its MAC address via SIOCGIFHWADDR. The ioctl fails because the interface name is stale during the rename window. Instead of giving up when SIOCGIFHWADDR fails, close the directory and schedule another retry. The next attempt will re-read the directory with the updated interface name (e.g. ens1 instead of eth1) and succeed. This was observed on Azure VMs where the MANA kernel driver takes >30 seconds to probe after PCI rescan, and udev renames the interface immediately after registration. Signed-off-by: Long Li <longli@microsoft.com>
1 parent 9757798 commit 5ceb9ea

1 file changed

Lines changed: 10 additions & 3 deletions

File tree

drivers/net/netvsc/hn_ethdev.c

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -667,10 +667,17 @@ static void netvsc_hotplug_retry(void *args)
667667
ret = ioctl(s, SIOCGIFHWADDR, &req);
668668
close(s);
669669
if (ret == -1) {
670-
PMD_DRV_LOG(ERR,
671-
"Failed to send SIOCGIFHWADDR for device %s",
670+
/* Interface may be renamed by udev (e.g. eth1 → ens1),
671+
* retry instead of giving up.
672+
*/
673+
PMD_DRV_LOG(NOTICE,
674+
"Failed to send SIOCGIFHWADDR for device %s, "
675+
"interface may be renaming, retrying",
672676
dir->d_name);
673-
break;
677+
closedir(di);
678+
rte_eal_alarm_set(NETVSC_HOTADD_RETRY_INTERVAL,
679+
netvsc_hotplug_retry, hot_ctx);
680+
return;
674681
}
675682
if (req.ifr_hwaddr.sa_family != ARPHRD_ETHER)
676683
continue;

0 commit comments

Comments
 (0)