Bug 2218886

Summary: systemd-udev: Align VF representor names with VF names
Product: Red Hat Enterprise Linux 9 Reporter: Ivan Vecera <ivecera>
Component: systemdAssignee: David Tardon <dtardon>
Status: CLOSED ERRATA QA Contact: Frantisek Sumsal <fsumsal>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 9.3CC: ctrautma, dtardon, jamacku, jiji, mleitner, shuali, systemd-maint-list
Target Milestone: rcKeywords: FeatureBackport, Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: systemd-252-16.el9 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-11-07 08:54:09 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: 2172622    

Description Ivan Vecera 2023-06-30 12:34:53 UTC
Description of problem:
The SR-IOV representors are special interfaces associated with PF device and represent VF devices created on this PF. The representors have specific format of phys_port_name attribute: pf<X>vf<Y>. This value identifies representor for Y-th VF created on X-th PF of certain device. The current version of systemd (udevd) simply appends value of phys_port_name to interface name of associated PF device.

E.g.:
Lets PF interface is enp129s0f0 and 1 VF created over that PF. Then the interface associated with VF is named enp129s0f0v0 and representor should get interface name enp129s0f0pf0vf0 but because such name is 16 chars long and this is longer than value allowed by the kernel (IFNAMSIZ) then primary interface name for representor remains generic (e.g. eth0, eth1...). For userspace scripts is hard to distinguish what representor interface is associated with particular VF device on certain PF device.

Recent upstream PR (https://github.com/systemd/systemd/pull/28118) introduced a change so representor interface names are composed from name of PF device and 'r<N>' suffix similar to VF interface names:

E.g.
PF device interface is enp129s0f0
VF 0 device interface is enp129s0f0v0
VF 0 representor interface is enp129s0f0r0

So it is easy to find representor interface for n-th VF device on particular PF device.

Version-Release number of selected component (if applicable):
252-15.el9

How reproducible:
100%

Steps to Reproduce:
1. Set eswitch mode in SR-IOV capable NIC to switchdev mode using devlink
   E.g. devlink dev eswitch set pci/0000:81:00.0 mode switchdev 
2. Create one or more VFs on the particular NIC PF
3. Check VF representor interface names

Actual results:
See above in description

Expected results:
See above in description

Additional info:
The feature has been merged into upstream by PR:
https://github.com/systemd/systemd/pull/28118

Comment 1 Plumber Bot 2023-07-13 10:29:30 UTC
fix merged to github main branch -> https://github.com/redhat-plumbers/systemd-rhel9/pull/182

Comment 6 errata-xmlrpc 2023-11-07 08:54:09 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:6640