A few days ago, I reviewed a USB 3.0 to 2.5 Gbps Ethernet adapter based on Realtek RTL8156B chip in Ubuntu 20.04, and let’s say the reliability and performance were underwhelming. I got some recommendations like changing cables, the MTU size, etc…
Playing around with cables did no help, but one comment mentioned the cdc_ncm driver could be the issue, followed by another saying that updating to Linux kernel 5.14 should install the correct r8152 driver… So I just did that:
1 |
sudo apt install linux-oem-20.04d |
This upgraded Linux 5.13 (shipped with Ubuntu 20.04 + HWE) to Linux 5.14, but still no luck as the system kept using the cdc_ncm driver with a half-duplex link:
1 2 3 4 5 6 7 8 9 10 11 12 13 |
jaufranc@cnx-laptop-4:~$ inxi -n Network: Device-1: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet driver: r8169 IF: enp2s0f1 state: down mac: 98:28:a6:0f:06:07 Device-2: Qualcomm Atheros QCA9377 802.11ac Wireless Network Adapter driver: ath10k_pci IF: wlp3s0 state: up mac: 70:c9:4e:b7:84:77 Device-3: Realtek USB 10/100/1G/2.5G LAN type: USB driver: cdc_ncm IF: enx1cbfced40321 state: up speed: 2500 Mbps duplex: half mac: 1c:bf:ce:d4:03:21 jaufranc@cnx-laptop-4:~$ uname -a Linux cnx-laptop-4 5.14.0-1022-oem #24-Ubuntu SMP Mon Jan 31 16:00:31 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux |
But then I thought I may have to use udev rules to prevent loading the cdc_ncm driver, and there’s indeed 50-usb-realtek-net.rules in r8152 driver to do just that. So I copied the file in /etc/udev/rules.d/ folder. Since I did not want to reboot, I unloaded the modules I did not need, and restart udev to try it out:
1 2 3 |
sudo rmmod cdc_mbim sudo rmmod cdc_ncm service udev restart |
Let’s see…
1 2 3 4 5 6 7 8 9 10 11 |
sudo inxi -n Network: Device-1: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet driver: r8169 IF: enp2s0f1 state: down mac: 98:28:a6:0f:06:07 Device-2: Qualcomm Atheros QCA9377 802.11ac Wireless Network Adapter driver: ath10k_pci IF: wlp3s0 state: up mac: 70:c9:4e:b7:84:77 Device-3: Realtek USB 10/100/1G/2.5G LAN type: USB driver: r8152 IF: enx1cbfced40321 state: up speed: 2500 Mbps duplex: full mac: 1c:bf:ce:d4:03:21 |
Great! It’s now using r8152 driver and we’ve got a full-duplex connection.
Let’s go through all our tests again to compare the results.
iperf2
upload
1 2 3 4 5 6 7 8 |
iperf -t 60 -c 192.168.31.12 ------------------------------------------------------------ Client connecting to 192.168.31.12, TCP port 5001 TCP window size: 1.40 MByte (default) ------------------------------------------------------------ [ 3] local 192.168.31.166 port 41266 connected with 192.168.31.12 port 5001 [ ID] Interval Transfer Bandwidth [ 3] 0.0-60.0 sec 16.4 GBytes 2.35 Gbits/sec |
download:
1 2 3 4 5 6 7 8 |
iperf -t 60 -c 192.168.31.166 ------------------------------------------------------------ Client connecting to 192.168.31.166, TCP port 5001 TCP window size: 901 KByte (default) ------------------------------------------------------------ [ 3] local 192.168.31.12 port 37188 connected with 192.168.31.166 port 5001 [ ID] Interval Transfer Bandwidth [ 3] 0.0-60.0 sec 10.8 GBytes 1.55 Gbits/sec |
There’s an improvement to the download speed (was 600 Mbps with cdc_ncm driver), but still not quite close to 2.3 Gbps.
Let’s try full-duplex for fun:
1 2 3 4 5 6 7 |
Client connecting to 192.168.31.166, TCP port 5001 TCP window size: 799 KByte (default) ------------------------------------------------------------ [ 4] local 192.168.31.12 port 5001 connected with 192.168.31.166 port 41290 [ 6] local 192.168.31.12 port 37194 connected with 192.168.31.166 port 5001 [ 6] 0.0-60.1 sec 8.06 GBytes 1.15 Gbits/sec [ 4] 0.0-60.4 sec 16.3 GBytes 2.32 Gbits/sec |
That’s actually not too bad.
iperf3
upload:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
iperf3 -t 60 -c 192.168.31.12 -i 5 Connecting to host 192.168.31.12, port 5201 [ 5] local 192.168.31.166 port 32848 connected to 192.168.31.12 port 5201 [ ID] Interval Transfer Bitrate Retr Cwnd [ 5] 0.00-5.00 sec 1.37 GBytes 2.36 Gbits/sec 0 847 KBytes [ 5] 5.00-10.00 sec 1.37 GBytes 2.35 Gbits/sec 0 889 KBytes [ 5] 10.00-15.00 sec 1.37 GBytes 2.35 Gbits/sec 0 1.14 MBytes [ 5] 15.00-20.00 sec 1.37 GBytes 2.35 Gbits/sec 0 1.14 MBytes [ 5] 20.00-25.00 sec 1.37 GBytes 2.35 Gbits/sec 0 1.14 MBytes [ 5] 25.00-30.00 sec 1.37 GBytes 2.35 Gbits/sec 0 1.14 MBytes [ 5] 30.00-35.00 sec 1.37 GBytes 2.35 Gbits/sec 0 1.73 MBytes [ 5] 35.00-40.00 sec 1.37 GBytes 2.35 Gbits/sec 0 1.73 MBytes [ 5] 40.00-45.00 sec 1.37 GBytes 2.35 Gbits/sec 0 3.92 MBytes [ 5] 45.00-50.00 sec 1.37 GBytes 2.35 Gbits/sec 0 3.92 MBytes [ 5] 50.00-55.00 sec 1.37 GBytes 2.35 Gbits/sec 0 3.92 MBytes [ 5] 55.00-60.00 sec 1.37 GBytes 2.35 Gbits/sec 0 3.92 MBytes - - - - - - - - - - - - - - - - - - - - - - - - - [ ID] Interval Transfer Bitrate Retr [ 5] 0.00-60.00 sec 16.4 GBytes 2.35 Gbits/sec 0 sender [ 5] 0.00-60.05 sec 16.4 GBytes 2.35 Gbits/sec receiver iperf Done. |
download:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
iperf3 -t 60 -c 192.168.31.166 -i 5 Connecting to host 192.168.31.166, port 5201 [ 5] local 192.168.31.12 port 53112 connected to 192.168.31.166 port 5201 [ ID] Interval Transfer Bitrate Retr Cwnd [ 5] 0.00-5.00 sec 802 MBytes 1.35 Gbits/sec 641 222 KBytes [ 5] 5.00-10.00 sec 856 MBytes 1.44 Gbits/sec 618 83.4 KBytes [ 5] 10.00-15.00 sec 852 MBytes 1.43 Gbits/sec 583 87.7 KBytes [ 5] 15.00-20.00 sec 843 MBytes 1.41 Gbits/sec 592 168 KBytes [ 5] 20.00-25.00 sec 831 MBytes 1.39 Gbits/sec 642 91.9 KBytes [ 5] 25.00-30.00 sec 810 MBytes 1.36 Gbits/sec 666 97.6 KBytes [ 5] 30.00-35.00 sec 831 MBytes 1.39 Gbits/sec 590 123 KBytes [ 5] 35.00-40.00 sec 827 MBytes 1.39 Gbits/sec 652 298 KBytes [ 5] 40.00-45.00 sec 843 MBytes 1.41 Gbits/sec 605 93.3 KBytes [ 5] 45.00-50.00 sec 844 MBytes 1.42 Gbits/sec 635 96.2 KBytes [ 5] 50.00-55.00 sec 862 MBytes 1.45 Gbits/sec 565 84.8 KBytes [ 5] 55.00-60.00 sec 858 MBytes 1.44 Gbits/sec 583 82.0 KBytes - - - - - - - - - - - - - - - - - - - - - - - - - [ ID] Interval Transfer Bitrate Retr [ 5] 0.00-60.00 sec 9.82 GBytes 1.41 Gbits/sec 7372 sender [ 5] 0.00-60.00 sec 9.82 GBytes 1.41 Gbits/sec receiver iperf Done. |
About the same as iperf2.
iperf3 did not have support for full-duplex for many years, but version 3.7 reintroduced the feature. So let’s give it a go:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
iperf3 -t 60 -c 192.168.31.12 --bidir -i 5 Connecting to host 192.168.31.12, port 5201 [ 5] local 192.168.31.166 port 32858 connected to 192.168.31.12 port 5201 [ 7] local 192.168.31.166 port 32860 connected to 192.168.31.12 port 5201 [ ID][Role] Interval Transfer Bitrate Retr Cwnd [ 5][TX-C] 0.00-5.00 sec 1.36 GBytes 2.34 Gbits/sec 0 1.41 MBytes [ 7][RX-C] 0.00-5.00 sec 643 MBytes 1.08 Gbits/sec [ 5][TX-C] 5.00-10.00 sec 1.36 GBytes 2.34 Gbits/sec 0 1.48 MBytes [ 7][RX-C] 5.00-10.00 sec 673 MBytes 1.13 Gbits/sec [ 5][TX-C] 10.00-15.00 sec 1.36 GBytes 2.34 Gbits/sec 0 1.78 MBytes [ 7][RX-C] 10.00-15.00 sec 690 MBytes 1.16 Gbits/sec [ 5][TX-C] 15.00-20.00 sec 1.36 GBytes 2.34 Gbits/sec 0 1.78 MBytes [ 7][RX-C] 15.00-20.00 sec 695 MBytes 1.17 Gbits/sec [ 5][TX-C] 20.00-25.00 sec 1.36 GBytes 2.34 Gbits/sec 0 1.78 MBytes [ 7][RX-C] 20.00-25.00 sec 703 MBytes 1.18 Gbits/sec [ 5][TX-C] 25.00-30.00 sec 1.36 GBytes 2.34 Gbits/sec 0 1.78 MBytes [ 7][RX-C] 25.00-30.00 sec 704 MBytes 1.18 Gbits/sec [ 5][TX-C] 30.00-35.00 sec 1.36 GBytes 2.34 Gbits/sec 0 1.78 MBytes [ 7][RX-C] 30.00-35.00 sec 711 MBytes 1.19 Gbits/sec [ 5][TX-C] 35.00-40.00 sec 1.36 GBytes 2.34 Gbits/sec 0 1.78 MBytes [ 7][RX-C] 35.00-40.00 sec 697 MBytes 1.17 Gbits/sec [ 5][TX-C] 40.00-45.00 sec 28.8 MBytes 48.2 Mbits/sec 4 1.41 KBytes [ 7][RX-C] 40.00-45.00 sec 15.0 MBytes 25.2 Mbits/sec [ 5][TX-C] 45.00-50.00 sec 0.00 Bytes 0.00 bits/sec 1 1.41 KBytes [ 7][RX-C] 45.00-50.00 sec 0.00 Bytes 0.00 bits/sec [ 5][TX-C] 50.00-55.00 sec 0.00 Bytes 0.00 bits/sec 1 1.41 KBytes [ 7][RX-C] 50.00-55.00 sec 0.00 Bytes 0.00 bits/sec iperf3: error - control socket has closed unexpectedly |
Oops! What happened? There are some error messages in the kernel log as well.
1 2 3 4 5 6 7 8 9 |
[18424.279351] r8152 2-1:1.0 enx1cbfced40321: Tx status -71 [18424.287497] r8152 2-1:1.0 enx1cbfced40321: Tx status -71 [18424.295735] r8152 2-1:1.0 enx1cbfced40321: Tx status -71 [18424.303858] r8152 2-1:1.0 enx1cbfced40321: Tx status -71 [18430.885965] net_ratelimit: 107 callbacks suppressed [18430.885975] r8152 2-1:1.0 enx1cbfced40321: Tx status -71 [18431.251643] r8152 2-1:1.0 enx1cbfced40321: Tx status -71 [18431.909792] r8152 2-1:1.0 enx1cbfced40321: Tx status -71 [18437.797786] r8152 2-1:1.0 enx1cbfced40321: Tx status -71 |
I’m not the only one to have this problem, and that’s an open issue in r8156 driver’s Github repo. Here’s the answer from the developer for reference:
I suspect a problem on the ethernet adapter side, as there are many reports of it working with the DS918+. (Eg. design of power line, overheat, etc.)
https://github.com/bb-qq/r8152/wiki/CompatibilityCould you try another vendor? Also using a USB Hub with an external power supply might improve the situation.
At this point, the Ethernet did not work at all, and I had to unplug and reinsert the USB dongle. The second time “worked”.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
iperf3 -t 60 -c 192.168.31.12 --bidir -i 5 Connecting to host 192.168.31.12, port 5201 [ 5] local 192.168.31.166 port 32872 connected to 192.168.31.12 port 5201 [ 7] local 192.168.31.166 port 32874 connected to 192.168.31.12 port 5201 [ ID][Role] Interval Transfer Bitrate Retr Cwnd [ 5][TX-C] 0.00-5.00 sec 1.36 GBytes 2.34 Gbits/sec 0 1.59 MBytes [ 7][RX-C] 0.00-5.00 sec 515 MBytes 864 Mbits/sec [ 5][TX-C] 5.00-10.00 sec 1.36 GBytes 2.34 Gbits/sec 0 1.75 MBytes [ 7][RX-C] 5.00-10.00 sec 489 MBytes 820 Mbits/sec [ 5][TX-C] 10.00-15.00 sec 1.36 GBytes 2.34 Gbits/sec 0 1.75 MBytes [ 7][RX-C] 10.00-15.00 sec 530 MBytes 889 Mbits/sec [ 5][TX-C] 15.00-20.00 sec 1.36 GBytes 2.34 Gbits/sec 0 1.75 MBytes [ 7][RX-C] 15.00-20.00 sec 564 MBytes 947 Mbits/sec [ 5][TX-C] 20.00-25.00 sec 1.36 GBytes 2.34 Gbits/sec 0 1.75 MBytes [ 7][RX-C] 20.00-25.00 sec 560 MBytes 940 Mbits/sec [ 5][TX-C] 25.00-30.00 sec 1.36 GBytes 2.34 Gbits/sec 0 2.63 MBytes [ 7][RX-C] 25.00-30.00 sec 578 MBytes 970 Mbits/sec [ 5][TX-C] 30.00-35.00 sec 1.36 GBytes 2.34 Gbits/sec 0 2.63 MBytes [ 7][RX-C] 30.00-35.00 sec 561 MBytes 942 Mbits/sec [ 5][TX-C] 35.00-40.00 sec 1.36 GBytes 2.34 Gbits/sec 0 2.63 MBytes [ 7][RX-C] 35.00-40.00 sec 572 MBytes 960 Mbits/sec [ 5][TX-C] 40.00-45.00 sec 1.36 GBytes 2.34 Gbits/sec 0 2.63 MBytes [ 7][RX-C] 40.00-45.00 sec 570 MBytes 956 Mbits/sec [ 5][TX-C] 45.00-50.00 sec 1.36 GBytes 2.34 Gbits/sec 0 2.63 MBytes [ 7][RX-C] 45.00-50.00 sec 572 MBytes 960 Mbits/sec [ 5][TX-C] 50.00-55.00 sec 1.36 GBytes 2.34 Gbits/sec 0 2.63 MBytes [ 7][RX-C] 50.00-55.00 sec 570 MBytes 957 Mbits/sec [ 5][TX-C] 55.00-60.00 sec 1.36 GBytes 2.34 Gbits/sec 0 2.63 MBytes [ 7][RX-C] 55.00-60.00 sec 571 MBytes 958 Mbits/sec - - - - - - - - - - - - - - - - - - - - - - - - - [ ID][Role] Interval Transfer Bitrate Retr [ 5][TX-C] 0.00-60.00 sec 16.3 GBytes 2.34 Gbits/sec 0 sender [ 5][TX-C] 0.00-60.05 sec 16.3 GBytes 2.34 Gbits/sec receiver [ 7][RX-C] 0.00-60.00 sec 6.50 GBytes 931 Mbits/sec 58 sender [ 7][RX-C] 0.00-60.05 sec 6.50 GBytes 929 Mbits/sec receiver iperf Done. |
There are still retransmissions on the Rx side which could help explain the lower speed.
SAMBA
From my laptop with the RTL8156B dongle, and SATA SSD to UP Xtreme i11 mini PC with a 2.5GbE port, and a MINIX USB-C dock with a 480GB SSD.
Around 930 Mbps with r8152 driver against 750 Mbps with cdc_ncm driver.
Now from the mini PC to the laptop (aka download)…
It’s slower as expected at 837 Mbps, but better than the under 500 Mbps I got with the cdc_ncm driver.
scp
laptop to mini PC:
1 2 3 4 5 6 7 |
time scp Libero_SoC_v2021.2_lin.bin devkit@192.168.31.12:/home/devkit/NEO_Storage devkit@192.168.31.12's password: Libero_SoC_v2021.2_lin.bin 100% 10GB 115.0MB/s 01:32 real 1m34.981s user 0m55.750s sys 0m42.668s |
mini PC to laptop:
1 2 3 4 5 6 7 |
time scp devkit@192.168.31.12:/home/devkit/NEO_Storage/Libero_SoC_v2021.2_lin.bin . devkit@192.168.31.12's password: Libero_SoC_v2021.2_lin.bin 100% 10GB 111.7MB/s 01:35 real 1m36.896s user 0m56.926s sys 0m55.330s |
It’s almost the same speed between download and upload with scp which is odd. The bottleneck here looks to be my SATA SSD:
1 2 3 4 5 6 7 8 |
iozone -e -I -a -s 1000M -r 16384k -i 0 -i 1 Iozone: Performance Test of File I/O Version $Revision: 3.489 $ Compiled for 64 bit mode. Build: linux-AMD64 random random bkwd record stride kB reclen write rewrite read reread read write read rewrite read fwrite frewrite fread freread 1024000 16384 141794 139550 149591 145020 |
Read is limited by around 145 MB/s, while write is around 140 MB/s.
The SSD used in MINIX NEO Storage Plus USB-C dock is quite faster with, last time I tested, 379MB/s for sequential reads, and 240+MB/s for sequential writes.
So let’s see the speed we can get throwing away the data to /dev/null
download to laptop:
1 2 3 4 5 6 7 |
time scp -c aes128-ctr devkit@192.168.31.12:/home/devkit/NEO_Storage/Libero_SoC_v2021.2_lin.bin /dev/null devkit@192.168.31.12's password: Libero_SoC_v2021.2_lin.bin 100% 10GB 133.0MB/s 01:20 real 1m21.880s user 0m18.931s sys 0m33.838s |
upload from laptop:
1 2 3 4 5 6 7 |
time scp -c aes128-ctr Libero_SoC_v2021.2_lin.bin devkit@192.168.31.12:/dev/null devkit@192.168.31.12's password: Libero_SoC_v2021.2_lin.bin 100% 10GB 239.9MB/s 00:44 real 0m46.094s user 0m17.174s sys 0m36.793s |
So that’s more like it for the upload at least. I still have a problem with the download speed, but the performance was still greatly improved with the r8152 driver.

