> -----Original Message-----
> From: Stephen Hemminger <[email protected]>
> Sent: Tuesday, July 9, 2019 7:47 PM
> To: Haiyang Zhang <[email protected]>
> Cc: [email protected]; [email protected];
> [email protected]; KY Srinivasan <[email protected]>; Stephen
> Hemminger <[email protected]>; [email protected]; vkuznets
> <[email protected]>; [email protected]; linux-
> [email protected]
> 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 <[email protected]> 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