Request for feedback on common data backstore in the kernel
John Baldwin
jhb at freebsd.org
Wed Sep 26 11:32:52 PDT 2007
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
More information about the freebsd-arch
mailing list