RTL8153 USB NIC help.

cchorrell

New Member

Thanks: 1
Messages: 13

#1
Hello all,

So I have been running FreeBSD and OPNsense as a VM's for some time now but due to changes I need to make internally I decided to repurpose an old portable to be the ONSense box, now I know this isn't the OPNsense forum but I believe my issue and question is more of a base system thing but I have posted this over at their forum as well.
The portable has one built-in NIC that was properly identified and is working fine, but my USB RTL8153 has been identified as ue0 and it appears it cannot identify the media type. I believe this to be the cause of the card acting as a 10Mbit NIC. After some research I believe the correct driver to be ure, the FreeBSD man page states this is for the RTL8152, but the same driver in the OpenBSD man shows it is for both the RTL8152/RTL8153. Both man pages shows the author of the driver to be the same person.

My issue right now is that after several days of internet research I am at a lose as how best to make OPNsense or FreeBSD use the ure driver for this NIC. The farthest I have gotten is to use 'kldload if_ure' in the shell and I would appreciate any advise or resources that I could be pointed to so I can remedy this.

Thank you all for your time.
 
OP
OP
C

cchorrell

New Member

Thanks: 1
Messages: 13

#2
Update on the above. I now have the 'ure' driver loading as a kernel module on boot. Now on to figure out how to force the hardware to use the driver, but so far I have not found any resources online to help, or at least ones that I understand.
 

SirDice

Administrator
Staff member
Administrator
Moderator

Thanks: 6,329
Messages: 27,494

#3
Now on to figure out how to force the hardware to use the driver
You can't force hardware to use a certain driver. The driver detects the hardware or not, not the other way around. This detection is mostly based on IDs read from the chipset (see the output from pciconf -lv for example). Realtek seems to have a nasty habit of changing their chip's designs without changing the IDs.
 
OP
OP
C

cchorrell

New Member

Thanks: 1
Messages: 13

#4
You can't force hardware to use a certain driver. The driver detects the hardware or not, not the other way around. This detection is mostly based on IDs read from the chipset (see the output from pciconf -lv for example). Realtek seems to have a nasty habit of changing their chip's designs without changing the IDs.
Ok, well in my case I am connected to a USB controller on the PCI and the card appears as

Code:
ugen3.2: <Realtek USB 101001000 LAN> at usbus3, cfg=1 md=HOST spd=HIGH (480Mbps) pwr=ON (200mA)
The system then identified it as at ue0, but I could not find a man page for the ue driver.

Code:
ue0: <USB Ethernet> on cdce0
ue0: Ethernet address: a0:ce:c8:15:cd:2c
I identified the adapter as a RTL8153 after that and found out about the ure driver by searching man pages. So I guess my next question is how could I go about having the ure driver detect this card as opposed to the ue driver? Or is there no way to do that without rewriting both drivers?

Thanks for your reply.
 

Phishfry

Son of Beastie

Thanks: 872
Messages: 2,756

#5
There is no need to load any driver. You have the interface ready to use.
You will need to declare if you want to assign a static IP to it or use DHCP in /etc/rc.conf
The setting for DHCP would look like this:
ifconfig_ue0="DHCP"
For a static IP you could use something like this:
ifconfig_ue0="inet 192.168.11.111 netmask 255.255.255.0"

Because this is an USB interface you might need to add a boot delay to allow for the interface to come up.
Many USB interfaces come up late, So you might need to use netwait.
 
OP
OP
C

cchorrell

New Member

Thanks: 1
Messages: 13

#6
There is no need to load any driver. You have the interface ready to use.
You will need to declare if you want to assign a static IP to it or use DHCP in /etc/rc.conf
The setting for DHCP would look like this:
ifconfig_ue0="DHCP"
For a static IP you could use something like this:
ifconfig_ue0="inet 192.168.11.111 netmask 255.255.255.0"

Because this is an USB interface you might need to add a boot delay to allow for the interface to come up.
Many USB interfaces come up late, So you might need to use netwait.

I have the ue0 confided and passing traffic, the issue with the ue driver is that it is only running at 10mbit/s. The hardware, RTL8153 is 1Gbit/s, and unlike all other NIC's I have configured in any other flavor of UNIX or Linux it does not report anything for media.

