udev-builtin-net_id: align VF representor names with VF names
Certain cards support to set their eswitch to switchdev mode. In this mode for each created VF there is also created so called VF representor. This representor is helper network interface used for configuration of mentioned eswitch and belongs to an appropriate PF. VF representors are identified by the specific value of phys_port_name attribute and the value has format "pfMvfN" where M is PF function number and N is VF number inside this PF. As the VF representor interfaces belong to PF PCI device the naming scheme used for them is the same like for other PCI devices. In this case name of PF interface is used and phys_port_name suffix is appended. E.g. PF=enp65s0f0np0 # phys_port_name for PF interface is 'p0' VF=enp65s0f0np0v0 # v0 is appended for VF0 in case of NAMING_SR_IOV_V REP=enp65s0f0np0pf0vf0 # phys_port_name for VF0 representor is 'pf0vf0' First as the phys_port_name for representors is long (6+ chars) then the generated name does not fit into IFNAMSIZ so this name is used only as alternate interface name and for the primary one is used generic one like eth<N>. Second 'f0' and 'pf0' in REP name is redundant. This patch fixes this issue by introducing another naming scheme for VF representors and appending 'rN' suffix to PF interface name for them. N is VF number so the name used for representor interface is similar to VF interface and differs only by the suffix. For the example above we get: PF=enp65s0f0np0 VF=enp65s0f0np0v0 REP=enp65s0f0np0r0 This eases for userspace to determine which representor interface represents particular VF. Signed-off-by: Ivan Vecera <ivecera@redhat.com>
This commit is contained in:
committed by
Luca Boccassi
parent
1d2b93ff89
commit
88d2bda812
@@ -39,6 +39,7 @@ typedef enum NamingSchemeFlags {
|
||||
NAMING_BRIDGE_MULTIFUNCTION_SLOT = 1 << 14, /* Use PCI hotplug slot information associated with bridge, but only if PCI device is multifunction */
|
||||
NAMING_DEVICETREE_ALIASES = 1 << 15, /* Generate names from devicetree aliases */
|
||||
NAMING_USB_HOST = 1 << 16, /* Generate names for usb host */
|
||||
NAMING_SR_IOV_R = 1 << 17, /* Use "r" suffix for SR-IOV VF representors */
|
||||
|
||||
/* And now the masks that combine the features above */
|
||||
NAMING_V238 = 0,
|
||||
@@ -53,6 +54,7 @@ typedef enum NamingSchemeFlags {
|
||||
NAMING_V251 = NAMING_V250 | NAMING_BRIDGE_MULTIFUNCTION_SLOT,
|
||||
NAMING_V252 = NAMING_V251 | NAMING_DEVICETREE_ALIASES,
|
||||
NAMING_V253 = NAMING_V252 | NAMING_USB_HOST,
|
||||
NAMING_V254 = NAMING_V253 | NAMING_SR_IOV_R,
|
||||
|
||||
EXTRA_NET_NAMING_SCHEMES
|
||||
|
||||
|
||||
Reference in New Issue
Block a user