Sabrent USB 2.5G Ethernet Adapter: Realtek 8152 Chipset Drivers from AUR?

Hello!

I just got home and am getting ready to try this.

I noticed you’re using the 5.10.17-2 kernel. I’m currently running 5.11.0-3. Should I update the version number?

I see the 5.10 headers and the 5.10 (UDL) version of the kernel, but I don’t see the 5.10.x version of the kernel for download…

EDIT: Also, did you use these Udev rules provided by Realtek with the 2.14 version of their linux driver?

The NIC mode appears to relate to the fact that this thing has multiple operation modes. I’m not sure what they each do, yet. Regarding modes, here’s what usbview has to say:

USB 10/100/1G/2.5G LAN
Manufacturer: Realtek
Serial Number: 000000001
Speed: unknown
USB Version:  3.20
Device Class: 00(>ifc )
Device Subclass: 00
Device Protocol: 00
Maximum Default Endpoint Size: 9
Number of Configurations: 3
Vendor Id: 0bda
Product Id: 8156
Revision Number: 30.00

Config Number: 1
	Number of Interfaces: 1
	Attributes: a0
	MaxPower Needed: 512mA

	Interface Number: 0
		Name: (none)
		Alternate Number: 0
		Class: ff(vend.) 
		Sub Class: ff
		Protocol: 00
		Number of Endpoints: 3

			Endpoint Address: 81
			Direction: in
			Attribute: 2
			Type: Bulk
			Max Packet Size: 1024
			Interval: 0ms

			Endpoint Address: 02
			Direction: out
			Attribute: 2
			Type: Bulk
			Max Packet Size: 1024
			Interval: 0ms

			Endpoint Address: 83
			Direction: in
			Attribute: 3
			Type: Int.
			Max Packet Size: 2
			Interval: 128ms

Config Number: 2
	Number of Interfaces: 2
	Attributes: a0
	MaxPower Needed: 512mA

	Interface Number: 0
		Name: 
		Alternate Number: 0
		Class: 02(comm.) 
		Sub Class: 0d
		Protocol: 00
		Number of Endpoints: 1

			Endpoint Address: 83
			Direction: in
			Attribute: 3
			Type: Int.
			Max Packet Size: 16
			Interval: 16ms

	Interface Number: 1
		Name: 
		Alternate Number: 0
		Class: 0a(data ) 
		Sub Class: 00
		Protocol: 01
		Number of Endpoints: 0

	Interface Number: 1
		Name: 
		Alternate Number: 1
		Class: 0a(data ) 
		Sub Class: 00
		Protocol: 01
		Number of Endpoints: 2

			Endpoint Address: 81
			Direction: in
			Attribute: 2
			Type: Bulk
			Max Packet Size: 1024
			Interval: 0ms

			Endpoint Address: 02
			Direction: out
			Attribute: 2
			Type: Bulk
			Max Packet Size: 1024
			Interval: 0ms

Config Number: 3
	Number of Interfaces: 2
	Attributes: a0
	MaxPower Needed: 512mA

	Interface Number: 0
		Name: 
		Alternate Number: 0
		Class: 02(comm.) 
		Sub Class: 06
		Protocol: 00
		Number of Endpoints: 1

			Endpoint Address: 83
			Direction: in
			Attribute: 3
			Type: Int.
			Max Packet Size: 16
			Interval: 16ms

	Interface Number: 1
		Name: 
		Alternate Number: 0
		Class: 0a(data ) 
		Sub Class: 00
		Protocol: 00
		Number of Endpoints: 0

	Interface Number: 1
		Name: 
		Alternate Number: 1
		Class: 0a(data ) 
		Sub Class: 00
		Protocol: 00
		Number of Endpoints: 2

			Endpoint Address: 81
			Direction: in
			Attribute: 2
			Type: Bulk
			Max Packet Size: 1024
			Interval: 0ms

			Endpoint Address: 02
			Direction: out
			Attribute: 2
			Type: Bulk
			Max Packet Size: 1024
			Interval: 0ms

Just install the packages in the tarball as explained above.

Thanks. I’m not going to deviate from the instructions. Just wanted to make sure my kernel was compatible.

I am curious about the NIC modes, but I need to go hunt down info on how this card works. Realtek does not really describe the nitty gritty of their cards very well.

It will be removed and replaced with this test kernel.

Oh! That makes sense. I suppose I can’t test a compiled kernel unless I’m … using … it. :slight_smile:

