2.5G USB->Ethernet, kmod-usb-net-rtl8152?

Would you be so kind as to explain/point me in the right direction, to create my own ipk from source drivers?

So, I have exactly the same 2.5G Realtek 8156 USB Ethernet adapter.

In the instructions below:

git clone https://github.com/openwrt/openwrt.git
cd openwrt
git checkout v19.07.4
wget https://github.com/mj22226/openwrt/commit/79a572b0d7685d6f44f9a872a2b1aa470ec83225.patch
patch -p 1 -i 79a572b0d7685d6f44f9a872a2b1aa470ec83225.patch
./scripts/feed update -a
./scrripts/feeds install -a
wget -O .config https://downloads.openwrt.org/releases/19.07.4/targets/x86/64/config.buildinfo
make defconfig

What should I checkout if I'm building a 64-bit image. What current version would that be? I believe the 64-bit image is not in a stable release yet, so I'm not sure what version I should use in:
git checkout

Thanks.

What you posted IS 64 is it not?

The instructions were posted by @mj82 (a few posts above).

I'm just learning how to build an image, so I'm not an expert. I think the instructions are about the stable release, but there is no stable release for the 64-bit version for Raspberry Pi 4b yet. So, my question is how do I do this when building a 64-bit version. What do I "git checkout" in the 64-bit version case?

Were you able to build an image with the proprietary driver for the RL8156 chipset? Did you build a 32-bit image or a 64-bit image?

Thank you very much!

Oh ok, raspberry pi, i dont know about that.
I have not tried installing the new firmware that should have RTL8156 proprietary driver yet.
I build a 64bit, for x86 there is a 64bit stable, i did not know u meant raspberry pi

Yes, sorry. I didn't realize this thread was not for Raspberry Pi 4B. I've been jumping from one thread to another, trying to find a solution. So, in my case, I have a Raspberry Pi 4B and a Plugable 2.5 USB3 to 2.5 Gbps Ethernet adapter. I need to get this adapter to work, as the standard Realtek 8152 driver doesn't work with this adapter.

I really don't understand all of the ins and outs of building an image or how to work with git. So, is there a way for me to do this with a 64-bit image (I'm building it now) for Raspberry Pi 4B or should is my only option the stable 32-bit image?

Iā€™ve compiled a snapshot 64-bit image for the Raspberry Pi 4B and selected pretty much every kmod-usb-net driver available. The Realtek 8156 chipset 2.5 Gbps adapter was installed and I was able to add it as a WAN port in the Luci GUI.

Yesterday, when I downloaded the standard 64-bit snapshot image for the Raspberry Pi 4, i couldnā€™t get the Plugable 2.5 Gbps Ethernet adapter based on the Realtek 8156 chipset to be installed. I could see it enumerated, using the lsusb command, but I couldnā€™t add it as an interface. Installing the kmod-usb-net-rtl8152 driver didnā€™t help.

I am planning to get three more of these adapters and test the throughput via the two USB-C 2.5 Gbps network adapters connected to the Raspberry Pi 4Bā€™s two USB 3 ports and two of the same adapters connected to two Macs - one to the inside and one to the outside. I want to see what the limitation of the Raspberry Pi 4B is when routing

Yeah my exact problem, thats when i got help with the proprietary driver, that worked for me when i created 19.07.3 firmware, i have not yet tried 19.07.4 with the "guide" from the kind @mj82

Well, like I said, for me compiling with the regular drivers worked. I don't know exactly which driver worked, though, but I compiled an image with all network drivers that were available. If someone can direct me as to how to find out which driver is being used for the Realtek 8156 chipset in my OpenWRT image, I will post that information here for others who may be looking into making RTL 8156 work in OpenWRT.

For master branch apply this patch to update the rtl8152 driver and make it compatible with the rtl8156.

wget https://github.com/mj22226/openwrt/commit/0b0a4db265aefaf0b82adbc4f8c2d4e469687840.patch
patch -p 1 -i 0b0a4db265aefaf0b82adbc4f8c2d4e469687840.patch

Hello,
Is this with newest https://www.realtek.com/en/component/zoo/category/network-interface-controllers-10-100-1000m-gigabit-ethernet-usb-3-0-software for 8156B?
How do i "patch" it? During creation of firmware or on a running system?
Thank you

EDIT: 8156B seems to work fine with the .ipk you made first to help me :ok_hand:

I do not know im afraid, im way more newbie then you on this stuff by the sounds of what you have done.
Im getting 2.36Gbit with my 2.5Gbps USB-ethernet adapters with the patched .ipk from @mj82

