Re: PCI DMA into USER space

From: Richard B. Johnson (root@chaos.analogic.com)
Date: Wed Jun 14 2000 - 07:54:26 EST


On Wed, 14 Jun 2000, Jeff Garzik wrote:

> "Richard B. Johnson" wrote:
> > On Tue, 13 Jun 2000, Mayhall, Tony wrote:
> > > Does anyone have an example (that works) of how to DMA from a PCI card into
> > > user space on a PC running Linux? We do this on Unix systems and need to be
> > > able to do this under Linux.
>
> > Hmm. From what Unix Systems? Suns don't have 'ports'. All memory-mapped
> > I/O. The PCI spec was designed around shared memory. Once you got shared
> > memory, all you have to do is mmap it. No DMA required.
>
> DMA is generally faster though since it doesn't have to involve the host
> CPU when slinging data around..
>
> Jeff
>

The PCI bridge is bus-mastering hardware. Without the use of the CPU
at all, hardware writes from a device, write directly to RAM wherever
you have specified when setting up the PCI device. You don't have to
suck data through a low-bandwidth port using DMA. If you need to
copy data, usually the case, you have to copy it anyway. It is dumb
to incur the DMA setup time for memory-to-memory DMA, then wait for
the hardware to do it. Instead, you just use the data directly.

Cheers,
Dick Johnson

Penguin : Linux version 2.3.36 on an i686 machine (400.59 BogoMips).

"Memory is like gasoline. You use it up when you are running. Of
course you get it all back when you reboot..."; Actual explanation
obtained from the Micro$oft help desk.

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



This archive was generated by hypermail 2b29 : Thu Jun 15 2000 - 21:00:31 EST