Thread (5 messages) 5 messages, 3 authors, 2019-07-10

RE: [PATCH net-next] Name NICs based on vmbus offer and enable async probe by default

From: Haiyang Zhang <haiyangz@microsoft.com>
Date: 2019-07-10 01:04:00
Also in: lkml, netdev

-----Original Message-----
From: Stephen Hemminger <stephen@networkplumber.org>
Sent: Tuesday, July 9, 2019 7:47 PM
To: Haiyang Zhang <haiyangz@microsoft.com>
Cc: sashal@kernel.org; linux-hyperv@vger.kernel.org;
netdev@vger.kernel.org; KY Srinivasan [off-list ref]; Stephen
Hemminger [off-list ref]; olaf@aepfle.de; vkuznets
[off-list ref]; davem@davemloft.net; linux-
kernel@vger.kernel.org
Subject: Re: [PATCH net-next] Name NICs based on vmbus offer and enable
async probe by default

On Tue, 9 Jul 2019 22:56:30 +0000
Haiyang Zhang [off-list ref] wrote:
quoted
-				VRSS_CHANNEL_MAX);
+	if (probe_type == PROBE_PREFER_ASYNCHRONOUS) {
+		snprintf(name, IFNAMSIZ, "eth%d", dev->channel->dev_num);
What about PCI passthrough or VF devices that are also being probed and
consuming the ethN names.  Won't there be a collision?
VF usually shows up a few seconds later than the synthetic NIC. Faster probing
will reduce the probability of collision.
Even if a collision happens, the code below will re-register the NIC with "eth%d":
+	if (ret == -EEXIST) {
+		pr_info("NIC name %s exists, request another name.\n",
+			net->name);
+		strlcpy(net->name, "eth%d", IFNAMSIZ);
+		ret = register_netdevice(net);
+	}

Thanks,
- Haiyang
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help