udev: net_id: Improve predictable names for SR-IOV virtual devices
authorStuart Hayes <stuart_hayes@dell.com>
Wed, 17 Jan 2018 19:31:55 +0000 (14:31 -0500)
committerStuart Hayes <stuart_hayes@dell.com>
Mon, 26 Mar 2018 18:00:43 +0000 (14:00 -0400)
commit609948c7043a40008b8299529c978ed8e11de8f6
tree3220f3286c1191e740220f5dbb1ccbeb7c398aa2
parent9009d3b5c3b6d191be69215736be77583e0f23f9
udev: net_id: Improve predictable names for SR-IOV virtual devices

With PCI SR-IOV, a number of virtual network devices can be enabled,
all of which share the same physical network device.  Currently,
udev generates names for SR-IOV virtual functions as if they were
independent network devices.

With this change, the predictable network device naming code will
check if a network device is an SR-IOV virtual device, and will
generate a name based on the physical PCI device plus a "v%u"
suffix.  This should improve readability and predictability of
device names.

Here is an example of how this change would affect naming:

before patch  |  after patch
-----------------------------
eno1          |  eno1          onboard NIC, physical function
enp101s0f0    |  eno1v0        onboard NIC, SR-IOV virtual func 0
enp101s0f1    |  eno1v1        onboard NIC, SR-IOV virtual func 1
src/udev/udev-builtin-net_id.c