Re: Request for feedback on common data backstore in the kernel



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
_______________________________________________
freebsd-arch@xxxxxxxxxxx mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-arch
To unsubscribe, send any mail to "freebsd-arch-unsubscribe@xxxxxxxxxxx"



Relevant Pages

  • Re: Trying to DMA data from PCI bus to IDE
    ... and then use the regular Linux functions to write it to the ... > hdparm has nothing to do with the kernel's in memory caching of disk ... It's still creating a buffer stack somewhere (even ... DMA it directly to the drive by setting the IO ports and registers. ...
    (comp.os.linux.development.system)
  • Re: High-performance IO
    ... The size of contigious buffer is meaningfull for common buffer DMA ... I would say that for scatter-gather DMA it depends on how much memory ... I know that AWE can give the programmer a way to use ...
    (microsoft.public.win32.programmer.kernel)
  • Re: PCI bus-master and large contiguous memory buffers
    ... As soon as device reaches the end of the buffer ... Sure, I am developing both PCI adapter and device driver, so, it is ... not afford reinitializing DMA on my device after every transfer. ... x86 CPU memory management structures I never tried to dig into Windows ...
    (microsoft.public.development.device.drivers)
  • Re: 1G DMA buffer under XP - how?
    ... system memory, and what is address 0 to the controller could be something ... so only the HAL's DMA routines can allocate ... common buffer correctly in all situations. ... My card is happy with any physical address> below 4G, and I can tell this call to only allocate below the given> HighestAcceptableAddress. ...
    (microsoft.public.development.device.drivers)
  • Re: fork() (Was: Re: Will "COM for OpenVMS" be ported to Itanium
    ... >> No. Memory and devices are always consistent. ... > handing a buffer off for DMA output so that the data that the CPU ...
    (comp.os.vms)