For example, the onboard NVIDIA NIC shows media and active.
Code:
nfe0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
    options=82008<VLAN_MTU,WOL_MAGIC,LINKSTATE>
    ether 58:b0:35:b3:21:72
    hwaddr 58:b0:35:b3:21:72
    inet 192.168.1.1 netmask 0xffffff00 broadcast 192.168.1.255
    inet6 fe80::1:1%nfe0 prefixlen 64 scopeid 0x1
    nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
    media: Ethernet autoselect (1000baseT <full-duplex>)
    status: active
but the RTL8153 doesn't report either, although it can pass traffic, but again at only 10Mbit
Code:
ue0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
    ether a0:ce:c8:15:cd:2c
    hwaddr a0:ce:c8:15:cd:2c
    inet6 fe80::a2ce:c8ff:fe15:cd2c%ue0 prefixlen 64 scopeid 0x6
    inet 172.16.42.50 netmask 0xffffff00 broadcast 172.16.42.255
    nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
Normally I would have just looked up the man page for the ue driver but there doesn't seem to be one. The ure driver shows it is for a RTL8152 in FreeBSD, but the OpenBSD man page for the same drivers says it supports both RTL8152 and RTL8153. Both the FreeBSD and OpenBSD man page credits the same author, so my indention was to figure out a way for the ure driver to recognize the hardware so I could test. Ultimately I do not care which driver as long as it is one that I can max out the USB bus for this NIC.
 
OP
OP
C

cchorrell

New Member

Thanks: 1
Messages: 13

#7
Where did you find that information?
How about you post the output of ifconfig.
I have a iperf3 server/client running on both sides of the interface is how I determined the speed, not that it is actually reporting the media type. In my post above is the ifconfig output of both the onboard NIC (nfe0) and the RTL8153 USB NIC (ue0). I'll post it again here.

Code:
# ifconfig
nfe0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
    options=82008<VLAN_MTU,WOL_MAGIC,LINKSTATE>
    ether 58:b0:35:b3:21:72
    hwaddr 58:b0:35:b3:21:72
    inet 192.168.1.1 netmask 0xffffff00 broadcast 192.168.1.255
    inet6 fe80::1:1%nfe0 prefixlen 64 scopeid 0x1
    nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
    media: Ethernet autoselect (1000baseT <full-duplex>)
    status: active

ue0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
    ether a0:ce:c8:15:cd:2c
    hwaddr a0:ce:c8:15:cd:2c
    inet6 fe80::a2ce:c8ff:fe15:cd2c%ue0 prefixlen 64 scopeid 0x6
    inet 172.16.42.50 netmask 0xffffff00 broadcast 172.16.42.255
    nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
 
OP
OP
C

cchorrell

New Member

Thanks: 1
Messages: 13

#8
Something is up. I see no status: and it seems strange to me that the ipv6 line is before inet
Yeah I have never had this happen with a NIC, USB or PCI connected, on any flavor or *NIX. With no media or status being reported it is strange. Also I have never had a NIC load with a driver that has no man page. As for the ipv6 that shows up ahead of the ipv4 address for me anytime I configure inet6 for local-link.
 
OP
OP
C

cchorrell

New Member

Thanks: 1
Messages: 13

#9
Is this a dhcp lease or are you using static IP here?
Please post your /etc/rc.conf

You may just need to add netwait.
How does it act when you hot plug it -versus bootup with the device?
Hot plugging identifies the card the same,
Code:
ue0: <USB Ethernet> on cdce0
ue0: Ethernet address: a0:ce:c8:15:cd:2c
I take it that likely means that netwait would have no change?

I can post my entire rc.conf if needed but it is quite large.
 
OP
OP
C

cchorrell

New Member

Thanks: 1
Messages: 13

#10
ue0 is sort of a master interface. You might find it on USB cellular modems or tethered cell phones.
It is different than the pciconf interfaces.
It does still use the VID and PID like SirDice was mentioning. Its just that PCI devices use a different file for their ID's.
So it is a different subsystem.

I know we are several replies in, but to remind I am running OPNsense, based on FreeBSD-11.1. I had posted this same thing over in their forums but so far they are just lurking it. I then posted the same over here since OPNsense tries to maintain as much as FreeBSD as possible.
 
OP
OP
C

cchorrell

New Member

Thanks: 1
Messages: 13

