> -----Original Message----- > From: Lennart Poettering <lennart@xxxxxxxxxxxxxx> > Sent: Monday, January 13, 2020 4:18 AM > To: Haiyang Zhang <haiyangz@xxxxxxxxxxxxx> > Cc: Stephen Hemminger <stephen@xxxxxxxxxxxxxxxxxx>; systemd- > devel@xxxxxxxxxxxxxxxxxxxxx; Michael Kelley <mikelley@xxxxxxxxxxxxx> > Subject: Re: Better network naming on Hyper-V/Azure? > > On Fr, 10.01.20 16:17, Haiyang Zhang (haiyangz@xxxxxxxxxxxxx) wrote: > > > > My guess is that this is a lot like SR-IOV slot number that we can > > > already use to name interfaces, right? If so, supporting things the > > > same way sounds totally OK. > > > > Thanks for your explanation. We do want to use the ethN format, and want > the > > results to be the same between Async and sync probing > > Then deal with it in the kernel. Allocating from the same ethN > namespace is always going to be racy if both kernel and userspace do > it. > > That's why the names userspace generally picks for stable Ethernet > interfaces start with "en" followed by some stable suffix of a kind, > under the assumption the kernel will not allocate from that namespace. > > > @Stephen Hemminger Since systemd needs to avoid stepping into the kernel > > ethN formatting, should we do the synthetic NIC naming inside kernel (netvsc > > driver)? > > If you have any other driver register network interfaces on your > kernel than your whole enumeration will go wrong though. If you > tightly control which drivers exist in your environment you might get > away with taking ownership of the ethN namespace entirely from your > own driver and manage it fully. Thanks for your suggestions! So my implementation will keep the naming in kernel driver (netvsc). 1) The netvsc's probe_type will be set to PROBE_DEFAULT_STRATEGY, so user can either continue with the current sync-probing by default, or use module/kernel cmdline option to enable Async-probing if other devices, such as DDA or SRIOV/VF NICs are configured to be named in different space (enP*, etc.) by systemd. 2) If Async-probing option is in use, netvsc driver will use the dev_num based on VMBus offer sequence. It will be the smallest available ethN format, which is the same result as the current sync-probing result. 3) My proposal is that Async probing has the same naming as sync probing. In case of hot add/remove, the names may be reused. The names may change after hot add/remove then reboot once. But the names will be stable in further reboots. It is the same behavior as current code (sync probing). Thanks, - Haiyang _______________________________________________ systemd-devel mailing list systemd-devel@xxxxxxxxxxxxxxxxxxxxx https://lists.freedesktop.org/mailman/listinfo/systemd-devel