USB 3.1 Gen2 2.5Gbps Ethernet Adapter

sirius98

Cadet
Joined
Jan 25, 2023
Messages
6
Has anyone successfully tested any 2.5Gbps USB 3.1 Gen2 or 3.2 Gen 1 network adapters on TruneNas?
I have such this network adapters based on Realtek 8156 and unfortunately instead of 2.5Gbps they work only in 100Mbps mode.
Yes, yes I know that they are not on supported list. They run at full speed under Windows.
I use for FreeNas HP ProDesk 600 G4 USFF with connected QNAP TL-D800C 8HDD 3,5" bay which works perfect but I need to make faster internal network speed because all my main network infrastructure works on 10Gbps.
20230112_204254.jpg
 

jgreco

Resident Grinch
Joined
May 29, 2011
Messages
18,680
I see that Realtek RTL8156 USB GBE/2.5G Ethernet Family Controller is on supported list 13.1R https://www.freebsd.org/releases/13.1R/hardware/#support but I don't know why it works only with 100Mbps speed.

FreeBSD's hardware compatibility list is much more generous than that of TrueNAS, which is focused on server-grade hardware. In many cases, devices that are compatible with FreeBSD may also be "compatible" with TrueNAS, but not really supported. The 2.5G stuff is basically a trainwreck, and your system also looks problematic in other ways. Using a USB-attached disk shelf is a terrible idea, as outlined in @Arwen 's excellent resource:



I need to make faster internal network speed because all my main network infrastructure works on 10Gbps.

Perhaps you should consider a platform which is properly designed, and then move on to adding a 10Gbps card recommended in the 10 Gig Networking Primer.


 

sirius98

Cadet
Joined
Jan 25, 2023
Messages
6
Sorry I don't explained one thing.
My main network NAS device is QNAP TVS-h874 connected with TL-D800S via SFF-8644 but because I had to send this main unit TVS-h874 to compain so for month or a little longer I don't have nothing to make any backup of data. I have only 24h to do this. So I connected this PC with TL-D800C and it will works quite good for 1-2 months. In future I planned that it will work only in such this ocasions.
Thanks for this links. Starting reading.
 

sirius98

Cadet
Joined
Jan 25, 2023
Messages
6
No but supporting Realtek RTL8156 USB GBE/2.5G will be in next version True Nas Core based on FreeBSD 13.1. I'm waiting for this.
My configuration based on HP ProDesk 600 G4 USFF connected via USB-C with QNAP TL-D800C 8HDD 3,5" works perfect last months esspecially after last update True Nas Core when finally stared working Zabbix.
It's backup of backup so I not need sophisticated solutions.
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
Realtek RTL8156 USB GBE/2.5G will be in next version True Nas Core based on FreeBSD 13.1. I'm waiting for this.
We're already on 13.1...
uname -a
FreeBSD truenas 13.1-RELEASE-p7 FreeBSD 13.1-RELEASE-p7 n245418-79e75956dbb TRUENAS amd64
 

dafonehacker

Cadet
Joined
Mar 21, 2023
Messages
4
No but supporting Realtek RTL8156 USB GBE/2.5G will be in next version True Nas Core based on FreeBSD 13.1. I'm waiting for this.
My configuration based on HP ProDesk 600 G4 USFF connected via USB-C with QNAP TL-D800C 8HDD 3,5" works perfect last months esspecially after last update True Nas Core when finally stared working Zabbix.
It's backup of backup so I not need sophisticated solutions.
I have good news for you

After a full day of tinkering, I finally got it working reliably

I observed that Truenas\freebsd always tries to use the if_cdce driver for this NIC. However, the if_ure driver that is also included does seem to support it well.

To work around this, I renamed /boot/kernel/if_cdce.ko to /boot/kernel/if_cdce.ko.inactive , preventing it from loading (kldunload did NOT seem to help here)

