bsigs
Posts: 4
Joined: Thu Feb 18, 2016 5:16 pm

r8153 USB NIC adapter eth interface names not consistent

Fri Apr 21, 2017 1:38 pm

I'm using a Vantec CB-U320GNA Dual Ethernet adapter to USB with my Raspberry Pi 3. This device contains a Realtek RTL8153 chip.

The adapter works for the most part. Every now and then (I have to reboot many times for this to happen) the ethernet port names reverse on the physical interfaces. An even more rare event is where only eth1 comes up on the 2nd interface (incorrectly). I've seen naming issues mentioned many times on the internet.

I was wondering if there is a way to ensure that the interface names are always correct?

I looked around on the web and tried various suggestion with no success. Then I started looking at the dmesg file.

It appears that when the interfaces are reversed, a "reset high-speed USB device number 7 using dwc_otg" for the first interface comes in after the second interface reset message when the reverse occurs. When rare event only one (eth1) interface comes up this reset message for the first interface is missing - only the reset message for the second interface which is then assigned name "eth1".

Is there anyway to control this "dwc_otg" reset message or am I looking in the wrong place?

I've attached dmesg output to this message: Normal, rare reversed, and the ultra rare only one interface to show the ordering of the reset message and when the eth number is assigned.

uname -a for my system = Linux rapsberrypi 4.4.50-v7+ #970 SMP Mon Feb 20 19:18:29 GMT 2017 armv7l GNU/Linux

Any suggestions appreciated.

dmesg output normal:
[ 2.608758] usb 1-1.4: new high-speed USB device number 4 using dwc_otg
[ 2.711304] usb 1-1.4: New USB device found, idVendor=2109, idProduct=2812
[ 2.711314] usb 1-1.4: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[ 2.711321] usb 1-1.4: Product: USB2.0 Hub
[ 2.711328] usb 1-1.4: Manufacturer: VIA Labs, Inc.
[ 2.712405] hub 1-1.4:1.0: USB hub found
[ 3.878722] usb 1-1.4.1: new high-speed USB device number 7 using dwc_otg
[ 3.990160] usb 1-1.4.1: New USB device found, idVendor=0bda, idProduct=8153
[ 3.990186] usb 1-1.4.1: New USB device strings: Mfr=1, Product=2, SerialNumber=6
[ 3.990204] usb 1-1.4.1: Product: USB 10/100/1000 LAN
[ 3.990216] usb 1-1.4.1: Manufacturer: Realtek
[ 3.990229] usb 1-1.4.1: SerialNumber: 000002000000
[ 4.086563] usbcore: registered new interface driver r8152
[ 4.090685] usb 1-1.4.2: new high-speed USB device number 8 using dwc_otg
[ 4.094600] usbcore: registered new interface driver cdc_ether
[ 4.199893] usb 1-1.4.2: New USB device found, idVendor=0bda, idProduct=8153
[ 4.199910] usb 1-1.4.2: New USB device strings: Mfr=1, Product=2, SerialNumber=6
[ 4.199916] usb 1-1.4.2: Product: USB 10/100/1000 LAN
[ 4.199929] usb 1-1.4.2: Manufacturer: Realtek
[ 4.199941] usb 1-1.4.2: SerialNumber: 000002000000
[ 4.288712] usb 1-1.4.1: reset high-speed USB device number 7 using dwc_otg
[ 4.433084] r8152 1-1.4.1:1.0 eth1: v1.08.2
[ 4.488679] usb 1-1.4.2: reset high-speed USB device number 8 using dwc_otg
[ 4.633538] r8152 1-1.4.2:1.0 eth2: v1.08.2


dmesg output eth1 and eth2 reversed:
[ 2.618765] usb 1-1.4: new high-speed USB device number 4 using dwc_otg
[ 2.720653] usb 1-1.4: New USB device found, idVendor=2109, idProduct=2812
[ 2.720663] usb 1-1.4: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[ 2.720671] usb 1-1.4: Product: USB2.0 Hub
[ 2.720678] usb 1-1.4: Manufacturer: VIA Labs, Inc.
[ 2.721768] hub 1-1.4:1.0: USB hub found
[ 3.888748] usb 1-1.4.1: new high-speed USB device number 7 using dwc_otg
[ 3.999764] usb 1-1.4.1: New USB device found, idVendor=0bda, idProduct=8153
[ 3.999788] usb 1-1.4.1: New USB device strings: Mfr=1, Product=2, SerialNumber=6
[ 3.999801] usb 1-1.4.1: Product: USB 10/100/1000 LAN
[ 3.999813] usb 1-1.4.1: Manufacturer: Realtek
[ 3.999826] usb 1-1.4.1: SerialNumber: 000002000000
[ 4.076550] usbcore: registered new interface driver r8152
[ 4.081876] usbcore: registered new interface driver cdc_ether
[ 4.088767] usb 1-1.4.2: new high-speed USB device number 8 using dwc_otg
[ 4.210117] usb 1-1.4.2: New USB device found, idVendor=0bda, idProduct=8153
[ 4.210142] usb 1-1.4.2: New USB device strings: Mfr=1, Product=2, SerialNumber=6
[ 4.210155] usb 1-1.4.2: Product: USB 10/100/1000 LAN
[ 4.210168] usb 1-1.4.2: Manufacturer: Realtek
[ 4.210180] usb 1-1.4.2: SerialNumber: 000002000000
[ 4.298723] usb 1-1.4.2: reset high-speed USB device number 8 using dwc_otg
[ 4.444754] r8152 1-1.4.2:1.0 eth1: v1.08.2
[ 4.498718] usb 1-1.4.1: reset high-speed USB device number 7 using dwc_otg
[ 4.641416] r8152 1-1.4.1:1.0 eth2: v1.08.2


