From owner-freebsd-arch@FreeBSD.ORG Wed Sep 26 18:32:52 2007 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9AB8C16A418 for ; Wed, 26 Sep 2007 18:32:52 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from speedfactory.net (mail6.speedfactory.net [66.23.216.219]) by mx1.freebsd.org (Postfix) with ESMTP id 50AAA13C45D for ; Wed, 26 Sep 2007 18:32:52 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (unverified [66.23.211.162]) by speedfactory.net (SurgeMail 3.8p) with ESMTP id 211528369-1834499 for multiple; Wed, 26 Sep 2007 14:31:28 -0400 Received: from localhost.corp.yahoo.com (john@localhost [127.0.0.1]) (authenticated bits=0) by server.baldwin.cx (8.13.8/8.13.8) with ESMTP id l8QIWPRj024716; Wed, 26 Sep 2007 14:32:37 -0400 (EDT) (envelope-from jhb@freebsd.org) From: John Baldwin To: freebsd-arch@freebsd.org Date: Wed, 26 Sep 2007 14:03:57 -0400 User-Agent: KMail/1.9.6 References: <200709260131.49156.hselasky@c2i.net> <20070926045401.GB47467@funkthat.com> <200709261844.56182.hselasky@c2i.net> In-Reply-To: <200709261844.56182.hselasky@c2i.net> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200709261403.58349.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-2.0.2 (server.baldwin.cx [127.0.0.1]); Wed, 26 Sep 2007 14:32:37 -0400 (EDT) X-Virus-Scanned: ClamAV 0.88.3/4405/Wed Sep 26 12:29:18 2007 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 required=4.2 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.1.3 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on server.baldwin.cx Cc: John-Mark Gurney , Hans Petter Selasky Subject: Re: Request for feedback on common data backstore in the kernel X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Sep 2007 18:32:52 -0000 On Wednesday 26 September 2007 12:44:55 pm Hans Petter Selasky wrote: > What I meant was that USB dma directly into main memory. But then another PCI > device like an Ethernet device might want to forward that data by dma'ing it > out of main memory. The dma address as seen by the two different PCI devices > might not be the same. > > I admit that I'm not an expert on how DMA is done on the Sparc, but could you > explain a little bit more how a mbuf is loaded into DMA for a network card on > the Sparc ? > > What I'm looking for is a function that transforms a virtual memory address > and a bus-DMA tag into a physical address without blocking. If a mapping is > not possible I want that an error be returned so that I can bounce the data > using a pre-allocate buffer, and not a buffer allocated by bus_dma on the > fly. bus_dma already preallocates bounce pages when you create a map. I would just try using the existing bus_dma first w/o trying to use private buffers, etc. That said, there is one case where this could be useful: for disk dumps it might be nice to pre-allocate a known "safe" set of pages to use for bouncing pages (such as on i386 with PAE with a controller that does 32-bit addressing) that can't be mapped directly. -- John Baldwin