From owner-freebsd-hackers@FreeBSD.ORG Fri Oct 6 16:56:56 2006 Return-Path: X-Original-To: freebsd-hackers@freebsd.org Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C08B416A416; Fri, 6 Oct 2006 16:56:56 +0000 (UTC) (envelope-from sam@errno.com) Received: from ebb.errno.com (ebb.errno.com [69.12.149.25]) by mx1.FreeBSD.org (Postfix) with ESMTP id B4DE443D53; Fri, 6 Oct 2006 16:56:53 +0000 (GMT) (envelope-from sam@errno.com) Received: from [10.0.0.248] (trouble.errno.com [10.0.0.248]) (authenticated bits=0) by ebb.errno.com (8.13.6/8.12.6) with ESMTP id k96GuqUi055635 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 6 Oct 2006 09:56:52 -0700 (PDT) (envelope-from sam@errno.com) Message-ID: <45268AD4.5080901@errno.com> Date: Fri, 06 Oct 2006 09:56:52 -0700 From: Sam Leffler User-Agent: Thunderbird 1.5.0.4 (X11/20060724) MIME-Version: 1.0 To: Robert Watson References: <20061005151536.GA25283@devil.rrze.uni-erlangen.de> <20061006115301.T43229@fledge.watson.org> In-Reply-To: <20061006115301.T43229@fledge.watson.org> X-Enigmail-Version: 0.94.0.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: freebsd-hackers@freebsd.org, Jochen Kaiser , csjp@freebsd.org Subject: Re: libpcap perf improvement? latest ideas? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Oct 2006 16:56:56 -0000 Robert Watson wrote: > On Thu, 5 Oct 2006, Jochen Kaiser wrote: > >> after reading a german master thesis [1] (dated 12/2004) about pcap >> performance (with comparison of linux and freebsd) I searched freebsd >> resources for pcap improvements. Unofortunately I did not find any >> improvements like PF_RING and/or efforts for reducing the number of >> copy operations from device to user space. >> >> Maybe I think too simple because I don't know how SMP fine locks are >> influencing this (maybe it is very complex to improve that when you >> want to avoid side effects.). >> >> Or maybe it is not important at all, because real applications use DAG >> boards? >> >> I would appreciate any discussion here. >> >> greetings, >> Jochen >> >> [1] www.net.in.tum.de/teaching/projects/docs/schneider_SEP_slides2.ps >> [2] www.endace.com > > Quite a bit of work has been done on zero-copy for BPF, but none of it > really commitable. Christian Peron (CC'd) and I have been talking about > doing something that is commitable, but some of the details (such as > memory ownership) are still very much up in the air. PF_RING takes an > interesting approach, and one we should look at, but we'd also like to > keep all the benefits of BPF rather than discard them, so need to > consider how best to apply elements of the approach in our context. I'd > like to see something like this happen for FreeBSD 7.0, with a possible > backport if it goes really well. :-) Note that bpf on bsd has historically had significantly better capture performance than equivalent linux facilities. Many people using freebsd have been misled by the default setting of the kernel buffers which are intentionally low: tubby% sysctl net.bpf net.bpf.bufsize: 4096 net.bpf.maxbufsize: 524288 If you up net.bpf.bufsize you can reliably capture most traffic w/ a reasonable nic. OTOH the current bpf code does have excessive locking overhead that could be improved and using alternate schemes that do zero-copy are required for 10g nets. Sam