Re: KMDF DMA questions? by Doron
Doron
Mon Oct 22 13:27:46 PDT 2007
note that what stephen described is a limit of PCI's architecture, not a
limit created by KMDF. anything you can do in WDM's DMA APIs you can do in
KMDF's APIs.
--
Please do not send e-mail directly to this alias. this alias is for
newsgroup purposes only.
This posting is provided "AS IS" with no warranties, and confers no rights.
"Stephan Wolf [MVP]" <stewo68@hotmail.com> wrote in message
news:1192889702.728111.6700@z24g2000prh.googlegroups.com...
> On Oct 19, 7:49 pm, Xinshou2 <Xinsh...@discussions.microsoft.com>
> wrote:
>> 1. Can I have two DMA transactions active at same time?
>
> Large DMA transfers are usually done in bursts of (multiples of) the
> cache line size. A busmaster DMA device acquires the respective bus
> (e.g. PCI), transfers data, and releases the bus [this is somewhat
> simplified, but I am not a real hardware expert.]
>
> If two devices want to transfer data via DMA on the same bus, (at
> least) one device needs to wait until the bus is "free".
>
> So in this respect, the answer is no, there cannot be two simultaneous
> DMA transactions. Much like there cannot be two simultaneous running
> threads on one processor. Sure they run "at the same time" from a user
> perspective, but they actually can only use the same CPU, one after
> the other.
>
> A DMA busmaster device can do DMA transfers of any length, but IIRC
> these are actually broken down into smaller pieces by the hardware.
> This is completely transparent to software, that is, the software can
> tell a device to do a transfer of any length but this will actually be
> handled in smaller pieces in hardware.
>
> But all this has nothing to do with how many scatter/gather lists can
> be there at the same time, or how long one scatter/gather element can
> be.
>
> Keep in mind that the DMA hardware needs to use physical addresses. So
> if you have, say, a 4 MB buffer in software, the undelying physical
> pages can be anywhere in memory and in any order, so you can end up
> with many scatter/gather elements of different lenghts for the 4 MB
> block.
>
> HTH, Stephan
>