Bug 11341 - Systemctl fails to rename usb network interfaces
Summary: Systemctl fails to rename usb network interfaces
Status: RESOLVED FIXED
Alias: None
Product: IoT Reference OS Kit
Classification: Yocto Project Subprojects
Component: intel-iot-refkit-connectivity (show other bugs)
Version: 2.3
Hardware: MinnowBoard Max Multiple
: Medium normal
Target Milestone: 2.4 M1
Assignee: Dmitry Rozhkov
QA Contact:
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2017-04-12 05:40 UTC by Ismo Puustinen
Modified: 2017-06-16 13:33 UTC (History)
2 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: No (bug/feature does not impact docs)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ismo Puustinen 2017-04-12 05:40:16 UTC
When I plug in a USB network interface, systemd fails to rename the device according to https://www.freedesktop.org/wiki/Software/systemd/PredictableNetworkInterfaceNames/ . The interface name stays eth0, even though systemd creates a .device unit for the modified name:

sys-subsystem-net-devices-enp0s20u1u4.device loaded active plugged   DUB-E100 Fast Ethernet Adapter(rev.C1) [ASIX AX88772]               

This makes it difficult to do the mapping between systemd network devices and actual interfaces. The reason for this behavior could be a race condition where someone (connman?) enables the interface before renaming of the interface can be done.

journalctl:

Apr 06 12:00:10 intel-corei7-64 kernel: usb 1-1.4: new high-speed USB device number 9 using xhci_hcd
Apr 06 12:00:10 intel-corei7-64 connmand[423]: eth0 {create} index 7 type 1 <ETHER>
Apr 06 12:00:10 intel-corei7-64 connmand[423]: eth0 {update} flags 4098 <DOWN>
Apr 06 12:00:10 intel-corei7-64 connmand[423]: eth0 {newlink} index 7 address C8:D3:A3:03:41:D9 mtu 1500
Apr 06 12:00:10 intel-corei7-64 connmand[423]: eth0 {newlink} index 7 operstate 2 <DOWN>
Apr 06 12:00:10 intel-corei7-64 kernel: asix 1-1.4:1.0 eth0: register 'asix' at usb-0000:00:14.0-1.4, ASIX AX88772 USB 2.0 Ethernet, c8:d3:a3:03:41:d9
Apr 06 12:00:10 intel-corei7-64 kernel: IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
Apr 06 12:00:10 intel-corei7-64 connmand[423]: Adding interface eth0 [ ethernet ]
Apr 06 12:00:10 intel-corei7-64 connmand[423]: eth0 {update} flags 36931 <UP,RUNNING>
Apr 06 12:00:10 intel-corei7-64 connmand[423]: eth0 {newlink} index 7 address C8:D3:A3:03:41:D9 mtu 1500
Apr 06 12:00:10 intel-corei7-64 connmand[423]: eth0 {newlink} index 7 operstate 0 <UNKNOWN>
Apr 06 12:00:10 intel-corei7-64 connmand[423]: eth0 {update} flags 36867 <UP>
Apr 06 12:00:10 intel-corei7-64 connmand[423]: eth0 {newlink} index 7 address C8:D3:A3:03:41:D9 mtu 1500
Apr 06 12:00:10 intel-corei7-64 connmand[423]: eth0 {newlink} index 7 operstate 2 <DOWN>
Apr 06 12:00:10 intel-corei7-64 systemd-udevd[656]: Error changing net interface name 'eth0' to 'enp0s20u1u4': Device or resource busy
Apr 06 12:00:10 intel-corei7-64 systemd-udevd[656]: could not rename interface '7' from 'eth0' to 'enp0s20u1u4': Device or resource busy

ifconfig eth0:

eth0      Link encap:Ethernet  HWaddr C8:D3:A3:03:41:D9  
          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)
Comment 1 Dmitry Rozhkov 2017-04-20 13:53:17 UTC
I've managed to make it work with blacklisting eth* interfaces in connman (by adding "NetworkInterfaceBlacklist=vmnet,vboxnet,virbr,ifb,docker,veth,eth,wlan" to /etc/connman/main.conf) and this patch

https://lists.01.org/pipermail/connman/2017-April/021786.html
Comment 2 Dmitry Rozhkov 2017-04-21 08:37:09 UTC
Submitted a patch to OE-core:
https://patchwork.openembedded.org/patch/139328/
Comment 3 Dmitry Rozhkov 2017-04-25 08:54:32 UTC
Submitted v2 of the patch (without blacklisting by default):
https://patchwork.openembedded.org/patch/139417/
Comment 4 Dmitry Rozhkov 2017-06-16 13:33:17 UTC
The fix got released as part of connman 1.34 which is in OE-Core now.