From owner-freebsd-net@FreeBSD.ORG Wed Sep 26 17:51:26 2007 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3360D16A418; Wed, 26 Sep 2007 17:51:26 +0000 (UTC) (envelope-from scottl@samsco.org) Received: from pooker.samsco.org (pooker.samsco.org [168.103.85.57]) by mx1.freebsd.org (Postfix) with ESMTP id 9FD0813C458; Wed, 26 Sep 2007 17:51:25 +0000 (UTC) (envelope-from scottl@samsco.org) Received: from scoo-longs-computer.local (wireless.prattprop.com [209.97.224.24] (may be forged)) (authenticated bits=0) by pooker.samsco.org (8.13.8/8.13.8) with ESMTP id l8QHp52N063752; Wed, 26 Sep 2007 11:51:12 -0600 (MDT) (envelope-from scottl@samsco.org) Message-ID: <46FA9C04.9060603@samsco.org> Date: Wed, 26 Sep 2007 11:51:00 -0600 From: Scott Long User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US; rv:1.8.1.6) Gecko/20070802 SeaMonkey/1.1.4 MIME-Version: 1.0 To: Hans Petter Selasky References: <200709260131.49156.hselasky@c2i.net> In-Reply-To: <200709260131.49156.hselasky@c2i.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-2.0.2 (pooker.samsco.org [168.103.85.57]); Wed, 26 Sep 2007 11:51:12 -0600 (MDT) X-Spam-Status: No, score=0.0 required=5.5 tests=none autolearn=failed version=3.1.8 X-Spam-Checker-Version: SpamAssassin 3.1.8 (2007-02-13) on pooker.samsco.org Cc: freebsd-scsi@freebsd.org, freebsd-usb@freebsd.org, freebsd-net@freebsd.org Subject: Re: Request for feedback on common data backstore in the kernel X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Sep 2007 17:51:26 -0000 Hans Petter Selasky wrote: > Hi, > > Please keep me CC'ed, hence I'm not on all these lists. > > In the kernel we currently have two different data backstores: > > struct mbuf > > and > > struct buf > > These two backstores serve two different device types. "mbufs" are for network > devices and "buf" is for disk devices. > > Problem: > > The current backstores are loaded into DMA by using the BUS-DMA framework. > This appears not to be too fast according to Kip Macy. See: > > http://perforce.freebsd.org/chv.cgi?CH=126455 > Busdma isn't fast enough for 1Gb and 10Gb network drivers that are trying to max out their packet rates. It's still fine for storage drivers and other slow/medium speed device drivers, like USB and Firewire. I am working on techniques to make the API easier to use and the implementation fast enough for the aforementioned devices. > Some ideas I have: > > When a buffer is out out of range for a hardware device and a data-copy is > needed I want to simply copy that data in smaller parts to/from a > pre-allocated bounce buffer. I want to avoid allocating this buffer > when "bus_dmamap_load()" is called. I think you've missed the point of having architecture portable drivers. John-Mark describes this further. It also makes little sense to push the responsibility for handling bounce buffers out of a central subsystem and back into every driver. Scott