Re: WDF DMA use
- From: "Eliyas Yakub [MSFT]" <eliyasy@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Thu, 7 Jun 2007 07:41:15 -0700
Your proposal of telling the system that you support scatter-gather, using
common buffer to allocate memory and copying fragments to a contiguous
buffer will work. All I want you to do is use AllocateCommonBuffer funciton
instead of MmAllocateContiguousMemory. Both are functionally equivalent.
If you care about performance so much then you should have designed the
hardware to support scatter-gather in the first place.
-Eliyas
"Avi Lousky" <AviLousky@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:4264FC39-E43D-48DA-B2BE-291EF0EC163D@xxxxxxxxxxxxxxxx
I'd like to make my driver future proof, this is the reason for trying to
use
the DMA, however it seems that the DMA abstraction is not suitable for my
product. As I described, my board can handle several hundreds of audio
packets, and therefore the driver should handle several hundreds of DMA
transactions. Is there a way to do that?
"Eliyas Yakub [MSFT]" wrote:
No you shouldn't use MmAllocateContiguousMemory. If you are planning to
use
common buffer and do the memory copy yourself then you should use
AllocateCommonBuffer to allocate memory. Industry is moving towards
IOMMU
(ask DMA remapping). By using DMA interfaces, you make your driver future
proof.
-Eliyas
"Avi Lousky" <AviLousky@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:65221CB2-EA84-4A96-B2D9-53383EF78284@xxxxxxxxxxxxxxxx
So map registers are my bottle neck. Here is a thought: I will use
MmAllocateContiguousMemory with HighestAcceptableAddress of 32 bit
address
and configure the dma enabler (WDF_DMA_ENABLER_CONFIG) with 32 bit and
scatter gather. Will then the abstraction ignore the use map registers?
Will
I be able to use several hundreds of transactions?
Is there another way to cause the system not to use map registers?
Thanks!
"Eliyas Yakub [MSFT]" wrote:
Yes it will coalesce it using map registers.
For scatter-gather DMA, map registers will be used only if the buffer
lies
outside the range of memory your hardware can access.
Yes, map registers are very precious resource. You can think of them
as
backup buffers allocated by the system to workaround hardware
addressing
limitations. The system can only allocate so many of those. The number
of
concurrent DMA transactions is constrained by the number of map
registers
system can provide. You can ask for large amount of map registers by
specifying a big value in MaximumLength field, but the system may not
provide everything you ask for. Based on what the system provides, you
have
to scale down your concurrency level. Take a look at the PCIDRV sample
and
the logic around WdfDmaEnablerCreate call.
Since you are using Packet based DMA, one think you should note is
that
you
cannot initiate more than one DMA transactions concurrently. This is a
limitation imposed by the DMA sub-system because of the way it waits
for
the
map-registers to be made available. Framework has logic to enforce
this
limitation.
-Eliyas
.
- Follow-Ups:
- Re: WDF DMA use
- From: Avi Lousky
- Re: WDF DMA use
- References:
- Re: WDF DMA use
- From: Eliyas Yakub [MSFT]
- Re: WDF DMA use
- From: Eliyas Yakub [MSFT]
- Re: WDF DMA use
- From: Avi Lousky
- Re: WDF DMA use
- Prev by Date: Re: WdfDeviceCreateDeviceInterface Again
- Next by Date: Re: Port Monitor
- Previous by thread: Re: WDF DMA use
- Next by thread: Re: WDF DMA use
- Index(es):
Relevant Pages
|