After doing this, you need to reboot to have effect. The network connection does not come up on boot however, to fix that, you need to reset the usb device (in my case 'usbconfig -d ugen0.4 reset' -> type usbconfig in the shell to find out the identifier on your system.

1679423853433.png




To fix the NIC not coming up on boot, and because I'm wary that a truenas upgrade will re-enable the if_cdce.ko driver, I ended up with the following:
------------------------------------------------------------------------------------------------------------------------------------------------------

In the Truenas GUI under Tasks->Init/shutdown scripts:

The following script that runs at PREINIT:
Code:
#!/bin/sh

# disable if_cdce by appending .inactive to the filename
mv /boot/kernel/if_cdce.ko /boot/kernel/if_cdce.ko.inactive 2>&1 /dev/null

#Reset usb NIC
usbconfig -d ugen0.4 reset

#sleep 10 seconds
sleep 10

(Disables the if_cdce driver and resets the NIC-> if the if_cdce driver was present however it will already have been loaded, however that should only happen on an upgrade and not 100% sure it will)

The following command that runs at SHUTDOWN:
Code:
mv /boot/kernel/if_cdce.ko /boot/kernel/if_cdce.ko.inactive

(Disable the if_cdce driver again should it have reappeared for some reason)
------------------------------------------------------------------------------------------------------------------------------------------------------
I'm hoping that by doing the disable both on boot and shutdown, I won't have to take any special actions during an upgrade. Like I understand it, the worst that could happen is that I need to reboot the server once more after an upgrade. -> if I remember I'll update here with what happened when the next upgrade releases.

The specific adapter I'm using is the Cable Matters 202095, which uses an RTL8156 chipset (at least from what I can find)

Proceed at your own risk, YMMV
 

broozar

Dabbler
Joined
Mar 2, 2023
Messages
15
Hi, thanks for you efforts working on this issue. I am having a similar problem, my Sabrent 2.5G USB 3 adapter is only getting 27 MiB/s. I tried your suggestions disabling if_cdce, but as soon as I do that, the interface disappears for good (only the onboard 1gbe chip is found). If you or anyone else has made progress on the issue, please let me know.
 

jgreco

Resident Grinch
Joined
May 29, 2011
Messages
18,680
Hi, thanks for you efforts working on this issue. I am having a similar problem, my Sabrent 2.5G USB 3 adapter is only getting 27 MiB/s. I tried your suggestions disabling if_cdce, but as soon as I do that, the interface disappears for good (only the onboard 1gbe chip is found). If you or anyone else has made progress on the issue, please let me know.

Please do not hijack someone else's thread. If your device disappears when if_cdce is disabled, and isn't picked up by if_ure like the OP's, then it seems likely that you have a different device. Please post useful details about your hardware such as what silicon is being used, what the USB vendor and product ID's are, etc. This allows future posters to follow a line of debugging/reasoning/etc that isn't fragmented into several different brands of USB adapters interspersed into a single thread.

Also a reminder that USB adapters are a terrible idea and are not supported. Buy a proper PCIe card, and if your PC isn't big enough to hold one, perhaps you need a suitable system for running TrueNAS.
 

broozar

Dabbler
Joined
Mar 2, 2023
Messages
15
Sure, sorry. Details on the Sabrent are hard to come by, but from what I can find on an STH review (https://www.servethehome.com/sabrent-2-5gbe-usb-network-adapter-review-nt-s25g/), it appears to be the same RTL8156 - googling that chip is how I ended up in this thread. I am running TrueNas 13.1-release-p7, the device is recognized as ue0, if_cdce is loaded automatically. The Media Subtype is listed as auto negotiated, but no speed is given. File transfers top out at about 27 MiB/s, which is faster than 100 Mbit, unlike OP sirius98 reported. if_ure can be loaded manually. if_cdce unloading has no effect, just as reported. Renaming the if_cdce.ko works, but then the adapter disappears.

PS: I already have a "proper" TrueNas server that works well with a "real" NIC etc. What I am building now is just a fun project, a challenge to myself, the cheapest and smallest NAS box with off-the-shelf ebay parts, to see how much of a cheaper, smaller and yet faster machine I can build compared to a 6-bay Synology. Unfortunately, my only PCIe slot is taken up by the LSI HBA, so there's just no slot left for a 2.5g or better NIC.
 

jgreco

Resident Grinch
Joined
May 29, 2011
Messages
18,680
Sure, sorry.

No need to be sorry, but you are ultimately the one in front of the keyboard and gear, so we are somewhat reliant on what you write. If we prompt you for stuff, it's just because that's what we want to know.

Can you post the output of "usbconfig" (see what @dafonehacker did above in the black screen capture)? It is very hard to tell what drivers SHOULD have attached if we do not have those vendor and product hexadecimal numbers.

I'm also curious to know what happens if you manually try to set speed/duplex from the command line.

You can see the state of all interfaces with "ifconfig -a" at the command line.

You can see what the card has currently set up with "ifconfig xx0" (replace xx0 with whatever weird abbreviation like "ue0" has been assigned)

Code:
# ifconfig em0
em0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=9b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM>
        media: Ethernet autoselect (1000baseT <full-duplex>)
        status: active


is for a generic Intel. You can use "ifconfig xx0 media 1000baseT mediaopt full-duplex" to set speed and duplex.
 

broozar

Dabbler
Joined
Mar 2, 2023
Messages
15
Thanks. Here's some of the output.

usbconfig:
Code:
ugen2.2: <Realtek USB 10/100/1G/2.6G LAN> at usbus2, cfg=2 md=HOST spd=SUPER (5.0Gbps) pwr=ON (64mA)


ifconfig:
Code:
ue0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
    options=80008<VLAN_MTU,LINKSTATE>
    ether [redacted]
    inet [redacted] netmask 0xffffff00 broadcast [redacted]
    media: Ethernet autoselect
    status: active
    nd6 options=9<PERFORMNUD,IFDISABLED>


ifconfig ue0 media 1000baseT mediaopt full-duplex:
Code:
ifconfig: SIOCSIFMEDIA (media): Device not configured


dmesg | grep ue0:
Code:
ue0: <USB Ethernet> on cdce0
ue0: Ethernet address: [redacted]
ue0: link state changed to DOWN
ue0: link state changed to UP
 

artlessknave

Wizard
Joined
Oct 29, 2016
Messages
1,506
After a full day of tinkering, I finally got it working reliably
if you had to tinker with it to get it working, then it is not working reliably; you tinkered with it to get it working, and it could stop at any time.
 

artlessknave

Wizard
Joined
Oct 29, 2016
Messages
1,506

silvioslim

Dabbler
Joined
Dec 2, 2021
Messages
15
Ok Houston we have got a problem: after a while the USB Adapter is shutting down.
Is there a power management somewhere?

I try already a PCI adapter but Truenas it doesn't recognize it...
 
Top