Ethernet device renaming

Hey there,

i have added an USB ethernet adapter to my Xavier NX on 35.4.1
The nvethernet and my usb adapter now switch names from boot to boot, so they are either eth0 or eth1

Which program is responsible for renaming the nvethernet to eth0 or eth1?
biosdevname=0 and net.ifnames=1 is set, so the nvethernet should not be renamed, but it still is eth1 insted of the expected eth0

You could check some udev rules to do the renaming.

Hey @WayneWWW , yeah, that was my first idea too. But I can’t find any udev rule which renames that device…there is no generic rule active, as my device is enp…when i enable the persistens net rule generation, but the nvethernet keeps being named eth0 or eth1. No logs from udev about renaming that device though

Could you check the alias list in device tree that if nvethernet has a fixed interface name ?

I thought of that too, but it is either eth0 or eth1 depending if my usb ethernet adapter is added. So I think we can rule that out?

If there is no udev rule, then the naming should be just the order of when the driver got probed.

For example, if nvethernet is probed earlier than usb driver, then it shall be eth0 first.

This was for a TX2, and so drivers might have changed and such, but here is an example Ethernet rename which detects the original via the driver and not via MAC:

SUBSYSTEM=="net", ACTION=="add", DRIVERS=="*eqos*", ATTR{dev_id}=="0x0", ATTR{type}=="1", NAME="eth0"

The original thread:
https://devtalk.nvidia.com/default/topic/1065308/jetson-tx2/udev-rules-for-tx2i-on-board-ethernet/post/5395645/#5395645

Thanks, ended up doing that.
Could not use eth0 and eth1 anymore though as the device name already exists when udev runs.

If anyone can shed some light on which service is renaming the nvethernet, I’d be happy

The numbering is due to what @WayneWWW already mentioned: Order of enumeration. Whenever the Linux kernel starts it runs one and only one process (which is PID 1; the kernel itself is PID 0): init. Init has so many configurations available and so many peripherals attached, that it just brings up some items at a different time than others if the priority and naming does not purposely bring them up in some exact order. Bringing up Ethernet does not distinguish interfaces, it simply names them in the order they respond. This is in fact udev for many devices which are “plug-n-play”, but other devices might depend on device tree.