I am experiencing drop in connection though when stresstesting it for long periods of time.
I want to learn how to create .ipk from drivers, as @mj82 did, but he is maybe busy to teach :frowning:

Which driver version is this patch please? r8152.53.56-2.13.0 is the latest, i would like to use this version, but i must learn how to create .ipk :frowning:

I'm also interested in finding out what those "patches" are that the process above posted by @mj82 downloads, using the wget command.

Thanks.

I've built another image with the patch suggested by @mj82 for Raspberry Pi 4B. Both the rtl8156 chipset (2.5 Gbps USB3 adaptor by Plugable) and the rtl8153 chipset (TP-Link UE300 USB3 adapter) were properly detected and activated as eth1 and eth2 by the patched rtl8152 driver.

The throughput (as measured with iperf3) via the rtl8156 chip is basically the same as via the rtl8153 chip: 939-940 Mbps using TCP. At one point it seemed to me that the variance between each interval (in the iperf3 test) va the rtl8156 chipset was a little higher than the variance via the rtl8153 chipset. However, the difference in variance between the two chipsets was negligible: 1-2 Mbps.

My only remaining question is, How do I continue to patch the master (aka snapshot) images going forward? Can this same patch work with any shanpshot image? If not, how do I create the patch myself?

Thank you.

I also want the answer to this question but i BELIEVE, that the path going forward for this would be:

git clone https://github.com/openwrt/openwrt.git
cd openwrt
git checkout ****v19.07.4 (here is where the version is decided)****
wget https://github.com/mj22226/openwrt/commit/79a572b0d7685d6f44f9a872a2b1aa470ec83225.patch
patch -p 1 -i 79a572b0d7685d6f44f9a872a2b1aa470ec83225.patch
./scripts/feeds update -a
./scripts/feeds install -a
wget -O .config https://downloads.openwrt.org/releases/19.07.4/targets/x86/64/config.buildinfo
make defconfig
make menuconfig -> select packages
make download
make -j `getconf _NPROCESSORS_ONLN` 'IGNORE_ERRORS=n m'

As previously written by @mj82
I have not yet tried this with 19.07.4 but i think this is the way

This is a follow up post on the Realtek 8156 (rtl8156) chipset. Thanks to @mj82, I compiled a snapshot image with a driver that patches the rtl8152 driver with support for Realtek 8156 (rtl8156) chipset. However, there's also another driver that activates the rtl8156 chipset and installs an network interface for it in OpenWRT. This driver is cdc_ncm

> lsusb
> Bus 002 Device 002: ID 0bda:8156 Realtek Semiconductor Corp. 
> Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
> Bus 001 Device 002: ID 2109:3431 VIA Labs, Inc. Hub
> Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
> 
> lsusb -t
> /:  Bus 02.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/4p, 5000M
>     |__ Port 1: Dev 2, If 0, Class=Communications, Driver=, 5000M
>     |__ Port 1: Dev 2, If 1, Class=CDC Data, Driver=, 5000M
>     |__ Port 2: Dev 3, If 0, Class=Communications, Driver=cdc_ncm, 5000M
>     |__ Port 2: Dev 3, If 1, Class=CDC Data, Driver=cdc_ncm, 5000M
> /:  Bus 01.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/1p, 480M
>     |__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/4p, 480M

To support the rtl8156 chipset, I originally configured the following drivers in make menuconfig

kmod-usb-net-cdc-eem
kmod-usb-net-cdc-mbim
kmod-usb-net-cdc-ncm
kmod-usb-net-cdc-ether
kmod-usb-net-cdc-subset

After I compiled an image with these kernel modules and ran this image on the Raspberry Pi 4B, the rtl8156 chipset was installed in OpenWRT as interface usb0 (instead of eth1).

With the cdc-ncm driver I was able to achieve the throughput of about 810 Mbps using iperf3 with TCP, so the benefits of the patched driver posted by @mj82 (which achieved 939-940 Mbps) is clear, but I figured I would post information about an alternative driver that supports rtl8156 in case someone has a problem patching the 8152 driver and must make the 2.5 Gbps Ethernet USB adapter (based on rtl8156 chipset) to work.

This driver did not work for me, which is the reason i started this thread, i dont know why

Which driver didn't work for you?

Using the cdc_ncm.

It recognized the 2.5gbit usb-ethernet device as "usb1" i believe, but as soon as i added it to the LAN interface in openwrt, the console was spammed tens of times per second with connected/disconnected kind of, which is why i wanted to try with the real realtek drivers