From owner-freebsd-current@FreeBSD.ORG Fri Feb 4 00:25:55 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 DE300106566C for ; Fri, 4 Feb 2011 00:25:55 +0000 (UTC) (envelope-from rysto32@gmail.com) Received: from mail-ew0-f54.google.com (mail-ew0-f54.google.com [209.85.215.54]) by mx1.freebsd.org (Postfix) with ESMTP id 483B88FC20 for ; Fri, 4 Feb 2011 00:25:55 +0000 (UTC) Received: by ewy24 with SMTP id 24so1049170ewy.13 for ; Thu, 03 Feb 2011 16:25:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=1k9um4QChqEcL2cFW2kBaUq5qHpbraqV/l74lwuN60I=; b=qTMYt1jvWNU6U0jJoJbGwllwmTmhuiJWE2RScwAfg5/5nUKq7S/warfb3nub7hVaNr ihi0uf1HaVCvFZnW56CpCV7Ra5ae0Os8TNRg26hSf/a/WAZdQDJ2B114Z9Ig6YSsGzdm XjUwUHPpH31t+Ucv0yh3h1DMHWA1Au1MbpaZE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=f8wxy/m1PJMT3wvtuZ6bzI+a8zpfhFassoY//vqnNcQXQQzgJ1pnyEFtrEiHFbX5Sf ZoBVQpcos/ZKseXFVzK2e6Z0M5lSqYaVF/KWsl3WDEEL8uhFtoLgrgNvOGDhMcYnx0mc 4YOi3QkW6Tj+lOmxWFRh9nLLm/BqEYzrh311M= MIME-Version: 1.0 Received: by 10.213.28.69 with SMTP id l5mr2618191ebc.13.1296779154128; Thu, 03 Feb 2011 16:25:54 -0800 (PST) Received: by 10.213.113.198 with HTTP; Thu, 3 Feb 2011 16:25:54 -0800 (PST) In-Reply-To: <4D4B0682.4000201@freebsd.org> References: <75E1A2A7D185F841A975979B0906BBA6774DD4D902@AVEXMB1.qlogic.org> <4D4B0682.4000201@freebsd.org> Date: Thu, 3 Feb 2011 19:25:54 -0500 Message-ID: From: Ryan Stone To: Julian Elischer Content-Type: text/plain; charset=ISO-8859-1 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: Fri, 04 Feb 2011 00:25:55 -0000 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. 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.