Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 16 Feb 2016 14:06:39 +0100
From:      Alberto Piai <alberto.piai@gmail.com>
To:        freebsd-questions@freebsd.org
Subject:   USB ethenret performance problem
Message-ID:  <CACgK1c3ag9RAWS8nu-j3x7fTM2T8LarmPL_r7cAtpcGqODVn9w@mail.gmail.com>

next in thread | raw e-mail | index | archive | help
Hello,

I'm running pfSense 2.2.6 in a KVM virtual machine. The pfSense vm has two
NICs:

- LAN: em0, bridged from the vm host
- WAN: ue0, attached directly to the guest using usb passthrough and an
emulated EHCI controller

The LAN interface works as expected.

The WAN is correctly recognized from the guest box, the axe(4) driver takes
over and everything seems to work smoothly:

```
root: dmesg | grep usb
usbus0: controller did not stop
usbus0 on uhci0
usbus1: controller did not stop
usbus1 on uhci1
usbus2: controller did not stop
usbus2 on uhci2
usbus3: EHCI version 1.0
usbus3 on ehci0
usbus0: 12Mbps Full Speed USB v1.0
usbus1: 12Mbps Full Speed USB v1.0
usbus2: 12Mbps Full Speed USB v1.0
usbus3: 480Mbps High Speed USB v2.0
ugen1.1: <Intel> at usbus1
uhub0: <Intel UHCI root HUB, class 9/0, rev 1.00/1.00, addr 1> on usbus1
ugen0.1: <Intel> at usbus0
uhub1: <Intel UHCI root HUB, class 9/0, rev 1.00/1.00, addr 1> on usbus0
ugen2.1: <Intel> at usbus2
uhub2: <Intel UHCI root HUB, class 9/0, rev 1.00/1.00, addr 1> on usbus2
ugen3.1: <Intel> at usbus3
uhub3: <Intel EHCI root HUB, class 9/0, rev 2.00/1.00, addr 1> on usbus3
Root mount waiting for: usbus3 usbus2 usbus1 usbus0
Root mount waiting for: usbus3
Root mount waiting for: usbus3
Root mount waiting for: usbus3
ugen3.2: <vendor 0x05ac> at usbus3
axe0: <vendor 0x05ac product 0x1402, rev 2.00/0.01, addr 2> on usbus3
```

The ethernet interface is correctly attached to the faster controller
(usbus3), and recognized as "100baseTX <full-duplex>".

ue0 gets a public IP from my ISP, and everything seems to work fine,
except...

```
fetch -o /dev/null http://brainlock.eu/speedtest.dat
/dev/null                                       7% of  100 MB  923 kBps
01m55s
```

The top throughput that I can get is ~8 mbps (I've seen about 16 mbps when
using bittorrent, though).

My downstream is 100mbps. Connecting directly from the host, I get almost
the full bandwidth. Booting the exact same VM from a linux live cd, I can
also download at almost 100mbps.

Booting a plain FreeBSD VM from
ftp://ftp.freebsd.org/pub/FreeBSD/releases/VM-IMAGES/10.2-RELEASE/amd64/Lat=
est/
I get the same ~8mbps.

This excludes a problem with the KVM usb passthrough / controller emulation
(linux as a guest works fine), and it excludes a pfSense specific issue
(plain FreeBSD exhibits the same problem).

The guest vm doesn't seem overloaded: while downloading, top shows
~10%system, ~8%interrupt, ~82%idle.

Latency is fine, and netstat doesn't show packets being dropped.


Am I missing something really obvious here?

If not, maybe somebody has ideas on how to further analyze/debug this?

(I'm not a believer in random googling for magic solutions, but before
bothering the mailing list I tried the suggestion that pops up often in the
search results =E2=80=93 disabling tx and rx checksums. Makes no difference=
.)


Thank you!

Alberto



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CACgK1c3ag9RAWS8nu-j3x7fTM2T8LarmPL_r7cAtpcGqODVn9w>