5

Similar to https://askubuntu.com/questions/760196/why-is-enps-in-stead-of-eth-whats-the-meaning-of-enps

But what f# stands for in enp#s#f# interface name format?

Wiki states only this, not mentioning f: Adapters in the specified PCI slot, with slot index number on the adapter enp<PCI slot>s<card index no>, similar here https://www.freedesktop.org/wiki/Software/systemd/PredictableNetworkInterfaceNames/

simPod
  • 175
  • 1
    The F might be firmware version, based on https://www.freedesktop.org/wiki/Software/systemd/PredictableNetworkInterfaceNames/. But it's a doozy, as that doc (and several others) refers to https://github.com/systemd/systemd/blob/master/src/udev/udev-builtin-net_id.c#L20 as being canonical (see "linked dupe"!) and that file has a few pushes by "keszybz" to remove the comments, which were apparently the canonical source for the information ... but he doesn't unambigously say where he's moving them to. It might be a man systemd.net-naming-scheme but I can't find that anywhere?? – pbhj Jun 07 '19 at 12:54

1 Answers1

7

The f is for "function indexes".

en = ethernet
p# = PCI bus number
s# = slot number
f# = function index

Added some resources: libvirt.org has a good explanation

waste.org says this about "f":

All devices have at least 1 function, function #0. There are 8 possible functions per device, numbered 0-7. Any device that has more than 1 function is called a multi-function device. Multi-function devices, such as a combination modem+soundcard will usually have 2 uniquely addressable functions, numbered 0 and 1.

The function leads to the vendor and device id:

Every function of a device has 256 eight-bit registers. Registers 0-3F are defined by the PCI specification and provide a wealth of information about the particular function. Registers 40-FF are vendor defined and control the properties of the function itself. Without vendor specific documentation, these registers should probably be left untouched.

  • Registers 0 and 1 are defined by the PCI spec as being the vendor ID. The vendor ID is a 16bit value.
  • Registers 2 and 3 are the device ID

From pbhj's link in comments it leads to the source code:

Line 264+:

if (sscanf(sysname, "%x:%x:%x.%u", &domain, &bus, &slot, &func) != 4)
            return -ENOENT;

if (naming_scheme_has(NAMING_NPAR_ARI) && is_pci_ari_enabled(names->pcidev)) /* ARI devices support up to 256 functions on a single device ("slot"), and interpret the * traditional 5-bit slot and 3-bit function number as a single 8-bit function number, * where the slot makes up the upper 5 bits. / func += slot 8;

Rinzwind
  • 299,756
  • That seems entirely correct, but worth noting that they are not sources concerning the network naming scheme on Ubuntu/*nix, just general "topology of PCI devices" sources. It's an inference that f# is the function, rather than a source showing that is true; but again, it looks right. – pbhj Jun 07 '19 at 13:21
  • 1
    your link led me to https://github.com/systemd/systemd/blob/master/src/udev/udev-builtin-net_id.c#L20 line 264 and onwards. – Rinzwind Jun 07 '19 at 13:23
  • Bingo! (ie you found it) – pbhj Jun 07 '19 at 19:05