Ubuntu 20.04 - RTL8156 2.5Gbps Ethernet driver

Post Reply
madbrain
Posts: 86
Joined: Sat Aug 05, 2017 5:40 pm
languages_spoken: English, Français
ODROIDs: XU4, N2+
Has thanked: 0
Been thanked: 5 times
Contact:

Ubuntu 20.04 - RTL8156 2.5Gbps Ethernet driver

Post by madbrain »

I'm using the Ubuntu 20.04 image provided by Hardkernel . Specifically ubuntu-20.04-5.4-mate-odroid-xu4-20210926.img from https://odroid.in/ubuntu_20.04lts/XU3_XU4_MC1_HC1_HC2/ .

I got a Realtek 8156B 2.5 Gbps ethernet NIC from Amazon. It works out of the box with this image. However, in many cases, it's actually slower than the built-in RTL8153 NIC.

iperf3 test results on LAN, going to a 10Gbps Windows machine, using the built-in 1 Gbps NIC :

Code: Select all

odroid@odroid:~$ iperf3 -c higgs.local -i 10
Connecting to host higgs.local, port 5201
[  5] local 192.168.1.6 port 59514 connected to 192.168.1.26 port 5201
[ ID] Interval           Transfer     Bitrate         Retr  Cwnd
[  5]   0.00-10.00  sec  1.09 GBytes   934 Mbits/sec    0    218 KBytes
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bitrate         Retr
[  5]   0.00-10.00  sec  1.09 GBytes   934 Mbits/sec    0             sender
[  5]   0.00-10.00  sec  1.09 GBytes   934 Mbits/sec                  receiver

iperf Done.
odroid@odroid:~$ iperf3 -c higgs.local -i 10 -R
Connecting to host higgs.local, port 5201
Reverse mode, remote host higgs.local is sending
[  5] local 192.168.1.6 port 59518 connected to 192.168.1.26 port 5201
[ ID] Interval           Transfer     Bitrate
[  5]   0.00-10.00  sec  1.10 GBytes   948 Mbits/sec
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bitrate
[  5]   0.00-10.00  sec  1.10 GBytes   948 Mbits/sec                  sender
[  5]   0.00-10.00  sec  1.10 GBytes   948 Mbits/sec                  receiver

iperf Done.
This is as expected. The 1 Gbps link is saturated in both directions.

Now, using the RTL8156 NIC, with the other NIC unplugged :

Code: Select all

odroid@odroid:~$ iperf3 -c higgs.local -i 10
Connecting to host higgs.local, port 5201
[  5] local 192.168.1.10 port 48512 connected to 192.168.1.26 port 5201
[ ID] Interval           Transfer     Bitrate         Retr  Cwnd
[  5]   0.00-10.00  sec  1.82 GBytes  1.56 Gbits/sec    0    214 KBytes
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bitrate         Retr
[  5]   0.00-10.00  sec  1.82 GBytes  1.56 Gbits/sec    0             sender
[  5]   0.00-10.00  sec  1.82 GBytes  1.56 Gbits/sec                  receiver

iperf Done.
odroid@odroid:~$ iperf3 -c higgs.local -i 10 -R
Connecting to host higgs.local, port 5201
Reverse mode, remote host higgs.local is sending
[  5] local 192.168.1.10 port 48524 connected to 192.168.1.26 port 5201
[ ID] Interval           Transfer     Bitrate
[  5]   0.00-10.00  sec   826 MBytes   693 Mbits/sec
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bitrate
[  5]   0.00-10.00  sec   826 MBytes   693 Mbits/sec                  sender
[  5]   0.00-10.00  sec   826 MBytes   693 Mbits/sec                  receiver

iperf Done.
As you can see, upload works at 1.56 Gbps, but download is limited to 693 Mbps.

If I use the same NIC on my Windows machine, I max the 2.5 Gbps link in both directions using iperf3 - about 2.35 Gbps.

I think there is an issue with the Realtek driver for the RTL8156.
It looks like Realtek uses the RTL8152 driver series to support this model. I downloaded it from Realtek at
https://www.realtek.com/en/component/zo ... 0-software

I compiled it successfully.

However, I'm unable to install it, because another version of r8152 is already built into the kernel :

Code: Select all

root@odroid:/home/odroid/Downloads/r8152-2.15.0# rmmod r8152
rmmod: ERROR: Module r8152 is builtin.
So, it looks like I would need to recompile the kernel, remove the built-in driver, and then install the one I built .
Or possibly, build the kernel with this alternate version within it.
Unfortunately, the Hardkernel instructions for building the kernel under Ubuntu are quite old . They only cover up to kernel 4.14 :
https://wiki.odroid.com/odroid-xu4/soft ... ing_kernel

The kernel I'm using is :
Linux odroid 5.4.167-236 #1 SMP PREEMPT Tue Dec 21 09:46:48 EST 2021 armv7l armv7l armv7l GNU/Linux

Any idea how I can rebuild the kernel with the updated Realtek driver ?

User avatar
odroid
Site Admin
Posts: 38528
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English, Korean
ODROIDs: ODROID
Has thanked: 2211 times
Been thanked: 1295 times
Contact:

Re: Ubuntu 20.04 - RTL8156 2.5Gbps Ethernet driver

Post by odroid »

Try this wiki page to build your own kernel 5.4 on the board.
https://wiki.odroid.com/odroid-xu4/os_i ... uild_guide

BTW, can you check if your chipset is RTL8156B? or RTL8156?
viewtopic.php?f=172&t=38713

madbrain
Posts: 86
Joined: Sat Aug 05, 2017 5:40 pm
languages_spoken: English, Français
ODROIDs: XU4, N2+
Has thanked: 0
Been thanked: 5 times
Contact:

Re: Ubuntu 20.04 - RTL8156 2.5Gbps Ethernet driver

Post by madbrain »

odroid wrote:
Fri Jan 07, 2022 12:09 pm
Try this wiki page to build your own kernel 5.4 on the board.
https://wiki.odroid.com/odroid-xu4/os_i ... uild_guide
Thank you ! Any tips about how to insert the proper driver into the kernel tree ? I have never done it before.
BTW, can you check if your chipset is RTL8156B? or RTL8156?
viewtopic.php?f=172&t=38713
Thanks for this link.

Code: Select all

odroid@odroid:~$ lsusb  -v -d 0bda:8156 | grep bcdDevice
Couldn't open device, some information will be missing
  bcdDevice           31.00
I take it to mean this is an 8156b.

Actually, the retail box of the device I have says RTL8156B on it, so that makes sense.

I got two of those NICs. I'd like to use my XU4 as a wired router for my LAN. My cable Internet connection with Comcast is 1.4 Gbps down / 40 Mbps up. The LAN interface is 2.5 GBASE-T.

User avatar
odroid
Site Admin
Posts: 38528
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English, Korean
ODROIDs: ODROID
Has thanked: 2211 times
Been thanked: 1295 times
Contact:

Re: Ubuntu 20.04 - RTL8156 2.5Gbps Ethernet driver

Post by odroid »

Just follow the wiki instruction first.
Once it boots fine with your own kernel, just type make menuconfig on the command line to change "r8152" driver as a module.
After that, you can probe your modules once you rmmod r8152.
Note that the default r8152 driver is used for the XU4 on board GbE NIC.

