[SOLVED] Ethernet Expansion Module Link Speed on Debian

Just got my expansion card in the mail minutes ago but I cannot get it to function properly nor have I be able to determine a good cause.

I’m currently running Debian 11 with a 5.19 kernel. From what I’ve gathered the driver for the RTL8156 has been in the kernel since 5.13 and the system certainly detect it fine. The full lsusb output of the device is at: https://termbin.com/22j1

The main issue seems to be the the adapter isn’t reporting any appropriate information to the system and so it’s defaulting to 100Mbps and half duplex. It also takes a fairly significant time for a link to even be detected. I’ve attempted to manually set the speed and duplex with ethtool but I am only returned an “Operation not permitted” error. Additionally there are no errors regarding the device in dmesg. Below is the output of ethtool.

Settings for enx9cbf0d0002c3:
Supported ports: [ ]
Supported link modes: Not reported
Supported pause frame use: No
Supports auto-negotiation: No
Supported FEC modes: Not reported
Advertised link modes: Not reported
Advertised pause frame use: No
Advertised auto-negotiation: No
Advertised FEC modes: Not reported
Speed: 100Mb/s
Duplex: Half
Auto-negotiation: off
Port: Twisted Pair
PHYAD: 0
Transceiver: internal
MDI-X: Unknown
Current message level: 0x00000007 (7)
drv probe link
Link detected: yes

Anyone else who has received one seeing similar? Or everything working perfectly fine? I’ve never had an ethernet adapter behave in such a way so I’m at a loss of how to proceed.

Edit: Got it working.

While researching I came across this: Fixing performance issues with Realtek RTL8156B 2.5GbE USB dongle in Ubuntu - CNX Software

That revealed to me that instead of the appropriate realtek driver my system was loading the cdc-ncm driver. After adding a udev rule which I got from here: realtek-r8152-linux/50-usb-realtek-net.rules at master · wget/realtek-r8152-linux · GitHub

I then unloaded the cdc_mbim and cdc_ncm modules and restarted udev. Now ethtool reports all appropriate information and I’m and full link speed.

4 Likes

Thank you very much for posting this. I was having the same issue with my Framework adapter, as well as Plugable USBC-E2500 adapters (which also use RTL8156B).

Same experience as you on Ubuntu 22.10, 5.19.0-26-generic. Interface comes up using the cdc_ncm driver, with half-duplex instead of full. Testing an RTL8156B to another RTL8156B with iperf3 showed the interfaces around 400 Mbits/sec and retransmits.

[ ID] Interval           Transfer     Bitrate         Retr
[  5]   0.00-10.00  sec   495 MBytes   415 Mbits/sec  749             sender
[  5]   0.00-10.04  sec   494 MBytes   413 Mbits/sec                  receiver

Installing this udev rule (a simplification of the one you shared) in /etc/udev/rules.d/50-usb-realtek-net.rules was the fix:

# This is used to change the default configuration of Realtek USB ethernet adapters

ACTION!="add", GOTO="usb_realtek_net_end"
SUBSYSTEM!="usb", GOTO="usb_realtek_net_end"
ENV{DEVTYPE}!="usb_device", GOTO="usb_realtek_net_end"

# Modify this to change the default value
ENV{REALTEK_MODE1}="1"

# Realtek
ATTR{idVendor}=="0bda", ATTR{idProduct}=="815[2,3,5,6]", ATTR{bConfigurationValue}!="$env{REALTEK_MODE1}", ATTR{bConfigurationValue}="$env{REALTEK_MODE1}"

LABEL="usb_realtek_net_end"

I then replugged the usb devices and confirmed the r8152 driver was in use:

$ sudo ethtool -i enx8cae4cdd6a8b
driver: r8152
... snip ...

iperf3 now reports 2.32 Gbits/sec duplex. :+1:

1 Like