Hello,
I've been trying to figure out how predictable interface naming works, especially the "on-board index number", that the firmware apparently passes(?)
I'm currently working on a port for the ASRock B75M-ITX, which has a Realtek NIC as PCI device 03:00.0. The Linux kernel calls this device enp3s0, which makes sense and works fine. However, on my ASUS P8Z77-V and my Lenovo X230, the Intel NIC is called eno0, which makes more sense, because it's "ethernet onboard 0" and not a physical network card stuck in a PCI Express slot.
At first I thought that maybe this was an e1000e-specific way of naming interfaces, but at the office I have an old Gigabyte GA-G41M-ES2L-based file server, running coreboot, also with a Realtek NIC, also being PCI device 03:00.0, which is called eno0 by the kernel as well, with enp3s0 as altname. (So it's not that.)
I ended up reading about the interface (re)naming process, which seems to be handled by systemd-udevd [1]:
--- The following different naming schemes for network interfaces are now supported by udev natively:
1. Names incorporating Firmware/BIOS provided index numbers for on-board devices (example: eno1) 2. Names incorporating Firmware/BIOS provided PCI Express hotplug slot index numbers (example: ens1) 3. Names incorporating physical/geographical location of the connector of the hardware (example: enp2s0) 4. Names incorporating the interfaces's MAC address (example: enx78e7d1ea46da) 5. Classic, unpredictable kernel-native ethX naming (example: eth0) ---
It looks like my B75M-ITX currently uses option 3, while I want it to use option 1, like all my other machines do. So according to the documentation, interfaces called enoX or ensX use index numbers provided by the firmware. However, I have no idea how or where this is defined. I would expect something to be in devicetree.cb, but I can't see anything seemingly related anywhere.
So my question is: how does coreboot pass "index numbers for on-board devices" to the kernel / udev, and how can I define them properly on boards where this is not working the way it should?
[1] https://systemd.io/PREDICTABLE_INTERFACE_NAMES/