15

I bought a small gigabit ethernet USB adapter, which works fine OOTB in a Raspberry Pi 3, but only at 100mbits/s. How can I make it run at full speed?

ethtool:

# ethtool eth1
Settings for eth1:
Supported ports: [ TP MII ]
Supported link modes:   10baseT/Half 10baseT/Full
                        100baseT/Half 100baseT/Full
                        1000baseT/Half 1000baseT/Full
Supported pause frame use: No
Supports auto-negotiation: Yes
Advertised link modes:  10baseT/Half 10baseT/Full
                        100baseT/Half 100baseT/Full
Advertised pause frame use: Symmetric Receive-only
Advertised auto-negotiation: Yes
Link partner advertised link modes:  10baseT/Half 10baseT/Full
                                     100baseT/Half 100baseT/Full
Link partner advertised pause frame use: Symmetric
Link partner advertised auto-negotiation: Yes
Speed: 100Mb/s
Duplex: Full
Port: MII
PHYAD: 32
Transceiver: internal
Auto-negotiation: on
Supports Wake-on: pumbg
Wake-on: g
Current message level: 0x00007fff (32767)
               drv probe link timer ifdown ifup rx_err tx_err tx_queued intr tx_done rx_status pktdata hw wol
Link detected: yes

lshw:

*-network:2
   description: Ethernet interface
   physical id: 4
   logical name: eth1
   serial: 
   size: 100Mbit/s
   capacity: 1Gbit/s
   capabilities: ethernet physical tp mii 10bt 10bt-fd 100bt 100bt-fd 1000bt 1000bt-fd autonegotiation
   configuration: autonegotiation=on broadcast=yes driver=r8152 driverversion=v1.08.8 duplex=full ip=192.168.1.5 link=yes multicast=yes port=MII speed=100Mbit/s

lsmod

Module                  Size  Used by
rpcsec_gss_krb5        23752  0
brcmfmac              222874  0
brcmutil                9092  1 brcmfmac
cfg80211              543027  1 brcmfmac
cdc_ether               6354  0
rfkill                 20851  1 cfg80211
r8152                  37460  0
bcm2835_gpiomem         3940  0
uio_pdrv_genirq         3923  0
uio                    10204  1 uio_pdrv_genirq
fixed                   3285  0
snd_bcm2835            24427  0
snd_pcm                98501  1 snd_bcm2835
snd_timer              23968  1 snd_pcm
snd                    70032  3 snd_timer,snd_bcm2835,snd_pcm
joydev                  9988  0
uinput                  9125  0
ipv6                  408971  32

First think I noticed is that 1000 is indeed supported, but not advertised. Maybe because the fallback from USB 3 to USB 2 falls back to 100mbits/s as well?

I tried

# ethtool -s eth1 speed 1000 duplex full

But no luck.

The adapter brand is "rankie" (easy to find at amazon).

Also, the adapter is connected to a gigabit switch. My NAS is connected to that switch and is running at 1000mbits/s without issues, so I doubt that is the issue.

Finally, the Ethernet adapter is the only USB device connected to the PI, so even if I don't expect a full 1000mbps, I was expecting to get somewhere to the USB2.0 speed

santiagozky
  • 479
  • 1
  • 4
  • 9

2 Answers2

29

Answering my own question, the problem was simpler than I thought.

Turns out I was using a cheap cable I had laying around at home. It doesn't even has the usual 8 wires, just 4 of them, which makes it incapable of being used for Gigabit Ethernet connections (Fast ethernet needs only 4 wires while Gigabit needs all 8 of them).

I switched to a proper Cat 5e cable and that solved the issue. Now ethtool reports 1000mbps and using iperf I get over 300mbps!

santiagozky
  • 479
  • 1
  • 4
  • 9
8

The USB2 bus support speeds far higher than 100 Mbps, so you should indeed expect to see better speeds. USB2 network adapters cap out at 100 Mbps (IME), but backward-compatible USB3 gigabit adapters can use the capabilities of the USB2 bus to achieve higher than 100 Mbps.

I did similar testing using dual USB adapters on a RPi 3B. Your network switch may not be recognizing the speed switch made with ethtool. Try physically disconnecting and reconnecting the cable to force a capability re-negotiation with the switch after changing the port speed on the RPi. If that works, you need to figure out how to force the speed switch on initial connect.

Unfortunately, I screwed up when testing, and neglected to modify the port speeds on the RPi. I intend to repeat testing after reconfiguring speeds using ethtool in the future. As a data point, I did the same testing on an Asus Tinkerboard which also only provides USB2 ports alongside a GBE port. With a USB3 GBE adapter plugged into the USB2 port and connecting to a 3rd device over the GBE port, I was able to get 308 Mbps throughput in a routed configuration. If nothing else, this shows that the USB2 bus can support > 100 Mbps.

Even without setting the port speed manually, my throughput speeds using 2 USB3 GBE adapters on a RPi 3B improved from ~94 Mbps to ~113 Mbps, a roughly 20% gain.

bobstro
  • 3,978
  • 15
  • 27