Network interrupt and NAPI in FreeBSD?

Luigi Rizzo rizzo at iet.unipi.it
Sat Mar 7 11:47:36 UTC 2015


On Sat, Mar 7, 2015 at 8:19 AM, Wei Hu <weh at microsoft.com> wrote:
> Many thanks, Luigi! We are measuring the network performance in VM(Hyper-V), using netvsc virtual NIC device and its own driver. The Linux VM also uses the similar virtual device. The driver on both Linux and FreeBSD have TSO/LRO support. With just one network queue, we found the throughput is higher on Linux (around 2.5 - 3 Gbps) than FreeBSD (just around 1.6 Gbps) with 10GB NIC. If INVARIANT option is disabled, FreeBSD can achieve 2 - 2.3 Gbps. The much higher interrupt rate on FreeBSD was observed.
>
> Thanks for the all suggestions. Do you think netmap could help in this case?

netmap per se probably won't help in this case but it is often useful to
stress test the datapath and figure out where bottlenecks are.

In fact you could try and run the netmap test program, pkt-gen (in
tools/tools/netmap)
in emulated mode to see how many pps you can send or receive through
the netvsc interface.
You need to kldload the netmap module (it is already in by default in
recent generic)
and then do a
   pkt-gen -i hn0 -f tx # whatever the name is for the hyperv interface

I don't know what to expect but unoptimized qemu/kvm using the e1000 driver
was as low as 50-100Kpps, and optimized ones went up to 500Kpps and more
even without netmap (i believe FreeBSD's virtio is even faster now).


Obviously you should disable INVARIANT, but the numbers you cite (2-3 Gbps)
are really low, which suggests me that there might some performance problem
in the hypervisor itself.

I also do not see any TSO reference in the source code for the netvsc guest
driver in FreeBSD, so i am not sure whether it is really supported or not.

cheers
luigi


More information about the freebsd-net mailing list