Kernel DMA buffer copy to user buffer too slow

>> You can use direct I/O with DMA. When a device object is configured to do direct I/O, the I/O manager prepares a MDL that represents the user buffer. This MDL can be used for DMA as explained in the following page. https://msdn.microsoft.com/en-us/library/windows/hardware/ff565374(v=vs.85).aspx Note that this MDL could be used with MmMapLockedPagesSpecifyCache to obtain a system mapping of the user buffer. You would then be able to use the buffer in an arbitrary context (Isr or Dpc routine).

I consider this case before. But according my device hardware, I need to get the physical address to trigger a DMA transfer. Yes, I can get the MDL from user buffer but I don’t kown how to trigger DMA. The api MapTransfer didn’t provide any place to let me start DMA.
And there is another question, how can I design my hardware to meet the MapTransfer or bus master requirement? What is the principles I can follow?

If your device is a bus master, then your driver tells your device to trigger the DMA transfer. There will generally be a DMA start bit that you set after you’ve programmed the parameters (addresses and length(s)) for the transfer.

So you call Windows’s DMA APIs to get your physical addresses set up, then you tell your device to do the transfer.

-p

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@hotmail.com
Sent: Wednesday, January 11, 2017 3:58 AM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] Kernel DMA buffer copy to user buffer too slow

>> You can use direct I/O with DMA. When a device object is configured to do direct I/O, the I/O manager prepares a MDL that represents the user buffer. This MDL can be used for DMA as explained in the following page. https://msdn.microsoft.com/en-us/library/windows/hardware/ff565374(v=vs.85).aspx Note that this MDL could be used with MmMapLockedPagesSpecifyCache to obtain a system mapping of the user buffer. You would then be able to use the buffer in an arbitrary context (Isr or Dpc routine).

I consider this case before. But according my device hardware, I need to get the physical address to trigger a DMA transfer. Yes, I can get the MDL from user buffer but I don’t kown how to trigger DMA. The api MapTransfer didn’t provide any place to let me start DMA.
And there is another question, how can I design my hardware to meet the MapTransfer or bus master requirement? What is the principles I can follow?


NTDEV is sponsored by OSR

Visit the list online at: http:

MONTHLY seminars on crash dump analysis, WDF, Windows internals and software drivers!
Details at http:

To unsubscribe, visit the List Server section of OSR Online at http:</http:></http:></http:>