Date: Wed, 26 Sep 2007 14:03:57 -0400 From: John Baldwin <jhb@freebsd.org> To: freebsd-arch@freebsd.org Cc: John-Mark Gurney <gurney_j@resnet.uoregon.edu>, Hans Petter Selasky <hselasky@c2i.net> Subject: Re: Request for feedback on common data backstore in the kernel Message-ID: <200709261403.58349.jhb@freebsd.org> In-Reply-To: <200709261844.56182.hselasky@c2i.net> References: <200709260131.49156.hselasky@c2i.net> <20070926045401.GB47467@funkthat.com> <200709261844.56182.hselasky@c2i.net>
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200709261403.58349.jhb>