2.5g ethernet fast as client slow as server?

Anyone any ideas why my usb3.0 2.5gb ethernet drops so low when the RockPi4 is the Iperf server

[rock@rockpi4 ~]$ iperf3 -s
-----------------------------------------------------------
Server listening on 5201
-----------------------------------------------------------
Accepted connection from 192.168.1.12, port 52620
[  5] local 192.168.1.9 port 5201 connected to 192.168.1.12 port 52621
[ ID] Interval           Transfer     Bitrate
[  5]   0.00-1.00   sec  56.7 MBytes   475 Mbits/sec
[  5]   1.00-2.00   sec  43.7 MBytes   367 Mbits/sec
[  5]   2.00-3.00   sec  46.3 MBytes   388 Mbits/sec
[  5]   3.00-4.00   sec  39.3 MBytes   330 Mbits/sec
[  5]   4.00-5.00   sec  45.2 MBytes   379 Mbits/sec
[  5]   5.00-6.00   sec  38.3 MBytes   321 Mbits/sec
[  5]   6.00-7.00   sec  41.4 MBytes   347 Mbits/sec
[  5]   7.00-8.00   sec  38.0 MBytes   319 Mbits/sec
[  5]   8.00-9.00   sec  42.0 MBytes   353 Mbits/sec
[  5]   9.00-10.00  sec  46.4 MBytes   389 Mbits/sec
[  5]  10.00-10.05  sec  2.29 MBytes   404 Mbits/sec
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bitrate
[  5]   0.00-10.05  sec   440 MBytes   367 Mbits/sec                  receiver
-----------------------------------------------------------
Server listening on 5201
-----------------------------------------------------------

RockPi4 as client

[rock@rockpi4 ~]$ iperf3 -c 192.168.1.12
Connecting to host 192.168.1.12, port 5201
[  5] local 192.168.1.9 port 38240 connected to 192.168.1.12 port 5201
[ ID] Interval           Transfer     Bitrate         Retr  Cwnd
[  5]   0.00-1.00   sec   186 MBytes  1.55 Gbits/sec    0    220 KBytes
[  5]   1.00-2.00   sec   190 MBytes  1.60 Gbits/sec   10    212 KBytes
[  5]   2.00-3.00   sec   215 MBytes  1.80 Gbits/sec    0    212 KBytes
[  5]   3.00-4.01   sec   208 MBytes  1.74 Gbits/sec   10    245 KBytes
[  5]   4.01-5.00   sec   180 MBytes  1.52 Gbits/sec   30    212 KBytes
[  5]   5.00-6.00   sec   197 MBytes  1.65 Gbits/sec   10    214 KBytes
[  5]   6.00-7.01   sec   161 MBytes  1.34 Gbits/sec    0    214 KBytes
[  5]   7.01-8.00   sec   137 MBytes  1.15 Gbits/sec   30    214 KBytes
[  5]   8.00-9.01   sec   138 MBytes  1.15 Gbits/sec   20    217 KBytes
[  5]   9.01-10.00  sec   159 MBytes  1.34 Gbits/sec    0    217 KBytes
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bitrate         Retr
[  5]   0.00-10.00  sec  1.73 GBytes  1.48 Gbits/sec  110             sender
[  5]   0.00-10.00  sec  1.73 GBytes  1.48 Gbits/sec                  receiver

iperf Done.

I prob need to sort some better cabling as my dodgy collection of battered and old ethernet cables made me rummage around until I got 2 half decent ones but I am not sure why client/server should make such a big difference and set speed?

If the rockpi4 is the server and the client uses -R then

[rock@rockpi4 ~]$ iperf3 -s
-----------------------------------------------------------
Server listening on 5201
-----------------------------------------------------------
Accepted connection from 192.168.1.12, port 52663
[  5] local 192.168.1.9 port 5201 connected to 192.168.1.12 port 52664
[ ID] Interval           Transfer     Bitrate         Retr  Cwnd
[  5]   0.00-1.00   sec   181 MBytes  1.52 Gbits/sec   10    151 KBytes
[  5]   1.00-2.00   sec   187 MBytes  1.57 Gbits/sec   20    231 KBytes
[  5]   2.00-3.01   sec   199 MBytes  1.66 Gbits/sec   31    210 KBytes
[  5]   3.01-4.00   sec   204 MBytes  1.71 Gbits/sec   10    155 KBytes
[  5]   4.00-5.01   sec   184 MBytes  1.54 Gbits/sec  124    212 KBytes
[  5]   5.01-6.01   sec   205 MBytes  1.72 Gbits/sec    0    212 KBytes
[  5]   6.01-7.00   sec   187 MBytes  1.58 Gbits/sec   20    214 KBytes
[  5]   7.00-8.01   sec   207 MBytes  1.73 Gbits/sec   10    238 KBytes
[  5]   8.01-9.01   sec   198 MBytes  1.67 Gbits/sec   11    212 KBytes
[  5]   9.01-10.00  sec   182 MBytes  1.53 Gbits/sec   30    230 KBytes
[  5]  10.00-10.04  sec  8.15 MBytes  1.85 Gbits/sec    0    230 KBytes
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bitrate         Retr
[  5]   0.00-10.04  sec  1.90 GBytes  1.62 Gbits/sec  266             sender
-----------------------------------------------------------
Server listening on 5201