When the test is over, how do I switch back?

sudo pacman -S linux-rpi4-mainline linux-rpi4-mainline-headers

You need to remove the dkms package first though. The 8152 module is built in the linux-rpi4-mainline kernel in the repo right now.

Module loaded:

 ~]$ lsmod | grep 81
 r8152                 225280  0

Driver loaded:

~]$ inxi -N
Network:   Device-1: Realtek USB 10/100/1G/2.5G LAN type: USB driver: r8152 

Interface down while no network cable is plugged in:

4: enp1s0u2: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc fq_codel state DOWN group default qlen 1000
    link/ether $HW_MAC brd ff:ff:ff:ff:ff:ff

All the ethernet USB adapters I’ve seen have the most ridiculous interface names…

Progress: Proper activity lights on switch indicating a 2.5G connection and Blinky-Blinky on the adapter–both things I’d not seen before.

Network Cable In:

 ~]$ ip addr show enp1s0u2
4: enp1s0u2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    link/ether $HW_MAC brd ff:ff:ff:ff:ff:ff

Current Status:

  1. The adapter has never been UP before. This is new. :slight_smile:
  2. It isn’t getting an IP, which is a problem. But I think that’s because the network adapter does not have the right name in NetworkManager. Going to try to fix that after I figure out why the system just crashed.
  3. After fixing the name of the adapter in nmtui, it immediately plugged in the device’s MAC and grabbed an IP.

EDIT: It either crashed because the NVME drive and enclosure do not like being plugged into the USB 2 port (which I just realized I did…it’s dark over there), OR from static electricity discharge.

Known Issues:

  1. LightDM won’t start. Not clear why yet. I’m going to check the logs, but I’m guessing the current version is expecting the 5.11 kernel. It makes sense it’s not working if that’s the case.

Update: Xorg’s log says “no screen found,” which makes no sense. The dummy plug is still there. Let me try…jiggling it or something.

  1. If left connected long enough (hours?), eventually the adapter drops the connection, and takes a few minutes to reconnect. The Pi does not indicate any interruption in uptime. Again, I’m wondering if this might be an issue with the Pi not being able to deliver steady power to the USB 3 port over time. I’ve also seen similar reports of this behavior.

]$ journalctl | grep usb

Feb 28 00:30:16 teletraan1 kernel: usb 2-2: reset SuperSpeed Gen 1 USB device number 3 using xhci_hcd
Feb 28 01:28:03 teletraan1 kernel: usb 2-2: reset SuperSpeed Gen 1 USB device number 3 using xhci_hcd
Feb 28 09:05:58 teletraan1 NetworkManager[389]: <info>  [1614524758.2949] dhcp4 (enp1s0u2):   hostname 'teletraan1usb25g'

Looks like this is probably the issue: networking - USB ethernet adapter (Realtek r8153) keeps disconnecting - Ask Ubuntu

The USB port eventually enters a suspend mode, and the adapter chokes. There’s some instructions in that thread for using a Udev rule to keep that from happening, but I don’t understand the rule well enough yet to try it. EDIT: I’ve studied this a bit more and think I understand it well enough to add a Udev rule–make sure to set the idProduct to whatever lsusb says:
(This rule MAY work. Powertop does not appear to read the value as changed, but gave me the command to execute to check the value. See below.)

ACTION==“add|change”, SUBSYSTEM==“usb”, ATTR{idVendor}==“0bda”, ATTR{idProduct}==“8156”, TEST==“power/control”, ATTR{power/control}=“on”

cat /sys/bus/usb/devices/1-1/power/autosuspend
0

So it looks like the Udev rule worked, but I’ll need to try to let it run overnight to see.

  1. With the NVME drive plugged into the USB 2 port, max thoroughput is roughly equal to a high performance SD card on its best day. I wonder if the problem with putting the NVME and the adapter on the USB 3 bus is some sort of driver conflict (fixable?), too much load (less fixable?), or not enough power from the bus to run both at once (probably the easiest to fix).

The previous reply, which still has outstanding issues as I write this re: LightDM, is getting a little long.

So here’s a new reply with some speed test results from iperf3…
I ran this 5 times, and got basically the same results every time. For the record, this is about 2.07 times faster than what I was getting with the builtin 1Gbps adapter, and I could probably push it harder with jumbo frames, etc. Though, that would require me to learn a lot more about how to configure my switch/VLANs, etc.

