linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Haiyang Zhang <haiyangz@microsoft.com>
To: David Miller <davem@davemloft.net>
Cc: "sashal@kernel.org" <sashal@kernel.org>,
	"linux-hyperv@vger.kernel.org" <linux-hyperv@vger.kernel.org>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	KY Srinivasan <kys@microsoft.com>,
	Stephen Hemminger <sthemmin@microsoft.com>,
	"olaf@aepfle.de" <olaf@aepfle.de>, vkuznets <vkuznets@redhat.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: RE: [PATCH V3,net-next, 0/3] Add vmbus dev_num and allow netvsc probe options
Date: Fri, 3 Jan 2020 02:41:12 +0000	[thread overview]
Message-ID: <MN2PR21MB1375E1485B7A09D87A7EED0DCA230@MN2PR21MB1375.namprd21.prod.outlook.com> (raw)
In-Reply-To: <20200102.162941.1933071871521624803.davem@davemloft.net>



> -----Original Message-----
> From: David Miller <davem@davemloft.net>
> Sent: Thursday, January 2, 2020 7:30 PM
> To: Haiyang Zhang <haiyangz@microsoft.com>
> Cc: sashal@kernel.org; linux-hyperv@vger.kernel.org; netdev@vger.kernel.org;
> KY Srinivasan <kys@microsoft.com>; Stephen Hemminger
> <sthemmin@microsoft.com>; olaf@aepfle.de; vkuznets
> <vkuznets@redhat.com>; linux-kernel@vger.kernel.org
> Subject: Re: [PATCH V3,net-next, 0/3] Add vmbus dev_num and allow netvsc
> probe options
> 
> From: Haiyang Zhang <haiyangz@microsoft.com>
> Date: Tue, 31 Dec 2019 14:13:31 -0800
> 
> > Add dev_num for vmbus device based on channel offer sequence.
> > User programs can use this number for nic naming.
> > Async probing option is allowed for netvsc. Sync probing is still the
> > default.
> 
> I don't like this at all, sorry.
> 
> If 4 devices get channels we will have IDs 1, 2, 3, 4.
> 
> Then if channel 3 is taken down, the next one will get 3 which is not in order
> any more.
> 
> It is not even clear what semantics these numbers have in any particular
> sequence or probe situation.
> 
> You have to use something more persistent across boots to number and strictly
> identify these virtual devices.
> 
> I'm not applying this.

The idea of this patch set is to make the naming of async probing same as that
in sync probing.

So, the semantics of this dev_num is actually same as the default "eth%d" naming --
	"Find the smallest number >=0, which is not in use."

In cases:
1) There is no hot add/remove devices in current boot, this scheme does provide 
persistent dev_num across reboot, because Hyper-V hosts offer the primary channels
in order. So the results based on this number with async probing will be the same 
as existing Sync probing.

2) If there is hot add/remove devices, this scheme generates the same results (when
user program use dev_num)  as the default naming mode -- by using the smallest
available number N in the format ethN.

In case of hot add/remove of virtual NICs, the removed NIC are gone, and the newly 
added NIC is a completely new virtual device with new device instance UUID. So if we 
don't reuse the previous numbers, the device name ethN will grow unbounded. For 
example, hot add/remove a virtual NIC 100 times, you will have a name like eth100. This 
not what the default naming scheme does, and we are not doing it for dev_num here 
either.

So the semantics is: "Find smallest number >=0, and not in use".

But if any customer wants to have a 1:1 mapping between the UUID and device name, they
can still implement that in user mode... And that's why this patch set doesn't change
the kernel naming from driver -- it just provides a new variable, "dev_num", so user 
mode program has the option to use it in async mode with knowledge of the channel
offer sequence.

Thanks,
- Haiyang


      reply	other threads:[~2020-01-03  2:41 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-31 22:13 [PATCH V3,net-next, 0/3] Add vmbus dev_num and allow netvsc probe options Haiyang Zhang
2019-12-31 22:13 ` [PATCH V3,net-next, 1/3] Drivers: hv: vmbus: Add a dev_num variable based on channel offer sequence Haiyang Zhang
2019-12-31 22:13 ` [PATCH V3,net-next, 2/3] Drivers: hv: vmbus: Add dev_num to sysfs Haiyang Zhang
2019-12-31 22:13 ` [PATCH V3,net-next, 3/3] hv_netvsc: Set probe_type to PROBE_DEFAULT_STRATEGY Haiyang Zhang
2020-01-03  0:29 ` [PATCH V3,net-next, 0/3] Add vmbus dev_num and allow netvsc probe options David Miller
2020-01-03  2:41   ` Haiyang Zhang [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=MN2PR21MB1375E1485B7A09D87A7EED0DCA230@MN2PR21MB1375.namprd21.prod.outlook.com \
    --to=haiyangz@microsoft.com \
    --cc=davem@davemloft.net \
    --cc=kys@microsoft.com \
    --cc=linux-hyperv@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=olaf@aepfle.de \
    --cc=sashal@kernel.org \
    --cc=sthemmin@microsoft.com \
    --cc=vkuznets@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).