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