udev randomly failed to rename network interface

Hi everyone:
We are using jetpack3.2.1 on tx1, we have two network interface: the tx1’s r8152 and a pcie netcard r8169 .Inorder to set the r8152 as eth0 and r8169 as eth1 we add the /etc/udev/rules.d/70-persistent-net.rules as following:

SUBSYSTEMS=="pci", ACTION=="add", DRIVERS=="?*", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"
SUBSYSTEMS=="usb", ACTION=="add", DRIVERS=="?*", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"

Most of the time is works well, but we found that at a very rare case, the udev will failed to rename the network interface name correctly.The wrong ifconfig info as follws:

docker0   Link encap:Ethernet  HWaddr 02:42:38:5b:41:a9  
          inet addr:172.17.0.1  Bcast:172.17.255.255  Mask:255.255.0.0
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

eth0      Link encap:Ethernet  HWaddr 00:00:00:00:00:05  
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

eth0:avahi Link encap:Ethernet  HWaddr 00:00:00:00:00:05  
          inet addr:169.254.1.26  Bcast:169.254.255.255  Mask:255.255.0.0
          UP BROADCAST MULTICAST  MTU:1500  Metric:1

l4tbr0    Link encap:Ethernet  HWaddr 3a:04:6a:62:ec:3e  
          inet addr:192.168.55.1  Bcast:192.168.55.255  Mask:255.255.255.0
          inet6 addr: fe80::b4cf:82ff:fe16:a0ce/64 Scope:Link
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:5 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:430 (430.0 B)

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:41141 errors:0 dropped:0 overruns:0 frame:0
          TX packets:41141 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1 
          RX bytes:2951366 (2.9 MB)  TX bytes:2951366 (2.9 MB)

rename10  Link encap:Ethernet  HWaddr 00:04:4b:a4:c3:be  
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:10900 errors:0 dropped:0 overruns:0 frame:0
          TX packets:934 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:655262 (655.2 KB)  TX bytes:156204 (156.2 KB)

usb0      Link encap:Ethernet  HWaddr 6a:9e:11:3e:7d:f9  
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

usb1      Link encap:Ethernet  HWaddr 3a:04:6a:62:ec:3e  
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

wlan0     Link encap:Ethernet  HWaddr 00:04:4b:a4:c3:bc  
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

In the syslog we found the following message of udev:

May  9 06:44:35 tegra-ubuntu systemd-udevd[272]: error changing net interface name 'eth0' to 'eth1': Device or resource busy
May  9 06:44:35 tegra-ubuntu systemd-udevd[272]: could not rename interface '6' from 'eth0' to 'eth1': Device or resource busy
May  9 06:46:07 tegra-ubuntu systemd-udevd[271]: could not rename interface '10' from 'eth1' to 'eth0': File exists
May  9 06:46:07 tegra-ubuntu NetworkManager[456]: <info>  [1557384367.4947] device (rename10): state change: unmanaged -> unavailable (reason 'managed') [10 20 2]
May  9 06:46:07 tegra-ubuntu systemd[928]: sys-subsystem-net-devices-eth0.device: Dev sys-subsystem-net-devices-eth0.device appeared twice with different sysfs paths /sys/devices/70090000.xusb/usb2/2-1/2-1:1.0/net/eth1 and /sys/devices/70090000.xusb/usb2/2-1/2-1:1.0/net/rename10
May  9 06:46:07 tegra-ubuntu ofonod[427]: plugins/udev.c:udev_event() subsystem net move
May  9 06:46:07 tegra-ubuntu collect[680]: [+] Download failed: http://192.168.13.6/onvif-http/snapshot?Profile_1 admin admin123
May  9 06:46:07 tegra-ubuntu systemd[2269]: sys-subsystem-net-devices-eth0.device: Dev sys-subsystem-net-devices-eth0.device appeared twice with different sysfs paths /sys/devices/70090000.xusb/usb2/2-1/2-1:1.0/net/eth1 and /sys/devices/70090000.xusb/usb2/2-1/2-1:1.0/net/rename10
May  9 06:46:07 tegra-ubuntu ofonod[427]: plugins/udev.c:udev_event() subsystem net finished
May  9 06:46:07 tegra-ubuntu systemd[1]: sys-subsystem-net-devices-eth0.device: Dev sys-subsystem-net-devices-eth0.device appeared twice with different sysfs paths /sys/devices/70090000.xusb/usb2/2-1/2-1:1.0/net/eth1 and /sys/devices/70090000.xusb/usb2/2-1/2-1:1.0/net/rename10
May  9 06:46:07 tegra-ubuntu collect[680]: [+] Download failed: http://192.168.13.6/onvif-http/snapshot?Profile_1 admin admin123
May  9 06:46:07 tegra-ubuntu kernel: [  105.183896] IPv6: ADDRCONF(NETDEV_UP): rename10: link is not ready

We want to know the reason why did it happen ?
We want to set the two netcard as fixname. Is there anyway to solve it or workaroud it ?
Thanks a lot !

Moved from TX2 forum to TX1 forum.

I can’t answer, but having device or resource busy probably means it is still loading during boot. This could mean that either the source interface being changed is busy, or it could mean the destination interface name is in the way.

As an experiment you might want to change the order of the renames. If the two lines are in the same file, see what happens if you reverse the order the lines appear. I’m not sure about the case of the two lines being in different files…you should probably provide what files these are in (such as file name and directory of “/etc/udev/” these are at, along with content).