madbrain
Posts: 86
Joined: Sat Aug 05, 2017 5:40 pm
languages_spoken: English, Français
ODROIDs: XU4, N2+
Has thanked: 0
Been thanked: 5 times
Contact:

Re: Ubuntu 20.04 - RTL8156 2.5Gbps Ethernet driver

Post by madbrain »

odroid wrote:
Fri Jan 07, 2022 2:20 pm
Just follow the wiki instruction first.
Once it boots fine with your own kernel, just type make menuconfig on the command line to change "r8152" driver as a module.
After that, you can probe your modules probably.
Thanks. Our messages crossed. I didn't know about menuconfig. So, I did a "find . | grep r8152" and deleted those files, and references to them. I was able to rebuild the kernel without it, and install the new module. Unfortunately, performance isn't any better :-(

Code: Select all

root@odroid:/home/odroid# modinfo r8152
filename:       /lib/modules/5.4.167+/kernel/drivers/net/usb/r8152.ko
version:        v2.15.0 (2021/04/15)
license:        GPL
description:    Realtek RTL8152/RTL8153 Based USB Ethernet Adapters
author:         Realtek nic sw <nic_swsd@realtek.com>
srcversion:     D5F59F35419A6ED50FEDF29
alias:          usb:v2BAFp0012d*dc*dsc*dp*ic02isc0Dip00in*
alias:          usb:v2BAFp0012d*dc*dsc*dp*ic02isc06ip00in*
alias:          usb:v2BAFp0012d*dc*dsc*dp*icFFisc*ip*in*
alias:          usb:v13B1p0041d*dc*dsc*dp*ic02isc0Dip00in*
alias:          usb:v13B1p0041d*dc*dsc*dp*ic02isc06ip00in*
alias:          usb:v13B1p0041d*dc*dsc*dp*icFFisc*ip*in*
alias:          usb:v0955p09FFd*dc*dsc*dp*ic02isc0Dip00in*
alias:          usb:v0955p09FFd*dc*dsc*dp*ic02isc06ip00in*
alias:          usb:v0955p09FFd*dc*dsc*dp*icFFisc*ip*in*
alias:          usb:v2357p0601d*dc*dsc*dp*ic02isc0Dip00in*
alias:          usb:v2357p0601d*dc*dsc*dp*ic02isc06ip00in*
alias:          usb:v2357p0601d*dc*dsc*dp*icFFisc*ip*in*
alias:          usb:v17EFpA387d*dc*dsc*dp*ic02isc0Dip00in*
alias:          usb:v17EFpA387d*dc*dsc*dp*ic02isc06ip00in*
alias:          usb:v17EFpA387d*dc*dsc*dp*icFFisc*ip*in*
alias:          usb:v17EFpA359d*dc*dsc*dp*ic02isc0Dip00in*
alias:          usb:v17EFpA359d*dc*dsc*dp*ic02isc06ip00in*
alias:          usb:v17EFpA359d*dc*dsc*dp*icFFisc*ip*in*
alias:          usb:v17EFp8153d*dc*dsc*dp*ic02isc0Dip00in*
alias:          usb:v17EFp8153d*dc*dsc*dp*ic02isc06ip00in*
alias:          usb:v17EFp8153d*dc*dsc*dp*icFFisc*ip*in*
alias:          usb:v17EFp721Ed*dc*dsc*dp*ic02isc0Dip00in*
alias:          usb:v17EFp721Ed*dc*dsc*dp*ic02isc06ip00in*
alias:          usb:v17EFp721Ed*dc*dsc*dp*icFFisc*ip*in*
alias:          usb:v17EFp7214d*dc*dsc*dp*ic02isc0Dip00in*
alias:          usb:v17EFp7214d*dc*dsc*dp*ic02isc06ip00in*
alias:          usb:v17EFp7214d*dc*dsc*dp*icFFisc*ip*in*
alias:          usb:v17EFp720Cd*dc*dsc*dp*ic02isc0Dip00in*
alias:          usb:v17EFp720Cd*dc*dsc*dp*ic02isc06ip00in*
alias:          usb:v17EFp720Cd*dc*dsc*dp*icFFisc*ip*in*
alias:          usb:v17EFp720Bd*dc*dsc*dp*ic02isc0Dip00in*
alias:          usb:v17EFp720Bd*dc*dsc*dp*ic02isc06ip00in*
alias:          usb:v17EFp720Bd*dc*dsc*dp*icFFisc*ip*in*
alias:          usb:v17EFp720Ad*dc*dsc*dp*ic02isc0Dip00in*
alias:          usb:v17EFp720Ad*dc*dsc*dp*ic02isc06ip00in*
alias:          usb:v17EFp720Ad*dc*dsc*dp*icFFisc*ip*in*
alias:          usb:v17EFp7205d*dc*dsc*dp*ic02isc0Dip00in*
alias:          usb:v17EFp7205d*dc*dsc*dp*ic02isc06ip00in*
alias:          usb:v17EFp7205d*dc*dsc*dp*icFFisc*ip*in*
alias:          usb:v17EFp3098d*dc*dsc*dp*ic02isc0Dip00in*
alias:          usb:v17EFp3098d*dc*dsc*dp*ic02isc06ip00in*
alias:          usb:v17EFp3098d*dc*dsc*dp*icFFisc*ip*in*
alias:          usb:v17EFp3082d*dc*dsc*dp*ic02isc0Dip00in*
alias:          usb:v17EFp3082d*dc*dsc*dp*ic02isc06ip00in*
alias:          usb:v17EFp3082d*dc*dsc*dp*icFFisc*ip*in*
alias:          usb:v17EFp3069d*dc*dsc*dp*ic02isc0Dip00in*
alias:          usb:v17EFp3069d*dc*dsc*dp*ic02isc06ip00in*
alias:          usb:v17EFp3069d*dc*dsc*dp*icFFisc*ip*in*
alias:          usb:v17EFp3062d*dc*dsc*dp*ic02isc0Dip00in*
alias:          usb:v17EFp3062d*dc*dsc*dp*ic02isc06ip00in*
alias:          usb:v17EFp3062d*dc*dsc*dp*icFFisc*ip*in*
alias:          usb:v17EFp3057d*dc*dsc*dp*ic02isc0Dip00in*
alias:          usb:v17EFp3057d*dc*dsc*dp*ic02isc06ip00in*
alias:          usb:v17EFp3057d*dc*dsc*dp*icFFisc*ip*in*
alias:          usb:v17EFp3054d*dc*dsc*dp*ic02isc0Dip00in*
alias:          usb:v17EFp3054d*dc*dsc*dp*ic02isc06ip00in*
alias:          usb:v17EFp3054d*dc*dsc*dp*icFFisc*ip*in*
alias:          usb:v17EFp3052d*dc*dsc*dp*ic02isc0Dip00in*
alias:          usb:v17EFp3052d*dc*dsc*dp*ic02isc06ip00in*
alias:          usb:v17EFp3052d*dc*dsc*dp*icFFisc*ip*in*
alias:          usb:v17EFp304Fd*dc*dsc*dp*ic02isc0Dip00in*
alias:          usb:v17EFp304Fd*dc*dsc*dp*ic02isc06ip00in*
alias:          usb:v17EFp304Fd*dc*dsc*dp*icFFisc*ip*in*
alias:          usb:v04E8pA101d*dc*dsc*dp*ic02isc0Dip00in*
alias:          usb:v04E8pA101d*dc*dsc*dp*ic02isc06ip00in*
alias:          usb:v04E8pA101d*dc*dsc*dp*icFFisc*ip*in*
alias:          usb:v045Ep07C6d*dc*dsc*dp*ic02isc0Dip00in*
alias:          usb:v045Ep07C6d*dc*dsc*dp*ic02isc06ip00in*
alias:          usb:v045Ep07C6d*dc*dsc*dp*icFFisc*ip*in*
alias:          usb:v045Ep07ABd*dc*dsc*dp*ic02isc0Dip00in*
alias:          usb:v045Ep07ABd*dc*dsc*dp*ic02isc06ip00in*
alias:          usb:v045Ep07ABd*dc*dsc*dp*icFFisc*ip*in*
alias:          usb:v0BDAp8156d*dc*dsc*dp*ic02isc0Dip00in*
alias:          usb:v0BDAp8156d*dc*dsc*dp*ic02isc06ip00in*
alias:          usb:v0BDAp8156d*dc*dsc*dp*icFFisc*ip*in*
alias:          usb:v0BDAp8155d*dc*dsc*dp*ic02isc0Dip00in*
alias:          usb:v0BDAp8155d*dc*dsc*dp*ic02isc06ip00in*
alias:          usb:v0BDAp8155d*dc*dsc*dp*icFFisc*ip*in*
alias:          usb:v0BDAp8153d*dc*dsc*dp*ic02isc0Dip00in*
alias:          usb:v0BDAp8153d*dc*dsc*dp*ic02isc06ip00in*
alias:          usb:v0BDAp8153d*dc*dsc*dp*icFFisc*ip*in*
alias:          usb:v0BDAp8152d*dc*dsc*dp*ic02isc0Dip00in*
alias:          usb:v0BDAp8152d*dc*dsc*dp*ic02isc06ip00in*
alias:          usb:v0BDAp8152d*dc*dsc*dp*icFFisc*ip*in*
alias:          usb:v0BDAp8053d*dc*dsc*dp*ic02isc0Dip00in*
alias:          usb:v0BDAp8053d*dc*dsc*dp*ic02isc06ip00in*
alias:          usb:v0BDAp8053d*dc*dsc*dp*icFFisc*ip*in*
alias:          usb:v0BDAp8050d*dc*dsc*dp*ic02isc0Dip00in*
alias:          usb:v0BDAp8050d*dc*dsc*dp*ic02isc06ip00in*
alias:          usb:v0BDAp8050d*dc*dsc*dp*icFFisc*ip*in*
depends:
name:           r8152
vermagic:       5.4.167+ SMP preempt mod_unload ARMv7 p2v8
root@odroid:/home/odroid# iperf3 -c higgs.local -i 10
Connecting to host higgs.local, port 5201
[  5] local 192.168.1.10 port 35904 connected to 192.168.1.26 port 5201
[ ID] Interval           Transfer     Bitrate         Retr  Cwnd
[  5]   0.00-10.00  sec  1.88 GBytes  1.62 Gbits/sec    0    215 KBytes
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bitrate         Retr
[  5]   0.00-10.00  sec  1.88 GBytes  1.62 Gbits/sec    0             sender
[  5]   0.00-10.00  sec  1.88 GBytes  1.62 Gbits/sec                  receiver

iperf Done.
root@odroid:/home/odroid# iperf3 -c higgs.local -i 10 -R
Connecting to host higgs.local, port 5201
Reverse mode, remote host higgs.local is sending
[  5] local 192.168.1.10 port 35908 connected to 192.168.1.26 port 5201
[ ID] Interval           Transfer     Bitrate
[  5]   0.00-10.00  sec   809 MBytes   678 Mbits/sec
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bitrate
[  5]   0.00-10.00  sec   809 MBytes   678 Mbits/sec                  sender
[  5]   0.00-10.00  sec   809 MBytes   678 Mbits/sec                  receiver

iperf Done.
root@odroid:/home/odroid#

As you can see, the receiver side performance is only 678 Mbps, less than Gigabit.
And of course, the receive side is the one I have 1.4 Gbps of bandwidth from my ISP. Anyway, for a router appliucation, I need both sides to handle 1.4 Gbps, since I have two NICs, and one NIC will need to handle receiving 1.4 Gbps from WAN, and the other NIC sending 1.4 Gbps to LAN.

I don't get why it's slower than even 1 Gbps with this driver.

User avatar
odroid
Site Admin
Posts: 38528
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English, Korean
ODROIDs: ODROID
Has thanked: 2211 times
Been thanked: 1295 times
Contact:

Re: Ubuntu 20.04 - RTL8156 2.5Gbps Ethernet driver

Post by odroid »

I think the network device IRQ handlers might be running on a little core.

What is the NIC device node name under /sys/class/net/ ?
Can you show us "cat /bin/odroid-tweaks" and "cat /proc/interrupts" outputs?

madbrain
Posts: 86
Joined: Sat Aug 05, 2017 5:40 pm
languages_spoken: English, Français
ODROIDs: XU4, N2+
Has thanked: 0
Been thanked: 5 times
Contact:

Re: Ubuntu 20.04 - RTL8156 2.5Gbps Ethernet driver

Post by madbrain »

odroid wrote:
Fri Jan 07, 2022 2:32 pm
I think the network device IRQ handlers might be running on a little core.

What is the NIC device node name under /sys/class/net/ ?
Can you show us "cat /bin/odroid-tweaks" and "cat /proc/interrupts" outputs?
Here you go.

Code: Select all

odroid@odroid:~/Desktop$ ls -al /sys/class/net
total 0
drwxr-xr-x  2 root root 0 Dec 31  1999 .
drwxr-xr-x 51 root root 0 Dec 31  1999 ..
lrwxrwxrwx  1 root root 0 Jan  6 21:37 eth0 -> ../../devices/platform/soc/soc:usb3-0/12000000.dwc3/xhci-hcd.8.auto/usb4/4-1/4-1.2/4-1.2:2.0/net/eth0
lrwxrwxrwx  1 root root 0 Jan  6 21:37 eth1 -> ../../devices/platform/soc/soc:usb3-1/12400000.dwc3/xhci-hcd.9.auto/usb6/6-1/6-1:1.0/net/eth1
lrwxrwxrwx  1 root root 0 Dec 31  1999 lo -> ../../devices/virtual/net/lo

Code: Select all

odroid@odroid:~/Desktop$ cat /bin/odroid-tweaks
#!/bin/bash
USB3_IRQ=`cat /proc/interrupts | grep "xhci-hcd:usb3" | awk -F : '{print $1}'`
USB5_IRQ=`cat /proc/interrupts | grep "xhci-hcd:usb5" | awk -F : '{print $1}'`
echo 5 > /proc/irq/${USB3_IRQ}/smp_affinity_list
echo 6 > /proc/irq/${USB5_IRQ}/smp_affinity_list

if [ -f /sys/class/net/eth0/queues/rx-0/rps_cpus ]; then
	echo f > /sys/class/net/eth0/queues/rx-0/rps_cpus
fi

# fix chromium if possible
if [ -e "/usr/lib/chromium-browser/libEGL.so" -a -e "/usr/lib/arm-linux-gnueabihf/mali-egl/libmali.so" ]; then
	mv /usr/lib/chromium-browser/libEGL.so /usr/lib/chromium-browser/libEGL.so.org
	ln -s /usr/lib/arm-linux-gnueabihf/mali-egl/libmali.so /usr/lib/chromium-browser/libEGL.so
fi
if [ -e "/usr/lib/chromium-browser/libGLESv2.so" -a -e "/usr/lib/arm-linux-gnueabihf/mali-egl/libmali.so" ]; then
	mv /usr/lib/chromium-browser/libGLESv2.so /usr/lib/chromium-browser/libGLESv2.so.org
	ln -s /usr/lib/arm-linux-gnueabihf/mali-egl/libmali.so /usr/lib/chromium-browser/libGLESv2.so
fi

# attempt to fix mali every reboot in case mesa overwrites it
rm -fr /etc/ld.so.conf.d/arm-linux-gnueabihf_EGL.conf
rm -fr /usr/lib/arm-linux-gnueabihf/mali-egl/ld.so.conf

rm -fr /usr/lib/arm-linux-gnueabihf/libEGL*
rm -fr /usr/lib/arm-linux-gnueabihf/libGLESv2*
rm -fr /usr/lib/arm-linux-gnueabihf/libGLESv1*

# Links
ln -s /usr/lib/arm-linux-gnueabihf/mali-egl/libmali.so /usr/lib/arm-linux-gnueabihf/libGLESv2.so.2.0.0
ln -s /usr/lib/arm-linux-gnueabihf/mali-egl/libmali.so /usr/lib/arm-linux-gnueabihf/libEGL.so.1.0.0
ln -s /usr/lib/arm-linux-gnueabihf/mali-egl/libmali.so /usr/lib/arm-linux-gnueabihf/libEGL.so
ln -s /usr/lib/arm-linux-gnueabihf/mali-egl/libmali.so /usr/lib/arm-linux-gnueabihf/libGLESv2.so
ln -s /usr/lib/arm-linux-gnueabihf/mali-egl/libmali.so /usr/lib/arm-linux-gnueabihf/libGLESv1_CM.so
ln -s /usr/lib/arm-linux-gnueabihf/mali-egl/libmali.so /usr/lib/arm-linux-gnueabihf/libGLESv2.so.2
ln -s /usr/lib/arm-linux-gnueabihf/mali-egl/libmali.so /usr/lib/arm-linux-gnueabihf/libEGL.so.1

Code: Select all

odroid@odroid:~/Desktop$ cat /proc/interrupts
           CPU0       CPU1       CPU2       CPU3       CPU4       CPU5       CPU6       CPU7       
 49:          0          0          0          0          0          0          0          0  COMBINER 187 Edge      mct_comp_irq
 50:       9206          0          0          0          0          0          0          0     GICv2 152 Level     mct_tick0
 51:          0       9982          0          0          0          0          0          0     GICv2 153 Level     mct_tick1
 52:          0          0       9111          0          0          0          0          0     GICv2 154 Level     mct_tick2
 53:          0          0          0       7297          0          0          0          0     GICv2 155 Level     mct_tick3
 54:          0          0          0          0      18445          0          0          0     GICv2 160 Level     mct_tick4
 55:          0          0          0          0          0      20210          0          0     GICv2 161 Level     mct_tick5
 56:          0          0          0          0          0          0      20600          0     GICv2 162 Level     mct_tick6
 57:          0          0          0          0          0          0          0      16775     GICv2 163 Level     mct_tick7
 58:          0          0          0          0          0          0          0          0     GICv2  29 Level     arch_timer
 59:          0          0          0          0          0          0          0          0     GICv2  30 Level     arch_timer
 63:       1282          0          0          0          0          0          0          0     GICv2  85 Level     12c20000.serial
 64:          0          0          0          0          0          0          0          0     GICv2  89 Level     12c70000.i2c
 65:          0          0          0          0          0          0          0          0     GICv2  90 Level     12c80000.i2c
 71:          0          0          0          0          0          0          0          0       PMU  43 Edge      s3c2410-rtc alarm
 72:          0          0          0          0          0          0          0          0       PMU  44 Edge      s3c2410-rtc tick
 73:          0          0          0          0          0          0          0          0     GICv2 144 Level     10830000.sss
 74:       4166          0          0          0          0          0          0          0     GICv2 123 Level     drm_g2d
 78:          0          0          0          0          0          0          0          0     GICv2  74 Level     101d0000.watchdog
 79:          0          0          0          0          0          0          0          0     GICv2 138 Level     12d10000.adc
 80:       2844          0          0          0          0          0          0          0     GICv2  92 Level     12ca0000.i2c
 81:          0          0          0          0          0          0          0          0     GICv2  93 Level     12cb0000.i2c
 82:          1          0          0          0          0          0          0          0     GICv2 103 Level     ehci_hcd:usb1, ohci_hcd:usb2
 83:          2          0          0          0          0          0          0          0     GICv2 128 Level     11000000.codec
 84:          0          0          0          0          0          0          0          0     GICv2 107 Level     dw-mci
 85:      76864          0          0          0          0          0          0          0     GICv2 109 Level     dw-mci
 88:          0          0          0          0          0          0          0          0     GICv2  77 Level     13400000.pinctrl
106:          0          0          0          0          0          0          0          0     GICv2 110 Level     13410000.pinctrl
107:          0          0          0          0          0          0          0          0     GICv2  78 Level     14000000.pinctrl
108:          0          0          0          0          0          0          0          0     GICv2  82 Level     14010000.pinctrl
109:          0          0          0          0          0          0          0          0     GICv2  79 Level     3860000.pinctrl
110:         12          0          0          0          0          0          0          0     GICv2 142 Level     3880000.adma
111:         15          0          0          0          0          0          0          0     GICv2  66 Level     121a0000.pdma
112:          0          0          0          0          0          0          0          0     GICv2  67 Level     121b0000.pdma
113:          0          0          0          0          0          0          0          0     GICv2  65 Level     10800000.mdma
114:          0          0          0          0          0          0          0          0     GICv2 101 Level     spi-s3c64xx
116:          0          0          0          0          0          0          0          0     GICv2 146 Level     101b0000.cec
117:          0          0          0          0          0          0          0          0     GICv2 126 Level     drm_mixer
118:          0          0          0          0          0          0          0          0     GICv2 116 Level     11c00000.rotator
119:          0          0          0          0          0          0          0          0     GICv2 117 Level     13e00000.video-scaler
120:          0          0          0          0          0          0          0          0     GICv2 118 Level     13e10000.video-scaler
121:          0          0          0          0          0          0          0          0     GICv2 251 Level     11800000.gpu
122:          0          0          0          0          0          0          0          0     GICv2 106 Level     11800000.gpu
123:          2          0          0          0          0          0          0          0     GICv2 149 Level     11800000.gpu
127:          0          0          0          0          0          0          0          0     GICv2 121 Level     11f50000.jpeg
128:          0          0          0          0          0          0          0          0     GICv2 200 Level     11f60000.jpeg
129:        174          0          0          0          0          0          0          0     GICv2  97 Edge      10060000.tmu
130:        133          0          0          0          0          0          0          0     GICv2 215 Edge      10064000.tmu
131:        379          0          0          0          0          0          0          0     GICv2 216 Edge      10068000.tmu
132:        160          0          0          0          0          0          0          0     GICv2 217 Edge      1006c000.tmu
133:          0          0          0          0          0          0          0          0     GICv2 247 Edge      100a0000.tmu
134:          0          0          0          0          0          0          0          0  COMBINER 197 Edge      10a60000.sysmmu
135:          0          0          0          0          0          0          0          0  COMBINER 178 Edge      10a70000.sysmmu
136:          0          0          0          0          0          0          0          0  COMBINER  60 Edge      14650000.sysmmu
137:          0          0          0          0          0          0          0          0  COMBINER  16 Edge      13e80000.sysmmu
138:          0          0          0          0          0          0          0          0  COMBINER  18 Edge      13e90000.sysmmu
139:          0          0          0          0          0          0          0          0  COMBINER 180 Edge      12880000.sysmmu
140:          0          0          0          0          0          0          0          0     GICv2 218 Level     12890000.sysmmu
141:          0          0          0          0          0          0          0          0     GICv2 220 Level     128a0000.sysmmu
142:          0          0          0          0          0          0          0          0  COMBINER 218 Edge      128c0000.sysmmu
143:          0          0          0          0          0          0          0          0  COMBINER 182 Edge      128d0000.sysmmu
144:          0          0          0          0          0          0          0          0  COMBINER 158 Edge      128e0000.sysmmu
145:          0          0          0          0          0          0          0          0  COMBINER  32 Edge      11d40000.sysmmu
146:          0          0          0          0          0          0          0          0  COMBINER  34 Edge      11f10000.sysmmu
147:          0          0          0          0          0          0          0          0     GICv2 201 Level     11f20000.sysmmu
148:          0          0          0          0          0          0          0          0  COMBINER  50 Edge      11200000.sysmmu
149:          0          0          0          0          0          0          0          0  COMBINER  69 Edge      11210000.sysmmu
150:          0          0          0          0          0          0          0          0  COMBINER  26 Edge      14640000.sysmmu
151:          0          0          0          0          0          0          0          0  COMBINER  24 Edge      14680000.sysmmu
152:          0          0          0          0          0          0          0          0     GICv2 192 Level     arm-pmu
153:          0          0          0          0          0          0          0          0     GICv2 193 Level     arm-pmu
154:          0          0          0          0          0          0          0          0     GICv2 194 Level     arm-pmu
155:          0          0          0          0          0          0          0          0     GICv2 195 Level     arm-pmu
156:          0          0          0          0          0          0          0          0  COMBINER  10 Edge      arm-pmu
157:          0          0          0          0          0          0          0          0  COMBINER  56 Edge      arm-pmu
158:          0          0          0          0          0          0          0          0  COMBINER 134 Edge      arm-pmu
159:          0          0          0          0          0          0          0          0  COMBINER 154 Edge      arm-pmu
160:          1          0          0          0          0          0          0          0  exynos4210_wkup_irq_chip   7 Edge      hdmi
161:          1          0          0          0          0          0          0          0  exynos4210_wkup_irq_chip   4 Edge      s2mps11
162:          0          0          0          0          0          0          0          0   s2mps11  10 Edge      rtc-alarm0
163:        357          0          0          0          0       6020          0          0     GICv2 104 Level     xhci-hcd:usb3
164:        524          0          0          0          0          0       3779          0     GICv2 105 Level     xhci-hcd:usb5
165:          0          0          0          0          0          0          0          0  exynos4210_wkup_irq_chip   3 Edge      power key
IPI0:          0          0          0          0          0          0          0          0  CPU wakeup interrupts
IPI1:          0          0          0          0          0          0          0          0  Timer broadcast interrupts
IPI2:       6578       6917       6372       8159      17585      16490      34820      16232  Rescheduling interrupts
IPI3:        796       2250       1305       1067       1605       1985       1727       2039  Function call interrupts
IPI4:          0          0          0          0          0          0          0          0  CPU stop interrupts
IPI5:          1          0          0          0          0          0          0          0  IRQ work interrupts
IPI6:          0          0          0          0          0          0          0          0  completion interrupts
Err:          0
odroid@odroid:~/Desktop$ 


madbrain
Posts: 86
Joined: Sat Aug 05, 2017 5:40 pm
languages_spoken: English, Français
ODROIDs: XU4, N2+
Has thanked: 0
Been thanked: 5 times
Contact:

Re: Ubuntu 20.04 - RTL8156 2.5Gbps Ethernet driver

Post by madbrain »

Hmm ...

Interestingly, an Internet download test (Ookla) shows the card is working at > 1 Gbps on the download side.
I don't see how the LAN iperf3 download speed could be any slower.

Code: Select all

droid@odroid:~/Downloads$ speedtest

   Speedtest by Ookla

     Server: Sonic.net, Inc. - San Jose, CA (id = 17846)
        ISP: Comcast Cable
    Latency:    10.04 ms   (1.49 ms jitter)
   Download:  1304.07 Mbps (data used: 2.2 GB )                               
     Upload:    41.03 Mbps (data used: 18.5 MB )  
Last edited by madbrain on Fri Jan 07, 2022 3:25 pm, edited 1 time in total.

User avatar
odroid
Site Admin
Posts: 38528
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English, Korean
ODROIDs: ODROID
Has thanked: 2211 times
Been thanked: 1295 times
Contact:

Re: Ubuntu 20.04 - RTL8156 2.5Gbps Ethernet driver

Post by odroid »

Replace eth0 with eth1 in /bin/odroid-tweaks something like this and reboot.
It might help download performance of the ETH1.

Code: Select all

if [ -f /sys/class/net/eth1/queues/rx-0/rps_cpus ]; then
	echo f > /sys/class/net/eth1/queues/rx-0/rps_cpus
fi

madbrain
Posts: 86
Joined: Sat Aug 05, 2017 5:40 pm
languages_spoken: English, Français
ODROIDs: XU4, N2+
Has thanked: 0
Been thanked: 5 times
Contact:

Re: Ubuntu 20.04 - RTL8156 2.5Gbps Ethernet driver

Post by madbrain »

odroid wrote:
Fri Jan 07, 2022 2:53 pm
Replace eth0 with eth1 in /bin/odroid-tweaks something like this and reboot.
It might help download performance of the ETH1.

Code: Select all

if [ -f /sys/class/net/eth1/queues/rx-0/rps_cpus ]; then
	echo f > /sys/class/net/eth1/queues/rx-0/rps_cpus
fi
OK. I tried it with the following :

Code: Select all

if [ -f /sys/class/net/eth1/queues/rx-0/rps_cpus ]; then
        echo f > /sys/class/net/eth1/queues/rx-0/rps_cpus
fi
Unfortunately, the system hung in the middle of my iperf3 receive tests.

I was getting stability problems with this NIC even before this change, also. Sometimes when starting iperf3 under VNC, the box would inexplicably become inaccessible. It behaved differently when running iperf3 under SSH. I have rebooted my XU4 quite a few times tonight as a result. The NIC isn't running hot, FYI. The two TP-Link TL-SX105 10 gig switches are a bit hot. But none of the other systems are experiencing any network problems. And I battled tested the switches at 10 Gbps speeds with x64 hardware (Aquantia NICs) on all ports, so I know they can handle the throughput.

Edit: here are the results when running iperf3 under SSH . It didn't crash the XU4 this time.

Code: Select all

odroid@odroid:~$ iperf3 -c higgs.local -i 10
Connecting to host higgs.local, port 5201
[  5] local 192.168.1.10 port 54158 connected to 192.168.1.26 port 5201
[ ID] Interval           Transfer     Bitrate         Retr  Cwnd
[  5]   0.00-10.00  sec  1.88 GBytes  1.61 Gbits/sec    0    218 KBytes
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bitrate         Retr
[  5]   0.00-10.00  sec  1.88 GBytes  1.61 Gbits/sec    0             sender
[  5]   0.00-10.00  sec  1.88 GBytes  1.61 Gbits/sec                  receiver

iperf Done.
odroid@odroid:~$ iperf3 -c higgs.local -i 10 -R
Connecting to host higgs.local, port 5201
Reverse mode, remote host higgs.local is sending
[  5] local 192.168.1.10 port 54162 connected to 192.168.1.26 port 5201
[ ID] Interval           Transfer     Bitrate
[  5]   0.00-10.00  sec   893 MBytes   749 Mbits/sec
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bitrate
[  5]   0.00-10.00  sec   894 MBytes   750 Mbits/sec                  sender
[  5]   0.00-10.00  sec   893 MBytes   749 Mbits/sec                  receiver

iperf Done.
There is a slight improvement on the receive side, but still short of 1 Gbps, and well short of 2.5 Gbps (should show about 2.35 Gbps).
Actually, I don't think it's statistically significant. I get slightly different speeds each time with iperf3 on the receive side in this test on the XU4.

User avatar
odroid
Site Admin
Posts: 38528
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English, Korean
ODROIDs: ODROID
Has thanked: 2211 times
Been thanked: 1295 times
Contact:

Re: Ubuntu 20.04 - RTL8156 2.5Gbps Ethernet driver

Post by odroid »

Thank you for the situation description.
But, it is really hard to know what's wrong since we don't have any RTL8156* adapters at this moment.

We will try ordering one early next week because it is already close to Friday evening here in Korea.

madbrain
Posts: 86
Joined: Sat Aug 05, 2017 5:40 pm
languages_spoken: English, Français
ODROIDs: XU4, N2+
Has thanked: 0
Been thanked: 5 times
Contact:

Re: Ubuntu 20.04 - RTL8156 2.5Gbps Ethernet driver

Post by madbrain »

odroid wrote:
Fri Jan 07, 2022 3:14 pm
Thank you for the situation description.
But, it is really hard to know what's wrong since we don't have any RTL8156* adapters at this moment.

We will try ordering one early next week because it is already close to Friday evening here in Korea.
Thanks. Let me know what you find out if you get one.

FYI, this is the specific card I'm using :
https://www.amazon.com/gp/product/B084L ... UTF8&psc=1

Maybe it's time for me to try this NIC with a few other Linux devices. I am not sure I trust this Realtek Linux driver. I have 2 weeks to decide whether to keep them or return them to Amazon (I have one still unopened).

I'll try it on x64 on my NAS in lieu of the 10 Gbit Aquantia PCIE NIC and see if it holds up throughput and stability wise.

Assuming it does, I also have a Raspberry Pi 4B to try. I did a quick test on it last week, and saw the same performance issues as I did on the XU4 in the original post of this thread, but I'm sure it was using the old legacy driver as well.

Lastly, I also have an Odroid N2+ in the back of the house, currently behind a Ubiquiti Wifi bridge. It seems others have had success with this card and the N2+, so maybe there is hope.
These users thanked the author madbrain for the post:
odroid (Fri Jan 07, 2022 3:22 pm)

brad
Posts: 1479
Joined: Tue Mar 29, 2016 1:22 pm
languages_spoken: english
ODROIDs: C2 C4 HC4 N1 N2 N2+ H2 H2+ (64 bit ftw)
Location: Australia
Has thanked: 140 times
Been thanked: 227 times
Contact:

Re: Ubuntu 20.04 - RTL8156 2.5Gbps Ethernet driver

Post by brad »

I don't really know about the exynos but this might be something to rule out..

Have seen issues on other setups (2.5G) where tools like iperf (that do not generate much cpu load) don't scale up cpu frequency. As a result the interrupts were ticking away slower than expected and network throughput (and latency) suffered. At the time I could test it by running some cpu load in the background and watching the network throughput go up. Fixed it reducing some of the power saving settings.

User avatar
odroid
Site Admin
Posts: 38528
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English, Korean
ODROIDs: ODROID
Has thanked: 2211 times
Been thanked: 1295 times
Contact:

Re: Ubuntu 20.04 - RTL8156 2.5Gbps Ethernet driver

Post by odroid »

Since the stock governor for both little and big cores are "performance" on our Ubuntu image, I think there might not be any relation to the power saving stuff.
But, it must be worth to check the current CPU governors.

madbrain
Posts: 86
Joined: Sat Aug 05, 2017 5:40 pm
languages_spoken: English, Français
ODROIDs: XU4, N2+
Has thanked: 0
Been thanked: 5 times
Contact:

Re: Ubuntu 20.04 - RTL8156 2.5Gbps Ethernet driver

Post by madbrain »

So, I disconnected the RTL8156B from the XU4. Went back to the built-in NIC. I reverted the odroid-tweaks to the original version also.

And ... iperf3 performance was bad also with the built-in NIC. This time it was the send side that was at 700 Mbps, though ! And receive side was at 900+ as expected.
I figured the r8152 driver might be interfering. I did an "rmmod r8152" ... And immediately lost all network connections.
Looks like the r8152 driver I built handles both the built-in NIC and the RTL8156B.
And the kernel I built no longer has the driver for the built-in NIC.
The machine was running headless, so this was a bad situation to be in.
I attached it to a free port on my KVM switch. But got a blank screen. Had to pull the power plug.
Fortunately, it came back with local desktop & keyboard/mouse on the KVM.
I was able to then reinstall the r8152.ko driver. Now the XU4 is back on the LAN. But still not back to its original network performance on the built-in NIC. I had to revert my changes to the kernel with git, then ran make menuconfig and changed the r8152 driver to "M". And rebuilt and reinstalled the kernel with the Realtek 8152 module set to loadable ... Rebooted.
Now, iperf3 is back to normal - maxing out 1 Gbps in both directions. Phew. All that work to be back to square 1.

madbrain
Posts: 86
Joined: Sat Aug 05, 2017 5:40 pm
languages_spoken: English, Français
ODROIDs: XU4, N2+
Has thanked: 0
Been thanked: 5 times
Contact:

Re: Ubuntu 20.04 - RTL8156 2.5Gbps Ethernet driver

Post by madbrain »

FWIW, the NIC is not behaving great out of the box with Ubuntu 20.04 on x64 either. Getting 2.35 Gbps in one direction, and 1.6 Gbps in the other. Didn't write which one down. It's using the cdc_ncm driver.

I was able to load the r8152 driver and the udev rule that comes with it, and it's performing at full bandwidth in both directions with iperf3. Somewhat expected that it would work on x64. The server is beefy enough - i5-6600k overclocked to 4.4GHz. Surprises me that iperf3 manages to use as much as 20% CPU according to vmstat. I'm going to let the NAS run with that NIC for a day or so and see if anything untowards happens.

madbrain
Posts: 86
Joined: Sat Aug 05, 2017 5:40 pm
languages_spoken: English, Français
ODROIDs: XU4, N2+
Has thanked: 0
Been thanked: 5 times
Contact:

Re: Ubuntu 20.04 - RTL8156 2.5Gbps Ethernet driver

Post by madbrain »

brad wrote:
Fri Jan 07, 2022 3:50 pm
I don't really know about the exynos but this might be something to rule out..

Have seen issues on other setups (2.5G) where tools like iperf (that do not generate much cpu load) don't scale up cpu frequency. As a result the interrupts were ticking away slower than expected and network throughput (and latency) suffered. At the time I could test it by running some cpu load in the background and watching the network throughput go up. Fixed it reducing some of the power saving settings.
Thanks. I may try that next. What kind of load tool did you try ? Presumably you wouldn't want to fill all the cores.

brad
Posts: 1479
Joined: Tue Mar 29, 2016 1:22 pm
languages_spoken: english
ODROIDs: C2 C4 HC4 N1 N2 N2+ H2 H2+ (64 bit ftw)
Location: Australia
Has thanked: 140 times
Been thanked: 227 times
Contact:

Re: Ubuntu 20.04 - RTL8156 2.5Gbps Ethernet driver

Post by brad »

madbrain wrote:
Fri Jan 07, 2022 5:14 pm
brad wrote:
Fri Jan 07, 2022 3:50 pm
I don't really know about the exynos but this might be something to rule out..

Have seen issues on other setups (2.5G) where tools like iperf (that do not generate much cpu load) don't scale up cpu frequency. As a result the interrupts were ticking away slower than expected and network throughput (and latency) suffered. At the time I could test it by running some cpu load in the background and watching the network throughput go up. Fixed it reducing some of the power saving settings.
Thanks. I may try that next. What kind of load tool did you try ? Presumably you wouldn't want to fill all the cores.
It was just some load with the application I had installed but you should be able to load a single core using gzip to compress some random data

Code: Select all

 gzip -c /dev/urandom > /dev/null

madbrain
Posts: 86
Joined: Sat Aug 05, 2017 5:40 pm
languages_spoken: English, Français
ODROIDs: XU4, N2+
Has thanked: 0
Been thanked: 5 times
Contact:

Re: Ubuntu 20.04 - RTL8156 2.5Gbps Ethernet driver

Post by madbrain »

brad wrote:
Sat Jan 08, 2022 7:58 am
madbrain wrote:
Fri Jan 07, 2022 5:14 pm
brad wrote:
Fri Jan 07, 2022 3:50 pm
I don't really know about the exynos but this might be something to rule out..

Have seen issues on other setups (2.5G) where tools like iperf (that do not generate much cpu load) don't scale up cpu frequency. As a result the interrupts were ticking away slower than expected and network throughput (and latency) suffered. At the time I could test it by running some cpu load in the background and watching the network throughput go up. Fixed it reducing some of the power saving settings.
Thanks. I may try that next. What kind of load tool did you try ? Presumably you wouldn't want to fill all the cores.
It was just some load with the application I had installed but you should be able to load a single core using gzip to compress some random data

Code: Select all

 gzip -c /dev/urandom > /dev/null
Thanks ! I ran into this issue on Raspberry Pi4B with this RTL8156B NIC, where the iperf3 throughput sometimes would drop down inexplicably, sometimes going to zero. Running this gzip command as a background process helped stabilize the numbers a bit, but not completely.
I got about 1.8 to 1.9 Gbps on the receive side. On the send side, it was more variable - between 960 Mbps and 1.2 Gbps.
I also compiled the latest iperf3 from source, as it includes bidirectional testing. In the bidirectional test, the receive side continued to be much slower than the send side. Very strange. It wasn't stable, either.

Code: Select all

pi@genie:~ $ iperf3 -c server10g.local -i 10 -t 3600 --bidir
Connecting to host server10g.local, port 5201
[  5] local 192.168.1.10 port 60168 connected to 192.168.1.27 port 5201
[  7] local 192.168.1.10 port 60170 connected to 192.168.1.27 port 5201
[ ID][Role] Interval           Transfer     Bitrate         Retr  Cwnd
[  5][TX-C]   0.00-10.00  sec  2.16 GBytes  1.85 Gbits/sec    1    880 KBytes       
[  7][RX-C]   0.00-10.00  sec   582 MBytes   489 Mbits/sec                  
[  5][TX-C]  10.00-20.00  sec  2.08 GBytes  1.79 Gbits/sec    0   1.09 MBytes       
[  7][RX-C]  10.00-20.00  sec  1.05 GBytes   906 Mbits/sec                  
[  5][TX-C]  20.00-30.00  sec  2.04 GBytes  1.75 Gbits/sec    0   1.09 MBytes       
[  7][RX-C]  20.00-30.00  sec  1.24 GBytes  1.06 Gbits/sec                  
[  5][TX-C]  30.00-40.00  sec  2.07 GBytes  1.78 Gbits/sec    0   1.66 MBytes       
[  7][RX-C]  30.00-40.00  sec  1.05 GBytes   905 Mbits/sec                  
[  5][TX-C]  40.00-50.00  sec  2.19 GBytes  1.88 Gbits/sec    0   1.66 MBytes       
[  7][RX-C]  40.00-50.00  sec   463 MBytes   389 Mbits/sec  
I'm still playing with it. I don't think the Pi4B likes this NIC very much either. At least I haven't got it to completely hang on me. But I suspect running the test for a long time might accomplish that. I was using a 32-bit kernel, also. A 64-bit one might perform better, though I'm not sure. Anyway, thanks for the help.

User avatar
odroid
Site Admin
Posts: 38528
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English, Korean
ODROIDs: ODROID
Has thanked: 2211 times
Been thanked: 1295 times
Contact:

Re: Ubuntu 20.04 - RTL8156 2.5Gbps Ethernet driver

Post by odroid »

Can you please try that RTL8156B NIC on your N2+ board to narrow down root causes?

BTW, we've placed an order on Amazon. It may take a couple of weeks to arrive here.

madbrain
Posts: 86
Joined: Sat Aug 05, 2017 5:40 pm
languages_spoken: English, Français
ODROIDs: XU4, N2+
Has thanked: 0
Been thanked: 5 times
Contact:

Re: Ubuntu 20.04 - RTL8156 2.5Gbps Ethernet driver

Post by madbrain »

odroid wrote:
Mon Jan 10, 2022 10:38 am
Can you please try that RTL8156B NIC on your N2+ board to narrow down root causes?
OK, I will give it a try. I notice that the Ubuntu images at https://odroid.in/ubuntu_20.04lts/n2/ only have kernel 4.9 . Is there any plan to get kernel 5.x to run on the N2+?

User avatar
odroid
Site Admin
Posts: 38528
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English, Korean
ODROIDs: ODROID
Has thanked: 2211 times
Been thanked: 1295 times
Contact:

Re: Ubuntu 20.04 - RTL8156 2.5Gbps Ethernet driver

Post by odroid »

madbrain wrote:
Mon Jan 10, 2022 11:27 am
odroid wrote:
Mon Jan 10, 2022 10:38 am
Can you please try that RTL8156B NIC on your N2+ board to narrow down root causes?
OK, I will give it a try. I notice that the Ubuntu images at https://odroid.in/ubuntu_20.04lts/n2/ only have kernel 4.9 . Is there any plan to get kernel 5.x to run on the N2+?
Try this upstream image.
viewtopic.php?f=52&t=42981

madbrain
Posts: 86
Joined: Sat Aug 05, 2017 5:40 pm
languages_spoken: English, Français
ODROIDs: XU4, N2+
Has thanked: 0
Been thanked: 5 times
Contact:

Re: Ubuntu 20.04 - RTL8156 2.5Gbps Ethernet driver

Post by madbrain »

odroid wrote:
Mon Jan 10, 2022 11:28 am
Try this upstream image.
viewtopic.php?f=52&t=42981
Thanks. I didn't see a link to the image in that thread. Where is it ?

Also, I tried Ubuntu 21.10 on x64, I had a lot of issues with it and reverted to 20.04 .
I would prefer Ubuntu 20 with newer kernel, as seems to be the case on the XU4 image.

User avatar
mad_ady
Posts: 10149
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, C4, N1, N2, H2, Go, Go Advance
Location: Bucharest, Romania
Has thanked: 632 times
Been thanked: 815 times
Contact:

Re: Ubuntu 20.04 - RTL8156 2.5Gbps Ethernet driver

Post by mad_ady »

I didn't see a link to the image in that thread. Where is it ?
The installation is done through petitboot:
  • put the boot selector in spi mode. Unplug power cable and replug it
  • from the petitboot menu select Exit
  • in the shell run dhcpc
  • after you get an IP, run netboot_default
  • exit the shell. You get back to the petitboot menu and you should see a list of OSes that you can install.
If it doesn't work, reboot and try again.

madbrain
Posts: 86
Joined: Sat Aug 05, 2017 5:40 pm
languages_spoken: English, Français
ODROIDs: XU4, N2+
Has thanked: 0
Been thanked: 5 times
Contact:

Re: Ubuntu 20.04 - RTL8156 2.5Gbps Ethernet driver

Post by madbrain »

mad_ady wrote:
Mon Jan 10, 2022 3:54 pm
I didn't see a link to the image in that thread. Where is it ?
The installation is done through petitboot:
  • put the boot selector in spi mode. Unplug power cable and replug it
  • from the petitboot menu select Exit
  • in the shell run dhcpc
Thanks. I tried that, but I get :

Code: Select all

/bin/sh: dhcpc: not found

Code: Select all

find / -name dhcpc
also doesn't find it.

I'm guessing firmware isn't up to date. I'm using an N2+.

Edit: typing

Code: Select all

ifconfig
shows that the built-in ethernet NIC acquired an IP from my DHCP server.

Code: Select all

netboot_default
is nowhere to be found in the file system, though.

User avatar
mad_ady
Posts: 10149
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, C4, N1, N2, H2, Go, Go Advance
Location: Bucharest, Romania
Has thanked: 632 times
Been thanked: 815 times
Contact:

Re: Ubuntu 20.04 - RTL8156 2.5Gbps Ethernet driver

Post by mad_ady »

See this thread for details: viewtopic.php?t=37109

You can update petitboot from its command-line with pb-update (I think). See here for details: https://wiki.odroid.com/odroid-n2/os_images/petitboot

madbrain
Posts: 86
Joined: Sat Aug 05, 2017 5:40 pm
languages_spoken: English, Français
ODROIDs: XU4, N2+
Has thanked: 0
Been thanked: 5 times
Contact:

Re: Ubuntu 20.04 - RTL8156 2.5Gbps Ethernet driver

Post by madbrain »

mad_ady wrote:
Mon Jan 10, 2022 5:57 pm
See this thread for details: viewtopic.php?t=37109

You can update petitboot from its command-line with pb-update (I think). See here for details: https://wiki.odroid.com/odroid-n2/os_images/petitboot
Thanks. I'll take a look later. For now, I just installed the Ubuntu 20.04 kernel 4.9 image for the N2. I ran into performance issues even with the built-in 1gig NIC. Using iperf3 from master source on github (https://github.com/esnet/iperf), I can max the 1 Gbps connection in either send or receive direction. However, in duplex mode (--bidir), there is a problem where one side is much slower than the other. I believe it was the receive that was slower.

Using the RTL8156B, I was initially able to max out the 2.5 Gbps connection in one direction (send side, once again). The receive direction however was still much slower, still sub-gigabit. This was using the cdc drivers that came with the Ubuntu image. I tried compiling the Realtek 8152 drivers 2.15.0 from source. However, I ran into missing defines related to 2.5 Gbps speed. Probably due to the 4.9 kernel being too old. It looks like both the 4.9 kernel and the NBASE-T specification that defines 2.5 Gbase-T came out in 2016, so that makes sense.

I am also having a few hardware problems at the moment, so a bit reticent to post any more numbers. One of my cats chewed up the CAT6 cable that was attached to this Realtek. I just got a CAT7 cable from the garage to replace. One port on one of my two TL-SX105 10Gig switches also died. It wasn't the port on which the RTL8156B was attached, or even the same switch. At this point, the switch LED indicates the RTL8156B is connected at 2.5G speed. But I can't get more than 939 Mbps in either direction anymore. I hate it when test results are not reproducible. I also ran into the case where the NIC stopped working completely, and had to reboot. I ran into that in my Pi 4B tests yesterday as well. I am not certain what's going with the RTL8156B at this particular moment. Maybe it overheated. Maybe the driver is just bad. I'm going to try it overnight on my Windows system to see if it misbehaves also. Have yet to recompile iperf3 for bidirectional support on Windows, though ...

madbrain
Posts: 86
Joined: Sat Aug 05, 2017 5:40 pm
languages_spoken: English, Français
ODROIDs: XU4, N2+
Has thanked: 0
Been thanked: 5 times
Contact:

Re: Ubuntu 20.04 - RTL8156 2.5Gbps Ethernet driver

Post by madbrain »

FYI, the RTL8156B NIC behaved fine overnight under Windows in a unidirectional test. Windows box was the client. It sustained about 2.2 Gbps the whole time, in send mode. I was hitting my Linux x64 NAS with a 10Gbps Aquantia PCIe NIC. I think the Realtek Linux driver may have some bugs that make it unsuitable. I'll run an overnight test later tonight doing the reverse - Linux x64 box using the Realtek 2.5G USB NIC hitting the Windows box running Aquantia 10G PCIe NIC. Maybe that'll shed some light on whether there is a case where that Realtek Linux driver ever works properly.

As to switches, oll ports on the two TL-SX105 switches started working properly again after being powered off and rebooted. I'm going to return one of them to Amazon since it's still in the return period, and buy another. I probably need to space them out more as they run very hot and are stacked on top of each other, and on top of a 16-port 1gig switch underneath. The one that had a a seemingly bad port is the one in the middle.

Post Reply

Return to “Ubuntu”

Who is online

Users browsing this forum: No registered users and 1 guest