Bug 253374 - [if_ure] Add support for RTL8153B, RTL8156 and RTL8156B
Summary: [if_ure] Add support for RTL8153B, RTL8156 and RTL8156B
Status: New
Alias: None
Product: Base System
Classification: Unclassified
Component: usb (show other bugs)
Version: Unspecified
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-usb (Nobody)
Depends on:
Reported: 2021-02-09 14:49 UTC by fbbz
Modified: 2021-04-21 08:52 UTC (History)
7 users (show)

See Also:

if_ure.c and if_urereg.h patch (53.19 KB, patch)
2021-02-09 14:49 UTC, fbbz
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description fbbz 2021-02-09 14:49:28 UTC
Created attachment 222292 [details]
if_ure.c and if_urereg.h patch

Could you add support for Realtek RTL8153B, RTL8156 and RTL8156B ?

I tried doing it by studying openbsd and linux drivers, but since i'm not a developer, i certainly made some rookie mistakes.
Comment 1 Hans Petter Selasky freebsd_committer 2021-02-09 14:55:42 UTC
jmg@ is currently working on this driver. Please synchronize with him.

Comment 2 TOXIC 2021-02-27 13:21:46 UTC
Just wanted to express interest into this. 
I'm way over my head looking at the proposed patch and realy not competent to compile it, but I'm fairly familiar with linux comand line, will get around to learning the freebsd specialties which I find much simpler, so I'm available to test it out on my current opnSense installs running 12.1-RELEASE-p13-HBSD (hardened) with my USB RTL8156B and my ISP's box providing 2.5G ethernet.
Comment 3 Masachika ISHIZUKA 2021-03-01 08:11:00 UTC
RTL8156 will be supported by the cdce driver on 13.0-RELEASE.
You can try on 13.0-BETAs/RCs.
Comment 4 Niels Bakker 2021-04-14 13:19:27 UTC
(In reply to Masachika ISHIZUKA from comment #3)

I haven't compared performance of this patch with what if_cdce delivers, but 13.0-RELEASE's performance is not what I expected.

I have a USB dongle with RTL8156B chipset that easily gets 1.9 Gbps or 2.3 Gbps with iPerf3 when attached to a recent Apple laptop. FreeBSD added a USB quirk for the device to select profile 2. The device then gets 92 Mbps throughput.

If I switch it back to profile 1 using usbconfig -d ugen0.12 set_config 1, it gets roughly 800 Mbps. The switch says the port negotiated to 2.5 Gbps in either case.

Is there a way to achieve closer to linerate performance?
Comment 5 Hans Petter Selasky freebsd_committer 2021-04-14 13:23:59 UTC

I think jmg@ is working on something. Last update from him was that the Realtek devices disconnect from USB if stressed too much, and this is a severe problem.

Comment 6 sec 2021-04-21 08:52:50 UTC
(In reply to Masachika ISHIZUKA from comment #3)
Hi. Any news about RTL8153B support? About one week ago I tried 13-CURRENT on NanoPi R2S and it wasn't detected :(