Hi,
why using the common buffer ?
With PLX bridge Scatter/Gather support you can do DMA directly in user application
buffers.
Just queue enough I/O overlapped requests from the application.
In OSR site you can find a very very interesting technical article named
X-DMA - Extreme DMA for Performance
http://www.osronline.com/article.cfm?id=19
Regards,
PaoloC
– Messaggio originale –
From: “Scott M. Dunn”
>To: “Windows System Software Devs Interest List”
>Date: Thu, 16 Dec 2004 13:09:39 +0100
>Subject: [ntdev] Common Buffer DMA Questions
>Reply-To: “Windows System Software Devs Interest List”
>
>
>Hello everyone.
>
>I?m a new driver writer, and I have some questions about
>common buffer DMA. I?ve looked through the lists, but haven?t
>found what I?m looking for.
>
>I am writing a driver for a data acquisition card (FPGA, PLX
>PCI, Bus Master, Scatter/Gather). I have a Unix driver as a
>model.
>
>I have a ring buffer made out of 8 one-page common buffers. I
>started the DMA transfer and can read from 7 buffers, and the 8th
>is being written. The DMA transfer runs continually.
>
>The read process is causing me problems. In the user-mode, you
>just keep reading buffers in a loop. For now, it works so - 7
>reads work, and then for the 8th (waiting for the next buffer to be
>completely written) I return 0 bytes transferred. This works, so I
>can read data, but of course this isn?t optimal.
>
>The Unix driver solves this so. If the data is there, the read
>request is completed. If the data is not there, the read request
>sleeps until an interrupt comes. If the buffer that was completed
>isn?t the right one, the read request sleeps again until the next
>interrupt and so on. But I haven?t been able to find an equivalent
>for WDM drivers.
>
>I think I have to set up a queue, but I?m not sure how that would
>work. Until now, I have been doing all of the reading right in the
>DispatchRead routine because the data was there and it didn?t
>take long. So I could put the read IRP in a queue when the data
>isn?t there, status_pending and everything, and then read from
>the queue when an interrupt occurs.
>
>But here is where I run into problems. What happens when two
>file-handles are open, two programs try to read two different
>blocks that haven?t been written yet? I start reading the queue,
>one request can be filled, I would want to wait on the next one,
>can I re-queue it?
>
>Is this a lousy design? Am I missing something? Are there any
>examples of this? I?ve found very few examples of common
>buffer DMA, and none with multiple read request ?
>
>I have the books from Walter Oney, Art Baker, and Chris Cant.
>
>Any help would be greatly appreciated, and let me know if I can
>clarify anything.
>
>Scott Dunn
>
>Br?ckner & Jarosch Ing.-GmbH
>Nonnengasse 5a
>99084 Erfurt
>Germany
>
>Tel: +49 (0)361 / 21 24 02 2
>Fax: +49 (0)361 / 21 24 01 9
>
>—
>Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256
>
>You are currently subscribed to ntdev as: unknown lmsubst tag argument:
‘’
>To unsubscribe send a blank email to xxxxx@lists.osr.com