Network interface names
As of Linux® kernel 5.13 and with the udev rules of systemd 249, distributions can use predictable and persistent interface names for your RoCE Express PCI functions.
Predictable interface names are preferably based on UIDs. Only if unique UIDs are not guaranteed, predictable interface names are based on FIDs. Kernels that support UID-based predictable interface names have a sysfs attribute /sys/bus/pci/devices/<function_address>/uid_is_unique for its PCI functions. In this path, <function_address> is the PCI ID that identifies a PCI function in the PCI stack.
The availability of predictable interface names on a particular distribution depends on whether the distribution supports and adopts these names. For UID-based predictable interface names, UID uniqueness must be enforced in your environment.
UID uniqueness
- LPAR
- The hardware administrator must set the UID uniqueness option in the
hardware configuration of the partition.
For more information, see the section about defining partitions in z/OS® HCD User's Guide, SC34-2669.
- DPM partition
- UID uniqueness is always enforced.
- KVM virtual server
- UID uniqueness is always enforced.
- z/VM® guest virtual machine
- UID uniqueness must be enforced in both the partition and in z/VM.
# cat /sys/bus/pci/devices/0001:00:00.0/uid_is_unique
1
If it is supported, ensure that UID uniqueness is enforced to attain the most convenient interface names for your environment.
Predictable names
- eno
- With enforced UID uniqueness, interface names depend only on the UID. The format is
eno<UID_in_dec>
, where <UID_in_dec> is the UID in decimal notation. - ens
- Without enforced UID uniqueness, interface names depend only on the FID. The format is
ens<FID_in_dec>
, where <FID_in_dec> is the FID in decimal notation.
UID and FID of the PCI function | With enforced UID uniqueness (preferred) | Without enforced UID uniqueness |
---|---|---|
UID: 0x0, FID: 0x0 | eno0 | ens0 |
UID: 0x5, FID: 0x7 | eno5 | ens7 |
UID: 0xa, FID: 0xb | eno10 | ens11 |
UID: 0x10, FID: 0x20 | eno16 | ens32 |
The eth<n> naming scheme
Distributions that do not adopt predictable interface names might use the earlier eth<n> scheme.
Such distributions typically assure a persistent mapping of PCI functions to interface names through distribution-specific
tooling. On other distributions, forcing the eth<n> naming scheme with the
net.ifnames=0
can lead to a nonpersistent mapping.
Other naming schemes
- enP<UID_or_counter>s<FID_in_dec>
- enP<UID_or_counter>p0s
- enP<UID_or_counter>p0np0
- enP<UID_or_counter>p0s0np0
- enP<UID_or_counter>p0
This list is not exhaustive, and even the
ens<FID_in_dec>
pattern might be used.
In these schemes, <UID_or_counter> represents the UID, in decimal notation, in environments where UID uniqueness is enforced. Without UID uniqueness, a hexadecimal counter is used. <FID_in_dec> represents the FID in decimal notation.
For example, the interface name for a PCI function with FID 0x8ca
and UID 0x10
could be
enP16s2250
, enP0s2250
, enP1s2250
, ...
enP7s2250
, enP16p0s
, enP0p0s
,
enP1p0s
, ... enP16p0np0
...
The multiple dependencies on the hardware, on the hardware configuration, on the Linux kernel, and on the udev-rules of the distribution makes it difficult and error prone to predict interface names that follow these schemes.
altnames
Distributions might include interface names for multiple naming schemes as altnames. Such altnames can include predictable interface names. Always use the primary interface name for your network configuration. For example, you might not be able to use altnames for persistent configurations.
The output of ip a shows altnames, if present, for your network interfaces.
# ip a
1: lo: ...
...
2: eno4272: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
link/ether 82:11:a1:b9:82:06 brd ff:ff:ff:ff:ff:ff
altname ens993
altname enP4272p0s0
...