[systemd-devel] udev interface naming for SR-IOV VFs
Tom Gundersen
teg at jklm.no
Mon Apr 20 10:48:31 PDT 2015
On Tue, Apr 14, 2015 at 12:11 PM, Ido Barkan <ibarkan at redhat.com> wrote:
> We are implementing support for SR-IOV network cards. Afer the changing of
> the number of VFs on the card and programmatically querying for all links
> (we use libnl for this) we observe that *during the iteration* over the links
> some of them were renamed by udev and still were not. Meanning, some of them
> are called 'ethN' and some are called 'enp2sNf2' (where N is an arbitrary
> number). Also, there are times that not all of the devices are returned from
> libnl.
> After a _while_ everything stabilizes (# of interfaces and names).
>
> My questions:
> 1. Is this what you would expect from udev? Meaning, this is just async behavior?
> 2. Is there a way to _know_ programmticaly that everything was probed and renamed?
> Not a heuristic?
In short: no. We don't know when the kernel will finish enumerating
all the devices.
What you can know though, is whether a device you receive over netlink
has been fully processed by udev. This is probably what you need,
assuming you always keep listening for new devices in your
daemon/tool.
You can see how we do this in e.g., systemd-networkd where we have
exactly the same situation: our main source of information is rtnl,
but we need to only start using the devices once udev has renamed them
(among other things) so we listen to libudev as well and only start
using a device once both rtnl and libudev has announced it is ready.
HTH,
Tom
More information about the systemd-devel
mailing list