Date: Fri, 6 Mar 2015 07:44:31 +0100 From: Luigi Rizzo <rizzo@iet.unipi.it> To: Wei Hu <weh@microsoft.com> Cc: "freebsd-net@freebsd.org" <freebsd-net@freebsd.org> Subject: Re: Network interrupt and NAPI in FreeBSD? Message-ID: <CA%2BhQ2%2Bi6d_tsqKpkYVh2jnVQaS4TZ5X7zyh_54ZecQDjm%2BFkRA@mail.gmail.com> In-Reply-To: <BY1PR0301MB0902C944E2287E0C6B5D8287BB1C0@BY1PR0301MB0902.namprd03.prod.outlook.com> References: <BY1PR0301MB0902C944E2287E0C6B5D8287BB1C0@BY1PR0301MB0902.namprd03.prod.outlook.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, Mar 6, 2015 at 7:22 AM, Wei Hu <weh@microsoft.com> wrote: > Hi, > > I am working on network driver performance for Hyper-V. I noticed the net= work interrupt rate on FreeBSD is significantly higher than Linux, in the s= ame Hyper-V environment. The iperf test also shows the FreeBSD performance = is not as good as Linux. Linux has NAPI built in which could avoid a lot of= interrupts on a heavy loaded system. I am wondering if FreeBSD also suppor= t NAP in its network stack? > > Also any thought on the network performance in general? i suppose you refer to network performance in a VM, since the factors that impact performance there are different from those on bare metal. The behaviour of course depends a lot on the NIC and backend that you are u= sing so if you could be more specific (e1000 ? virtio ?), that would help. please talk to me (even privately if you prefer) because we have done a lot of work on enhancing performance in a VM which covers qemu, xen, bhyv= e and surely is applicable to HyperV as well. And while the use of netmap/VAL= E gives up to a 5-10x performance boost, there is another factor of 2-5 that can be gained even without netmap. Details at info.iet.unipi.it/~luigi/research.ht= ml On the specific NAPI request: we do not have NAPI but in some NIC drivers the interrupt service routine will spin until it is out of work, which will contribute reducing load. We often rely on interrupt moderation on the NIC to reduce interrupt rates and give work to the ISR in batches. Unfortunately, moderation is often not emulated in hypervisors (e.g. we pushed it into qemu a couple of years ago for the e1000). An alternative mechanism (supported on some of our network drivers, and trivial to add on others) os "device polling", which i introduced some 15 years ago and finds a new meaning in a VM world because it removes device interrupts and polls the NIC on timer interrupts instead. This circumvents the lack of interrupt moderation and gives surprisingly good results. The caveat is that you need a reasonably high HZ value to avoid excessive latency, and the default HZ=3D1000 is sometimes turned town to 100 in a VM. You should probably override that. Depending on the performance tests you run, there might be other things that cause performance differences, such as support of TSO/LRO offloading on the backend (usually with virtio or whatever is your backend), which lets the guest VM ship large 64k segments through the software switch. cheers luigi > > Thanks, > Wei > _______________________________________________ > freebsd-net@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-net > To unsubscribe, send any mail to "freebsd-net-unsubscribe@freebsd.org" --=20 -----------------------------------------+------------------------------- Prof. Luigi RIZZO, rizzo@iet.unipi.it . Dip. di Ing. dell'Informazione http://www.iet.unipi.it/~luigi/ . Universita` di Pisa TEL +39-050-2211611 . via Diotisalvi 2 Mobile +39-338-6809875 . 56122 PISA (Italy) -----------------------------------------+-------------------------------
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CA%2BhQ2%2Bi6d_tsqKpkYVh2jnVQaS4TZ5X7zyh_54ZecQDjm%2BFkRA>