Re: How to DMA data from a pci device to a user buffer directly

Pete Zaitcev (zaitcev@redhat.com)
Mon, 5 May 2003 16:58:39 -0400


> 5) My DMA controller has unlimited scatter-gather capability.

> By the way, I have tested the rest of my code by DMA the image data to a
> kernel buffer allocated using kmalloc() first, then do a memcpy() to copy
> the image data to a user buffer. This alternative seems to work fine.

Use mmap to make the kmalloc-ed buffer available to user
application without the overhead of memcpy().

It is very wonderful that you can do s/g, so on the next stage
you can kmalloc a bunch of blocks with small order (1) and use
those instead of relying on bootmem allocation and Pauline's
bigphysarea patch. Most older controllers cannot do it.

-- Pete
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/