[$USER@teletraan1 ~]$ iperf3 -c $HOST
Connecting to host $HOST, port 5201
[  5] local ... port 56506 connected to $HOST port 5201
[ ID] Interval           Transfer     Bitrate         Retr  Cwnd
[  5]   0.00-1.00   sec   218 MBytes  1.83 Gbits/sec    0    691 KBytes       
[  5]   1.00-2.00   sec   216 MBytes  1.82 Gbits/sec    0    691 KBytes       
[  5]   2.00-3.00   sec   218 MBytes  1.82 Gbits/sec    0    731 KBytes       
[  5]   3.00-4.00   sec   215 MBytes  1.81 Gbits/sec    0    802 KBytes       
[  5]   4.00-5.00   sec   222 MBytes  1.87 Gbits/sec    0    802 KBytes       
[  5]   5.00-6.00   sec   214 MBytes  1.79 Gbits/sec    0    802 KBytes       
[  5]   6.00-7.00   sec   216 MBytes  1.81 Gbits/sec    0    802 KBytes       
[  5]   7.00-8.00   sec   215 MBytes  1.81 Gbits/sec    0    802 KBytes       
[  5]   8.00-9.00   sec   216 MBytes  1.81 Gbits/sec    0    802 KBytes       
[  5]   9.00-10.00  sec   221 MBytes  1.85 Gbits/sec    0    802 KBytes       

Great success. :slight_smile:

Congrats. I am curious, what is the CPU load when transmitting data at that speed?

I’ll grab that for you, @0n0w1c . What’s the best way?

cpu percent in top, or something else?

EDIT: iPerf3 maxes 1 core when it runs, and sometimes spikes a second core up to ~40 percent.
iperf3 -c serverIP -P 10

Sure, top or htop will work, just wanting a general idea. I would expect the CPUs to rather busy above 1.5 Gbps. But are they 80%, 100%? I am wondering if serving up NFS via SSD and 2.5Gbps, both on USB 3 is more than the RPi4 can handle.

@0n0w1c sorry. I edited the above post and I guess that didn’t trigger a notice.

Interesting, so I would guess adding a 2.5Gbps USB adapter could meaningfully help an RPi4 NFS node. Especially if it is effectively caching a good portion of the NFS drive data.

@0n0w1c What’s NFS mode? I use CIFS for file transfers to/from my NAS, but I’m not sure if that’s what you’re talking about.

Does the CPU usage seem excessive to you?

Also: the SSD is currently on the USB 2 bus. I was running into power issues with them both on the same one. I have a powered USB 3 hub coming that I think will fix the problem.

Also, @Darksky , I thought my nomachine Remote Desktop software might not like the experimental kernel, so I just tested the Pi with an actual monitor plugged in–no Remote Desktop stuff. I saw the boot screen, but since LightDM failed to launch, nothing after that.

NFS node, NFS server, basically a NAS, talking NFS.

Ah!

My NAS (a QNAP) can do NFS, but setting it up was confusing so I went with CIFS/SMB.

Would you recommend doing NFS instead?

NFS is all I ever use, it meets my needs and I am familiar with it.

That makes sense. When I researched it, it appeared there wasn’t a huge speed difference between the two protocols, and under some circumstances SMB3 might be faster.

With that in mind, I went with SMB since it would be easier to set up on the Macs and Windows PCs I’ve got.

@0n0w1c : According to Jeff Geerling’s notes on his (much more thorough and informed) 2.5GbE test, Jumbo Frames (MTU 9000) are the key to getting peak performance out of a 2.5GbE interface on the Pi.

Overclocking will provide some benefit, but MTUs should provide peak benefit.

So, I just tried it. I reset the MTU to 9000 on my Mac (the iperf3 server), the Pi’s USB 3.0 ethernet adapter, and my NAS (which the Pi spends a lot of time talking to because deja-dup and timeshift together mean my Pi spends most of its time backing something up). The switch is a multi-gig model, that is set to MTU 9000 by default and apparently does something to auto negotiate with smaller frames. Unclear on this, but tl;dr it defaults to MTU 9000.

Result: Performance is unchanged, but iperf3 no longer pegs CPU core 1. Instead, it gets around 40-60 percent on core 1, and 30-50 percent on core 2.

As I’m not a fan of pegging CPUs, I think this is worth changing the MTU settings for, even if it’s not needed for speed.

Using a MTU 9000 is fine, but your machines will be limited to your own network unless they have an alternate route.