Date: Wed, 14 Sep 2011 21:33:15 -0700 From: Julian Elischer <julian@freebsd.org> To: Jon Schipp <jonschipp@gmail.com> Cc: freebsd-performance@freebsd.org Subject: Re: Zero-Copy for packet capture and mbuf question Message-ID: <4E71800B.3080808@freebsd.org> In-Reply-To: <CAB15j_CV4PKKq6_MnYsiDWhnjgffBg1KTQGw%2B3DjSb1vw0fvbg@mail.gmail.com> References: <CAB15j_CV4PKKq6_MnYsiDWhnjgffBg1KTQGw%2B3DjSb1vw0fvbg@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On 9/14/11 6:35 PM, Jon Schipp wrote: > Has anyone used the zero-copy mechanism for an increased performance in > packet capturing? > I'm on FreeBSD 8.2-RELEASE, I was thinking about trying it. It's for a > network monitoring system, it just grabs and dumps all data > from all my network segments. I've noticed improvements by increasing the > bpf buf size and maxbufsize which in turned increased the > initial buffer size for libpcap. I'm dropping less now. > > In 8.2, is turning on zero-copy as simple as changing the value of > net.bpf.zerocopy_enable? > http://node5.blogspot.com/2009/11/very-quick-look-at-zero-copy-bpf-in.html > I can't seem to find much information that shows that it's this simple. > Right now it seems that if I want to use zero-copy for sends > I would have to recompile the kernel with: options ZERO_COPY_SOCKETS > But for receives, which is only what I'm concerned about, it seems that I > just turn it on via sysctl. > > *I see that in 9.0 it will be on by default* > > Another question: I'm assuming all packets get copied to an mbuf from the > NIC and then copied again to the bpf device/bpf buffer. Can anyone verify > this? > I don't think raising my mbufs will help, since a few hundred are free > during peak hours. Will increasing the amount of mbuf clusters (nmbclusters) > only help when you are pushing the threshold i.e. running out? Also, out of > curiousity, is it possible to increase the amount of mbufs as opposed to the > amount of mbuf clusters? if you really want high performance packet capture and you are running one of the supported cards, see Luigi's work at: http://info.iet.unipi.it/~luigi/netmap/ > Any help is appreciated. > Thanks
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4E71800B.3080808>