Allocating a huge amount of DMA memory.

I am running Windows Server 2008R2. I need to allocate a huge amount of DMA memory. My server is equipped with 24G. I am able to allocate 2G of DMA memory in chunks of 4M. Allocating more causes the allocate (WdfCreateCommonBuffer) to fail, but as I have 24G there should be plenty of memory.

Is there a limit for how much memory that can be allocated as DMA memory?
Is it possible to change the limit?

Regards
Bent

Does your DMA profile indicate support for scatter/gather? If not, that could be the issue.

Peter
OSR

I’m not sure how support for scatter-gather should affect it, but support for 64 bit definitely would.

Make sure you set Dma64BitAddresses in DEVICE_DESCRIPTION to TRUE. Don’t set Dma32BitAddresses.

It affects it the exact same way that setting or not setting Dma64BitAddresses does. No scatter/gather support gets you “system scatter/gather support” which results in intermediate buffering.

Peter
OSR

>No scatter/gather support gets you “system scatter/gather support” which
results in intermediate buffering.

But this is just AllocateCommonBuffer call, which produces contiguous buffers. It just gets straight to MmAllocateContiguousMemorySpecifyCache with the HighestAcceptableAddress set depending on the address bit support.

Changing the DMA profile from WdfDmaProfilePacket64 to WdfDmaProfileScatterGather64 did all the work. Now I am able to allocate as much as I need. Thank you very much for the help.