Its samba that is the real problem as then on transfer using a zram disk or ssd speeds drop to 25-30mbs

PS setting affinity can make a big difference

[root@rockpi4 ~]# grep -E 'usb' /proc/interrupts
 28:          2          0          0          0          0          0     GICv3  58 Level     ehci_hcd:usb1
 29:         30          0          0          0          0          0     GICv3  60 Level     ohci_hcd:usb3
 30:          0          0          0          0          0          0     GICv3  62 Level     ehci_hcd:usb2
 31:          0          0          0          0          0          0     GICv3  64 Level     ohci_hcd:usb4
219:          1          0          0          0          0          0     GICv3  59 Level     rockchip_usb2phy
220:          0          0          0          0          0          0     GICv3 135 Level     rockchip_usb2phy_bvalid
221:          0          0          0          0          0          0     GICv3  63 Level     rockchip_usb2phy
222:          0          0          0          0          0          0     GICv3 137 Level     dwc3-otg, xhci-hcd:usb5
223:      40809          0          0          0          0     969377     GICv3 142 Level     xhci-hcd:usb7

echo 5 > /proc/irq/223/smp_affinity_list
[root@rockpi4 ~]# iperf3 -c 192.168.1.12
Connecting to host 192.168.1.12, port 5201
[  5] local 192.168.1.9 port 38752 connected to 192.168.1.12 port 5201
[ ID] Interval           Transfer     Bitrate         Retr  Cwnd
[  5]   0.00-1.00   sec   249 MBytes  2.09 Gbits/sec    0    211 KBytes
[  5]   1.00-2.00   sec   254 MBytes  2.12 Gbits/sec    0    211 KBytes
[  5]   2.00-3.00   sec   246 MBytes  2.07 Gbits/sec   10    212 KBytes
[  5]   3.00-4.01   sec   255 MBytes  2.13 Gbits/sec    0    212 KBytes
[  5]   4.01-5.00   sec   245 MBytes  2.06 Gbits/sec   10    217 KBytes
[  5]   5.00-6.00   sec   256 MBytes  2.14 Gbits/sec    0    217 KBytes
[  5]   6.00-7.00   sec   253 MBytes  2.13 Gbits/sec    0    217 KBytes
[  5]   7.00-8.01   sec   253 MBytes  2.12 Gbits/sec    0    217 KBytes
[  5]   8.01-9.00   sec   253 MBytes  2.13 Gbits/sec    0    217 KBytes
[  5]   9.00-10.00  sec   254 MBytes  2.13 Gbits/sec    0    217 KBytes
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bitrate         Retr
[  5]   0.00-10.00  sec  2.46 GBytes  2.11 Gbits/sec   20             sender
[  5]   0.00-10.00  sec  2.46 GBytes  2.11 Gbits/sec                  receiver

Finally sorted it and installed the r8152 driver from AUR

[rock@rockpi4 ~]$ iperf3 -s
-----------------------------------------------------------
Server listening on 5201
-----------------------------------------------------------
Accepted connection from 192.168.1.9, port 55306
[  5] local 192.168.1.12 port 5201 connected to 192.168.1.9 port 55307
[ ID] Interval           Transfer     Bitrate
[  5]   0.00-1.00   sec   266 MBytes  2.23 Gbits/sec
[  5]   1.00-2.00   sec   279 MBytes  2.34 Gbits/sec
[  5]   2.00-3.00   sec   280 MBytes  2.35 Gbits/sec
[  5]   3.00-4.00   sec   280 MBytes  2.35 Gbits/sec
[  5]   4.00-5.00   sec   280 MBytes  2.34 Gbits/sec
[  5]   5.00-6.00   sec   279 MBytes  2.34 Gbits/sec
[  5]   6.00-7.00   sec   279 MBytes  2.34 Gbits/sec
[  5]   7.00-8.00   sec   279 MBytes  2.34 Gbits/sec
[  5]   8.00-9.00   sec   280 MBytes  2.35 Gbits/sec
[  5]   9.00-10.00  sec   280 MBytes  2.35 Gbits/sec
[  5]  10.00-10.03  sec  8.91 MBytes  2.34 Gbits/sec
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bitrate
[  5]   0.00-10.03  sec  2.73 GBytes  2.33 Gbits/sec                  receiver
-----------------------------------------------------------
Server listening on 5201
-----------------------------------------------------------

Aint bad and the adaptors seem quite decently made in a larger enclosure and seems a bit cooler than my plugable 1gbe.
Guess I will have to try some Samba tests!
I am using Manjaro and currently on 5.2.4 but 5.1 onward works fine and whatever distro get rid of the cdc_ncm driver and use the r8152 driver as it includes the 8156

If you are interested

https://cpc.farnell.com/pro-signal/psg91497/usb3-0-to-2-5g-ethernet-adapter/dp/CS32425

After working out how to get the drivers going an eventual thumbs up from me.
Blingdows they work on plug its just some Linux distros that pull in the generic cdc_ncm driver though.

1 Like