Testing with NanoPi R4S
While it’s much better, it’s not optimal. I have a NanoPi R4S router with two USB 3.0 ports, so I first tried it using the latest OpenWrt (FriendlyWrt) 21.02 image with Linux 5.15:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
root@FriendlyWrt:~# iperf3 -t 60 -c 192.168.2.207 --bidir -i 5 Connecting to host 192.168.2.207, port 5201 [ 5] local 192.168.2.161 port 21836 connected to 192.168.2.207 port 5201 [ 7] local 192.168.2.161 port 21838 connected to 192.168.2.207 port 5201 [ ID][Role] Interval Transfer Bitrate Retr Cwnd [ 5][TX-C] 0.00-5.00 sec 348 MBytes 583 Mbits/sec 4 413 KBytes [ 7][RX-C] 0.00-5.00 sec 220 MBytes 369 Mbits/sec [ 5][TX-C] 5.00-10.00 sec 480 MBytes 805 Mbits/sec 5 684 KBytes [ 7][RX-C] 5.00-10.00 sec 218 MBytes 366 Mbits/sec [ 5][TX-C] 10.00-15.00 sec 574 MBytes 963 Mbits/sec 47 557 KBytes [ 7][RX-C] 10.00-15.00 sec 183 MBytes 307 Mbits/sec [ 5][TX-C] 15.00-20.00 sec 481 MBytes 807 Mbits/sec 3 699 KBytes [ 7][RX-C] 15.00-20.00 sec 179 MBytes 301 Mbits/sec [ 5][TX-C] 20.00-25.00 sec 464 MBytes 779 Mbits/sec 18 701 KBytes [ 7][RX-C] 20.00-25.00 sec 214 MBytes 359 Mbits/sec [ 5][TX-C] 25.00-30.00 sec 549 MBytes 920 Mbits/sec 26 580 KBytes [ 7][RX-C] 25.00-30.00 sec 178 MBytes 298 Mbits/sec [ 5][TX-C] 30.00-35.00 sec 472 MBytes 792 Mbits/sec 3 526 KBytes [ 7][RX-C] 30.00-35.00 sec 207 MBytes 347 Mbits/sec [ 5][TX-C] 35.00-40.00 sec 465 MBytes 781 Mbits/sec 15 410 KBytes [ 7][RX-C] 35.00-40.00 sec 195 MBytes 326 Mbits/sec [ 5][TX-C] 40.00-45.00 sec 385 MBytes 645 Mbits/sec 0 376 KBytes [ 7][RX-C] 40.00-45.00 sec 217 MBytes 364 Mbits/sec [ 5][TX-C] 45.00-50.00 sec 497 MBytes 833 Mbits/sec 9 478 KBytes [ 7][RX-C] 45.00-50.00 sec 201 MBytes 338 Mbits/sec [ 5][TX-C] 50.00-55.00 sec 434 MBytes 728 Mbits/sec 0 543 KBytes [ 7][RX-C] 50.00-55.00 sec 208 MBytes 349 Mbits/sec [ 5][TX-C] 55.00-60.00 sec 451 MBytes 756 Mbits/sec 6 823 KBytes [ 7][RX-C] 55.00-60.00 sec 220 MBytes 370 Mbits/sec - - - - - - - - - - - - - - - - - - - - - - - - - [ ID][Role] Interval Transfer Bitrate Retr [ 5][TX-C] 0.00-60.00 sec 5.47 GBytes 783 Mbits/sec 136 sender [ 5][TX-C] 0.00-60.01 sec 5.47 GBytes 783 Mbits/sec receiver [ 7][RX-C] 0.00-60.00 sec 2.39 GBytes 342 Mbits/sec 94 sender [ 7][RX-C] 0.00-60.01 sec 2.38 GBytes 341 Mbits/sec receiver iperf Done. |
It’s really ugly with lots of retransmissions on both sides.
1 2 3 4 5 6 7 8 9 10 |
[ 276.268986] usb 8-1: New USB device found, idVendor=0bda, idProduct=8156, bcdDevice=31.00 [ 276.269798] usb 8-1: New USB device strings: Mfr=1, Product=2, SerialNumber=6 [ 276.270471] usb 8-1: Product: USB 10/100/1G/2.5G LAN [ 276.272112] usb 8-1: Manufacturer: Realtek [ 276.272519] usb 8-1: SerialNumber: 0013000000 [ 276.359625] cdc_ncm 8-1:2.0: MAC-Address: 1c:bf:ce:d4:03:21 [ 276.360178] cdc_ncm 8-1:2.0: setting rx_max = 16384 [ 276.360758] cdc_ncm 8-1:2.0: setting tx_max = 16384 [ 276.362948] cdc_ncm 8-1:2.0 eth2: register 'cdc_ncm' at usb-xhci-hcd.1.auto-1, CDC NCM, 1c:bf:ce:d4:03:21 [ 459.919597] IPv6: ADDRCONF(NETDEV_CHANGE): eth2: link becomes ready |
Looking at the kernel log, our RTL8156B USB dongle is using that CDC NCM driver again, just like in Ubuntu… There’s an r8152 driver too, but whatever module I remove in /etc/modules.d either the CDC NCM is loaded or the eth2 interface does not show up at all. So I’ve switched to the Ubuntu 20.04-based FriendlyCore OS, also featuring Linux 5.15, that will be closer to the setup on my laptop.
As one might have expected, the RTL8156B adapter uses the CDC NCM driver by default in Ubuntu:
1 2 3 4 5 6 7 8 9 10 11 |
[ 682.701529] usb 8-1: new SuperSpeed USB device number 3 using xhci-hcd [ 682.727125] usb 8-1: New USB device found, idVendor=0bda, idProduct=8156, bcdDevice=31.00 [ 682.727163] usb 8-1: New USB device strings: Mfr=1, Product=2, SerialNumber=6 [ 682.727179] usb 8-1: Product: USB 10/100/1G/2.5G LAN [ 682.727191] usb 8-1: Manufacturer: Realtek [ 682.727203] usb 8-1: SerialNumber: 0013000000 [ 682.806350] cdc_ncm 8-1:2.0: MAC-Address: 1c:bf:ce:d4:03:21 [ 682.806387] cdc_ncm 8-1:2.0: setting rx_max = 16384 [ 682.806561] cdc_ncm 8-1:2.0: setting tx_max = 16384 [ 682.807963] cdc_ncm 8-1:2.0 eth1: register 'cdc_ncm' at usb-xhci-hcd.1.auto-1, CDC NCM, 1c:bf:ce:d4:03:21 [ 682.834550] cdc_ncm 8-1:2.0 enx1cbfced40321: renamed from eth1 |
eth1 is not showing up with ifconfig, so I just went ahead and change udev rules to use the r8152 driver…
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
[ 882.081445] usb 7-1: new high-speed USB device number 3 using xhci-hcd [ 882.209358] usb 7-1: Device not responding to setup address. [ 882.417542] usb 7-1: Device not responding to setup address. [ 882.625432] usb 7-1: device not accepting address 3, error -71 [ 886.597570] usb 8-1: new SuperSpeed USB device number 4 using xhci-hcd [ 886.619484] usb 8-1: New USB device found, idVendor=0bda, idProduct=8156, bcdDevice=31.00 [ 886.619534] usb 8-1: New USB device strings: Mfr=1, Product=2, SerialNumber=6 [ 886.619556] usb 8-1: Product: USB 10/100/1G/2.5G LAN [ 886.619574] usb 8-1: Manufacturer: Realtek [ 886.619591] usb 8-1: SerialNumber: 0013000000 [ 886.911033] usb 8-1: reset SuperSpeed USB device number 4 using xhci-hcd [ 886.960598] r8152 8-1:1.0: Direct firmware load for rtl_nic/rtl8156b-2.fw failed with error -2 [ 886.960631] r8152 8-1:1.0: Falling back to sysfs fallback for: rtl_nic/rtl8156b-2.fw [ 947.165730] r8152 8-1:1.0: unable to load firmware patch rtl_nic/rtl8156b-2.fw (-110) [ 947.210940] r8152 8-1:1.0 (unnamed net_device) (uninitialized): netif_napi_add() called with weight 256 [ 947.237480] r8152 8-1:1.0 eth1: v1.12.11 [ 947.254755] usbcore: registered new interface driver cdc_ncm [ 947.257112] usbcore: registered new interface driver cdc_mbim [ 947.290865] r8152 8-1:1.0 enx1cbfced40321: renamed from eth1 |
It’s getting depressing. Let’s update the system first.
1 2 3 4 5 |
sudo apt update sudo apt install python3-pip sudo pip3 install apt-mirror-updater apt-mirror-updater -c http://ftp.tu-chemnitz.de/pub/linux/ubuntu-ports sudo apt dist-upgrade |
I followed all those steps since the FriendlyCore image relies on servers from China, which are very slow from where I have (just running apt update can take 15 minutes), so the update was possibly faster that way, although it still took a couple of hours! (See Changing Ubuntu Apt Mirror from the Command Line for details).
It did not help with the firmware issue. So instead I search for that rtl_nic/rtl8156b-2.fw file. It is in the firmware-realtek Debian package, or linux-firmware Ubuntu Impish package.
I downloaded the latter, extracted rtl8156b-2.fw and copied it to /etc/firmware/rtl_nic. It now works:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
[ 2172.098871] usb 8-1: new SuperSpeed USB device number 4 using xhci-hcd [ 2172.120681] usb 8-1: New USB device found, idVendor=0bda, idProduct=8156, bcdDevice=31.00 [ 2172.120731] usb 8-1: New USB device strings: Mfr=1, Product=2, SerialNumber=6 [ 2172.120754] usb 8-1: Product: USB 10/100/1G/2.5G LAN [ 2172.120771] usb 8-1: Manufacturer: Realtek [ 2172.120788] usb 8-1: SerialNumber: 0013000000 [ 2172.183460] cdc_ncm 8-1:2.0: MAC-Address: 1c:bf:ce:d4:03:21 [ 2172.183494] cdc_ncm 8-1:2.0: setting rx_max = 16384 [ 2172.183620] cdc_ncm 8-1:2.0: setting tx_max = 16384 [ 2172.184904] cdc_ncm 8-1:2.0 eth1: register 'cdc_ncm' at usb-xhci-hcd.1.auto-1, CDC NCM, 1c:bf:ce:d4:03:21 [ 2172.189439] cdc_ncm 8-1:2.0 eth1: unregister 'cdc_ncm' usb-xhci-hcd.1.auto-1, CDC NCM [ 2172.451015] usb 8-1: reset SuperSpeed USB device number 4 using xhci-hcd [ 2172.535166] r8152 8-1:1.0: load rtl8156b-2 v1 04/15/21 successfully [ 2172.598459] r8152 8-1:1.0 eth1: v1.12.11 |
Somehow the interface is still not up, and adding it manually to /etc/network/interfaces.d, does not work.
Back to the Ubuntu laptop with rtl8156b-2.fw firmware
So instead, I went back to my laptop, and copied the firmware file to /lib/firmware/rtl_nic directory. The result was the same as in NanoPi R4S:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
[23050.245495] usb 2-1: new SuperSpeed USB device number 3 using xhci_hcd [23050.266025] usb 2-1: New USB device found, idVendor=0bda, idProduct=8156, bcdDevice=31.00 [23050.266038] usb 2-1: New USB device strings: Mfr=1, Product=2, SerialNumber=6 [23050.266043] usb 2-1: Product: USB 10/100/1G/2.5G LAN [23050.266047] usb 2-1: Manufacturer: Realtek [23050.266050] usb 2-1: SerialNumber: 0013000000 [23050.325714] cdc_ncm 2-1:2.0: MAC-Address: 1c:bf:ce:d4:03:21 [23050.325720] cdc_ncm 2-1:2.0: setting rx_max = 16384 [23050.325762] cdc_ncm 2-1:2.0: setting tx_max = 16384 [23050.326199] cdc_ncm 2-1:2.0 eth0: register 'cdc_ncm' at usb-0000:04:00.3-1, CDC NCM, 1c:bf:ce:d4:03:21 [23050.334723] cdc_ncm 2-1:2.0 eth0: unregister 'cdc_ncm' usb-0000:04:00.3-1, CDC NCM [23050.559779] usb 2-1: reset SuperSpeed USB device number 3 using xhci_hcd [23050.617459] r8152 2-1:1.0: load rtl8156b-2 v1 04/15/21 successfully [23050.654344] r8152 2-1:1.0 eth0: v1.12.11 |
Let’s try iperf3 upload:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
iperf3 -t 30 -c 192.168.31.12 -i 5 Connecting to host 192.168.31.12, port 5201 [ 5] local 192.168.31.166 port 50222 connected to 192.168.31.12 port 5201 [ ID] Interval Transfer Bitrate Retr Cwnd [ 5] 0.00-5.00 sec 1.37 GBytes 2.36 Gbits/sec 0 609 KBytes [ 5] 5.00-10.00 sec 1.37 GBytes 2.35 Gbits/sec 0 691 KBytes [ 5] 10.00-15.00 sec 1.37 GBytes 2.35 Gbits/sec 0 1.35 MBytes [ 5] 15.00-20.00 sec 1.37 GBytes 2.35 Gbits/sec 0 1.35 MBytes [ 5] 20.00-25.00 sec 1.37 GBytes 2.35 Gbits/sec 0 1.35 MBytes [ 5] 25.00-30.00 sec 1.37 GBytes 2.35 Gbits/sec 0 1.35 MBytes - - - - - - - - - - - - - - - - - - - - - - - - - [ ID] Interval Transfer Bitrate Retr [ 5] 0.00-30.00 sec 8.22 GBytes 2.35 Gbits/sec 0 sender [ 5] 0.00-30.04 sec 8.22 GBytes 2.35 Gbits/sec receiver iperf Done. |
Same as before, so no regression. Now for the iperf3 download:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
iperf3 -t 30 -c 192.168.31.12 -i 5 -R Connecting to host 192.168.31.12, port 5201 Reverse mode, remote host 192.168.31.12 is sending [ 5] local 192.168.31.166 port 50226 connected to 192.168.31.12 port 5201 [ ID] Interval Transfer Bitrate [ 5] 0.00-5.00 sec 969 MBytes 1.63 Gbits/sec [ 5] 5.00-10.00 sec 990 MBytes 1.66 Gbits/sec [ 5] 10.00-15.00 sec 982 MBytes 1.65 Gbits/sec [ 5] 15.00-20.00 sec 984 MBytes 1.65 Gbits/sec [ 5] 20.00-25.00 sec 1012 MBytes 1.70 Gbits/sec [ 5] 25.00-30.00 sec 1007 MBytes 1.69 Gbits/sec - - - - - - - - - - - - - - - - - - - - - - - - - [ ID] Interval Transfer Bitrate Retr [ 5] 0.00-30.02 sec 5.81 GBytes 1.66 Gbits/sec 3181 sender [ 5] 0.00-30.00 sec 5.80 GBytes 1.66 Gbits/sec receiver iperf Done. |
It’s getting better, although we are not there yet, and the retransmissions are through the roof. I’m really tired now… Let me know if you have other ideas.
Realtek RTL8156BG USB 3.0 to 2.5GbE dongle to the rescue.
[Update: Realtek sent me one of their USB 3.0 to 2.5GbE adapters and it does not have the same performance issue
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
$ iperf3 -t 60 -c 192.168.31.12 --bidir -i 5 Connecting to host 192.168.31.12, port 5201 [ 5] local 192.168.31.85 port 47164 connected to 192.168.31.12 port 5201 [ 7] local 192.168.31.85 port 47168 connected to 192.168.31.12 port 5201 [ ID][Role] Interval Transfer Bitrate Retr Cwnd [ 5][TX-C] 0.00-5.00 sec 1.35 GBytes 2.31 Gbits/sec 0 1.54 MBytes [ 7][RX-C] 0.00-5.00 sec 1.25 GBytes 2.14 Gbits/sec [ 5][TX-C] 5.00-10.00 sec 1.37 GBytes 2.35 Gbits/sec 0 1.54 MBytes [ 7][RX-C] 5.00-10.00 sec 1.36 GBytes 2.34 Gbits/sec [ 5][TX-C] 10.00-15.00 sec 1.36 GBytes 2.34 Gbits/sec 0 1.54 MBytes [ 7][RX-C] 10.00-15.00 sec 1.34 GBytes 2.31 Gbits/sec [ 5][TX-C] 15.00-20.00 sec 1.36 GBytes 2.34 Gbits/sec 0 2.34 MBytes [ 7][RX-C] 15.00-20.00 sec 1.32 GBytes 2.28 Gbits/sec [ 5][TX-C] 20.00-25.00 sec 1.36 GBytes 2.34 Gbits/sec 0 2.34 MBytes [ 7][RX-C] 20.00-25.00 sec 1.36 GBytes 2.33 Gbits/sec [ 5][TX-C] 25.00-30.00 sec 1.36 GBytes 2.34 Gbits/sec 0 2.34 MBytes [ 7][RX-C] 25.00-30.00 sec 1.34 GBytes 2.30 Gbits/sec [ 5][TX-C] 30.00-35.00 sec 1.36 GBytes 2.34 Gbits/sec 0 2.34 MBytes [ 7][RX-C] 30.00-35.00 sec 1.36 GBytes 2.33 Gbits/sec [ 5][TX-C] 35.00-40.00 sec 1.36 GBytes 2.34 Gbits/sec 0 2.34 MBytes [ 7][RX-C] 35.00-40.00 sec 1.33 GBytes 2.28 Gbits/sec [ 5][TX-C] 40.00-45.00 sec 1.36 GBytes 2.34 Gbits/sec 0 2.34 MBytes [ 7][RX-C] 40.00-45.00 sec 1.35 GBytes 2.32 Gbits/sec [ 5][TX-C] 45.00-50.00 sec 1.36 GBytes 2.34 Gbits/sec 0 2.34 MBytes [ 7][RX-C] 45.00-50.00 sec 1.35 GBytes 2.32 Gbits/sec [ 5][TX-C] 50.00-55.00 sec 1.36 GBytes 2.34 Gbits/sec 0 2.34 MBytes [ 7][RX-C] 50.00-55.00 sec 1.35 GBytes 2.31 Gbits/sec [ 5][TX-C] 55.00-60.00 sec 1.36 GBytes 2.34 Gbits/sec 0 2.34 MBytes [ 7][RX-C] 55.00-60.00 sec 1.32 GBytes 2.26 Gbits/sec - - - - - - - - - - - - - - - - - - - - - - - - - [ ID][Role] Interval Transfer Bitrate Retr [ 5][TX-C] 0.00-60.00 sec 16.3 GBytes 2.34 Gbits/sec 0 sender [ 5][TX-C] 0.00-60.05 sec 16.3 GBytes 2.34 Gbits/sec receiver [ 7][RX-C] 0.00-60.00 sec 16.0 GBytes 2.29 Gbits/sec 25 sender [ 7][RX-C] 0.00-60.05 sec 16.0 GBytes 2.29 Gbits/sec receiver iperf Done. |
]

Jean-Luc started CNX Software in 2010 as a part-time endeavor, before quitting his job as a software engineering manager, and starting to write daily news, and reviews full time later in 2011.
Support CNX Software! Donate via cryptocurrencies, become a Patron on Patreon, or purchase goods on Amazon or Aliexpress