dmesg output only eth1 comes up on the 2nd (wrong) interface:
[ 2.627791] usb 1-1.4: new high-speed USB device number 4 using dwc_otg
[ 2.734918] usb 1-1.4: New USB device found, idVendor=2109, idProduct=2812
[ 2.734941] usb 1-1.4: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[ 2.734954] usb 1-1.4: Product: USB2.0 Hub
[ 2.734967] usb 1-1.4: Manufacturer: VIA Labs, Inc.
[ 2.736066] hub 1-1.4:1.0: USB hub found
[ 2.736835] hub 1-1.4:1.0: 4 ports detected
[ 2.740080] systemd-udevd[133]: starting version 215
[ 3.216665] gpiomem-bcm2835 3f200000.gpiomem: Initialised: Registers at 0x3f200000
[ 3.241015] bcm2708_i2c 3f804000.i2c: BSC1 Controller at 0x3f804000 (irq 83) (baudrate 100000)
[ 3.256976] bcm2835-wdt 3f100000.watchdog: Broadcom BCM2835 watchdog timer
[ 3.404845] EXT4-fs (mmcblk0p2): re-mounted. Opts: (null)
[ 3.569246] rtc-ds1307 1-0068: rtc core: registered ds3231 as rtc0
[ 4.124391] systemd-journald[128]: Received request to flush runtime journal from PID 1
[ 4.127808] usb 1-1.4.1: new high-speed USB device number 7 using dwc_otg
[ 4.153532] ip_tables: (C) 2000-2006 Netfilter Core Team
[ 4.238620] usb 1-1.4.1: New USB device found, idVendor=0bda, idProduct=8153
[ 4.238633] usb 1-1.4.1: New USB device strings: Mfr=1, Product=2, SerialNumber=6
[ 4.238640] usb 1-1.4.1: Product: USB 10/100/1000 LAN
[ 4.238646] usb 1-1.4.1: Manufacturer: Realtek
[ 4.238652] usb 1-1.4.1: SerialNumber: 000002000000
[ 4.274803] usbcore: registered new interface driver r8152
[ 4.277124] usbcore: registered new interface driver cdc_ether
[ 4.327796] usb 1-1.4.2: new high-speed USB device number 8 using dwc_otg
[ 4.438328] usb 1-1.4.2: New USB device found, idVendor=0bda, idProduct=8153
[ 4.438342] usb 1-1.4.2: New USB device strings: Mfr=1, Product=2, SerialNumber=6
[ 4.438349] usb 1-1.4.2: Product: USB 10/100/1000 LAN
[ 4.438355] usb 1-1.4.2: Manufacturer: Realtek
[ 4.438361] usb 1-1.4.2: SerialNumber: 000002000000
[ 4.527741] usb 1-1.4.2: reset high-speed USB device number 8 using dwc_otg
[ 4.672517] r8152 1-1.4.2:1.0 eth1: v1.08.2

User avatar
allfox
Posts: 452
Joined: Sat Jun 22, 2013 1:36 pm
Location: Guang Dong, China

Re: r8153 USB NIC adapter eth interface names not consistent

Fri Apr 21, 2017 3:01 pm

To make sure a specific network interface has a constant name, we could create a /etc/udev/rules.d/z99-my_rules.rules with:

Code: Select all

ATTR{address}=="12:34:56:78:90:ab", NAME="wan"
This would give the name "wan" to the device who has a MAC address 12:34:56:78:90:ab.

ip link would tell you the MAC address.


And sometimes, USB device get reset when they are under-powered. Not sure if this is the root issue.

Lastly, as you are using a VIA Labs hub, you might need to upgrade the firmware. I'm not sure on this one either, I read the info from http://plugable.com/drivers/hubfirmware/

bsigs
Posts: 4
Joined: Thu Feb 18, 2016 5:16 pm

Re: r8153 USB NIC adapter eth interface names not consistent

Mon Apr 24, 2017 11:08 pm

Thank you allfox for the suggestions. I assume the usb hub is there in the NIC adapter to hub both Ethernet NICs together.

I'll keep working with it. My first attempt to hard assign MAC addresses ended up with interesting results. I'm running VLANs on the interfaces. The base interface worked fine, however, the VLAN subinterfaces didn't like the MAC address assignment in the rule and they were renamed to a non-named interface and non-working.

I was thinking if I can change the port reset behavior in the dmesg I might could fix the problem without locking down the specific MAC address. I did install the latest driver for the Realtek NIC and that didn't change anything.

I'll keep working on this. I know I'm deep into this minor issue.

User avatar
allfox
Posts: 452
Joined: Sat Jun 22, 2013 1:36 pm
Location: Guang Dong, China

Re: r8153 USB NIC adapter eth interface names not consistent

Tue Apr 25, 2017 5:28 pm

I've checked my own Realtek 8153 dongle, they get reset on startup either. ;) I'm using a different hub than yours (1a40:0101 Terminus Technology Inc. 4-Port HUB).

I don't have an environment to test those VLAN setup, so can't help there.

Have fun!

bsigs
Posts: 4
Joined: Thu Feb 18, 2016 5:16 pm

Re: r8153 USB NIC adapter eth interface names not consistent

Wed Apr 26, 2017 12:28 am

I went through my setup again and made one minor change. Now locking the MAC address to the interface name works properly even with the VLAN interfaces.

Using the MAC address fixes the issue although I would rather not do that so I don't have to tie a specific dongle to a pi. But it does work. I'll dig into the hub that's built in to the dual NIC interface now.

Thanks again for the suggestions.

Return to “Troubleshooting”