Bug 2159448

Summary: SR-IOV VF names are very user-unfriendly
Product: Red Hat Enterprise Linux 9 Reporter: Matt Lucius <malucius>
Component: systemdAssignee: Frantisek Sumsal <fsumsal>
Status: CLOSED ERRATA QA Contact: Frantisek Sumsal <fsumsal>
Severity: high Docs Contact:
Priority: unspecified    
Version: 9.2CC: dtardon, malucius, systemd-maint-list
Target Milestone: rcKeywords: Regression, Triaged
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: systemd-252-4.el9 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-05-09 08:22:21 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 2144442    

Description Matt Lucius 2023-01-09 16:01:18 UTC
Description of problem:
Starting with the 20221219 build of RHEL 9.2, the names of virtual functions no longer make sense after creation. 

Assuming:
An Ethernet interface with a name of ens7f3 and an altname of enp202s0f3
A VF is created using: echo 1 > sriov_numvfs within the appropriate /sys/class directory

in the 20221122 build of RHEL 9.2, the resulting VF is quite logically named ens7f3v0 with a message trail of:
[  340.411745] iavf 0000:ca:19.0 ens7f3v0: renamed from eth0
[  340.496008] iavf 0000:ca:19.0 ens7f3v0: NIC Link is Up Speed is 25 Gbps Full Duplex
[  340.503672] IPv6: ADDRCONF(NETDEV_CHANGE): ens7f3v0: link becomes ready

Starting with the 20221219 build, the resulting VF is named enp202s25f200v0, which bears no readily apparent relationship to the PF from which the user is trying to base a VF.
[  601.212932] iavf 0000:ca:19.0 enp202s25f200v0: renamed from eth0
[  601.297694] iavf 0000:ca:19.0 enp202s25f200v0: NIC Link is Up Speed is 25 Gbps Full Duplex
[  601.305966] IPv6: ADDRCONF(NETDEV_CHANGE): enp202s25f200v0: link becomes ready

This new behavior is breaking current vRAN Fronthaul Security tests (and possibly others), and is quite user-UNfriendly. Comparing notes with a colleague, it doesn't appear to be specific to the E810(ice) boards in my system, but can be seen with other NICs (Yuying Ma has seen it with mlx5_core and ixgbe). There's been some success "fixing" the behavior by using older versions of systemd so I'm starting there.


Version-Release number of selected component (if applicable):
systemd-252-2.el9.x86_64

How reproducible:
Always

Steps to Reproduce:
1.echo 1 > /sys/class/net/<interface>/device/sriov_numvfs
2.Observe: old versions create a VF of <interface>v0, new versions create a VF with something which needs some decoding
3.

Actual results:
User-unfriendly VF name

Expected results:
VF name which makes easy sense

Additional info:

Comment 1 David Tardon 2023-01-10 09:58:06 UTC
What's the output of

# udevadm info /sys/class/net/enp202s25f200v0

?

Comment 2 Matt Lucius 2023-01-16 12:52:23 UTC
[root@dell-per750-16 net]# udevadm info /sys/class/net/enp202s25f200v0
P: /devices/pci0000:c9/0000:c9:02.0/0000:ca:19.0/net/enp202s25f200v0
M: enp202s25f200v0
R: 0
U: net
I: 20
E: DEVPATH=/devices/pci0000:c9/0000:c9:02.0/0000:ca:19.0/net/enp202s25f200v0
E: SUBSYSTEM=net
E: INTERFACE=enp202s25f200v0
E: IFINDEX=20
E: USEC_INITIALIZED=281411389
E: ID_NET_NAMING_SCHEME=rhel-9.0
E: ID_NET_NAME_PATH=enp202s25f200v0
E: ID_BUS=pci
E: ID_VENDOR_ID=0x8086
E: ID_MODEL_ID=0x1889
E: ID_PCI_CLASS_FROM_DATABASE=Network controller
E: ID_PCI_SUBCLASS_FROM_DATABASE=Ethernet controller
E: ID_VENDOR_FROM_DATABASE=Intel Corporation
E: ID_MODEL_FROM_DATABASE=Ethernet Adaptive Virtual Function
E: ID_PATH=pci-0000:ca:19.0
E: ID_PATH_TAG=pci-0000_ca_19_0
E: ID_NET_DRIVER=iavf
E: ID_NET_LINK_FILE=/usr/lib/systemd/network/99-default.link
E: ID_NET_NAME=enp202s25f200v0
E: SYSTEMD_ALIAS=/sys/subsystem/net/devices/enp202s25f200v0
E: TAGS=:systemd:
E: CURRENT_TAGS=:systemd:

Comment 3 David Tardon 2023-01-17 09:39:32 UTC
(In reply to malucius from comment #2)
> E: ID_NET_NAMING_SCHEME=rhel-9.0

Hmm. My first guess was that we botched the rebase and udevd uses rhel-9.2 naming scheme by default. Apparently that's not the case, hence nothing should have changed. On our side, at least, as udevd is normally pretty careful to avoid changes to existing naming schemes (that's why they'd been introduced, after all). But the names are based on attributes exposed by the kernel driver, so maybe that's the source of the change? Could you boot with an older kernel and check if it works? And if it does, get the output of `udevadm info -a` for the device for both kernels?

Comment 4 Matt Lucius 2023-01-17 13:40:54 UTC
I've tried kernel-5.14.0-180.el9 and kernel-5.14.0-200.el9 with the 202301016 build and the problem persists. A "good" example is using the 20221122 build which gives:
[root@dell-per750-15 ~]# udevadm info /sys/class/net/ens7f3v0
P: /devices/pci0000:c9/0000:c9:02.0/0000:ca:19.0/net/ens7f3v0
L: 0
E: DEVPATH=/devices/pci0000:c9/0000:c9:02.0/0000:ca:19.0/net/ens7f3v0
E: INTERFACE=ens7f3v0
E: IFINDEX=20
E: SUBSYSTEM=net
E: USEC_INITIALIZED=259224618
E: ID_NET_NAMING_SCHEME=rhel-9.1
E: ID_NET_NAME_PATH=enp202s0f3v0
E: ID_NET_NAME_SLOT=ens7f3v0
E: ID_BUS=pci
E: ID_VENDOR_ID=0x8086
E: ID_MODEL_ID=0x1889
E: ID_PCI_CLASS_FROM_DATABASE=Network controller
E: ID_PCI_SUBCLASS_FROM_DATABASE=Ethernet controller
E: ID_VENDOR_FROM_DATABASE=Intel Corporation
E: ID_MODEL_FROM_DATABASE=Ethernet Adaptive Virtual Function
E: ID_PATH=pci-0000:ca:19.0
E: ID_PATH_TAG=pci-0000_ca_19_0
E: ID_NET_DRIVER=iavf
E: ID_NET_LINK_FILE=/usr/lib/systemd/network/99-default.link
E: ID_NET_NAME=ens7f3v0
E: SYSTEMD_ALIAS=/sys/subsystem/net/devices/ens7f3v0
E: TAGS=:systemd:
E: CURRENT_TAGS=:systemd:

Comment 7 Plumber Bot 2023-02-02 11:57:06 UTC
fix merged to github main branch -> https://github.com/redhat-plumbers/systemd-rhel9/pull/136

Comment 12 errata-xmlrpc 2023-05-09 08:22:21 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (systemd bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2023:2531