> -----Original Message-----
> From: Stephen Hemminger <step...@networkplumber.org>
> Sent: Tuesday, July 9, 2019 7:47 PM
> To: Haiyang Zhang <haiya...@microsoft.com>
> Cc: sas...@kernel.org; linux-hyp...@vger.kernel.org;
> net...@vger.kernel.org; KY Srinivasan <k...@microsoft.com>; Stephen
> Hemminger <sthem...@microsoft.com>; o...@aepfle.de; vkuznets
> <vkuzn...@redhat.com>; da...@davemloft.net; linux-
> ker...@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 <haiya...@microsoft.com> wrote:
> 
> > -                           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

Reply via email to