From owner-freebsd-current@FreeBSD.ORG Sat Feb 5 06:38:45 2011 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C96A1106564A for ; Sat, 5 Feb 2011 06:38:45 +0000 (UTC) (envelope-from julian@freebsd.org) Received: from vps1.elischer.org (vps1.elischer.org [204.109.63.16]) by mx1.freebsd.org (Postfix) with ESMTP id 988C28FC17 for ; Sat, 5 Feb 2011 06:38:45 +0000 (UTC) Received: from julian-mac.elischer.org (home-nat.elischer.org [67.100.89.137]) (authenticated bits=0) by vps1.elischer.org (8.14.4/8.14.4) with ESMTP id p156cgAl033577 (version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Fri, 4 Feb 2011 22:38:44 -0800 (PST) (envelope-from julian@freebsd.org) Message-ID: <4D4CF075.4090400@freebsd.org> Date: Fri, 04 Feb 2011 22:38:45 -0800 From: Julian Elischer User-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X 10.4; en-US; rv:1.9.2.13) Gecko/20101207 Thunderbird/3.1.7 MIME-Version: 1.0 To: Ryan Stone References: <75E1A2A7D185F841A975979B0906BBA6774DD4D902@AVEXMB1.qlogic.org> <4D4B0682.4000201@freebsd.org> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: "freebsd-current@freebsd.org" , David Somayajulu Subject: Re: Ethernet Drivers: Question on Sending Received Packets to the FreeBSD Network Stack X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Feb 2011 06:38:45 -0000 On 2/3/11 4:25 PM, Ryan Stone wrote: > On Thu, Feb 3, 2011 at 2:48 PM, Julian Elischer wrote: >> I had never considered passing a set of packets, but after my initial >> scoffing thoughts I realized that it would actually be a very interesting >> thought experiment to see if the ability to do that would be advantageous in >> any way. I tmay be a way to reduce some sorts of >> overhead if using interrupt mitigation. > At $WORK we've put a rather considerable amount of effort into writing > what I'd call a poor-man's version of netgraph. Originally, in fact, > our application was entirely netgraph-based back when we were running > on FreeBSD 4. What we ended up implementing was the minimal set of > netgraph features our application needed, optimized for performance. > Passing packets around in batches was one of the performance > optimizations. There are some pretty big wins with that approach: > amortization of locking costs and other overhead, better cache > locality and it's easier to prefetch the data from packet n while > processing packet n-1. That's actually one of the ways that we envisioned netgraph being used.. As a prototyping tool that would eventually be replaced by the same node code hooked together be a purpose-designed application. However we did too good a job in implementing it so that for a large percentage of the tasks the prototyping framework actually does well enough. The other use was for low speed L2 plumbing for WAN networking. > If I get some time I'll see if I can get something by the way of hard > numbers as to the advantages on our application. >