#12
If your ifconfig output looks the same then yes, save your time.
Post the full device details:
usbconfig -u 3 -a 2 dump_device_desc
As requested,
Code:
# usbconfig -u 3 -a 2 dump_device_desc
ugen3.2: <Realtek USB 101001000 LAN> at usbus3, cfg=1 md=HOST spd=HIGH (480Mbps) pwr=ON (200mA)

  bLength = 0x0012
  bDescriptorType = 0x0001
  bcdUSB = 0x0210
  bDeviceClass = 0x0000  <Probed by interface class>
  bDeviceSubClass = 0x0000
  bDeviceProtocol = 0x0000
  bMaxPacketSize0 = 0x0040
  idVendor = 0x0bda
  idProduct = 0x8153
  bcdDevice = 0x3000
  iManufacturer = 0x0001  <Realtek>
  iProduct = 0x0002  <USB 10/100/1000 LAN>
  iSerialNumber = 0x0006  <000001>
  bNumConfigurations = 0x0002
 
OP
OP
C

cchorrell

New Member

Thanks: 1
Messages: 13

#13
Well HPS is the USB guru you would have to bug, if you didn't come here or OPN forum and their one man band.
So I see it as trying to solve your problem before bugging a developer.
It is against the forum rules but the guts of OPN are nearly identical in this case.

I am no USB expert and have run the course here. The VID and PID is supported in usbdevs.
Thank you Phishfry for your assistance, I really appreciate it.

I was researching this as much as possible first and seeing the low activity on the OPN forums, I hesitantly posted here since I had a feeling it wasn't strictly OPN related.

Forgive my ignorance, but is HPS the username of the USB guru on these forums or is it an acronym for a group?
 

Phishfry

Son of Beastie

Thanks: 872
Messages: 2,756

#14
bNumConfigurations = 0x0002
This output is the only thing i see that is unusual.
Usually you only see number of configurations on cellular modems. They allow for 2 configurations.

You could file a PR with the details. It might help the next guy with the problem.
Very generally here, Realtek is considered bad.
They have RT8111 chips that are OK and some newer ones that won't work well at all. Especially when loaded.
Intel interfaces on the other hand have always worked very well.

So there is no surprise that you are getting bad results with a Realtek device.
There are other gigabit USB ethernet devices that do work OK.
 
OP
OP
C

cchorrell

New Member

Thanks: 1
Messages: 13

#15
This output is the only thing i see that is unusual.
Usually you only see number of configurations on cellular modems. They allow for 2 configurations.

You could file a PR with the details. It might help the next guy with the problem.
Very generally here, Realtek is considered bad.
They have RT8111 chips that are OK and some newer ones that won't work well at all. Especially when loaded.
Intel interfaces on the other hand have always worked very well.

So there is no surprise that you are getting bad results with a Realtek device.
There are other gigabit USB ethernet devices that do work OK.

Realtek wasn't my first choice but after trying with a ASIX USB NIC and having poor performance in OPN, FreeBSD, and Debian 9 I decided to order the Realtek to test with. But it would seem I am running out of USB NIC's to try with. I even went so far as testing both USB NIC's in macOS and Win10 and the worked flawlessly, but when running OPN or FreeBSD as VM's using VirtualBox and bridging to the USB I could only max out at around 150mbit/s and it wasn't consistent.

I think I may file a PR tomorrow after I get some sleep and if it isn't considered inappropriate I may DM hps@ for assistance.

Thank you again for your help.
 

Phishfry

Son of Beastie

Thanks: 872
Messages: 2,756

#18
I am not sure it will work for you, but it is the only thing I see that looks related.
The other user had no working device so I am unsure this is related.
Something is in the other configuration, I would think.
My general thought is there is ipv6 profile and a ipv4 profile, it is defaulting to ipv6 profile.
 
OP
OP
C

cchorrell

New Member

Thanks: 1
Messages: 13

#19
I am not sure it will work for you, but it is the only thing I see that looks related.
The other user had no working device so I am unsure this is related.
Something is in the other configuration, I would think.
My general thought is there is ipv6 profile and a ipv4 profile, it is defaulting to ipv6 profile.
Well you are spot on, after reading though everything over there the good news is they are talking about the same USB NIC as mine but the bad news is theirs was booting up as configuration 0 and they needed to get it to configuration 1. Mine is already booting that way. I would also be interested to know if they were running into the same issue I am after they solved their first problem.

I will looking to this idea of ipv6 profile vs ipv4 profile and I think I will also test out a fresh vanilla 11.1 install and maybe even try 12 or TrueOS to see if the same issue persist across them all.
 
Top