Is WdfCommonBufferCreate guaranteed to return a logical address below 4GB?

Hi,

I’m developing a device using a PLX9056 PCI bridge, and doing scatter/gather DMA transfers. It supports 64bit addressing for the data transfer, but the descriptor blocks that are setup in the common buffer have to be within the 4GB address space.

I’ve read the documentation carefully, but there is no indication that WdfCommonBufferCreate will always return a buffer below the 4GB threshold. Is it a safe assumption to make?

Thanks,
John

You specify characteristics of your device when you allocate a DMA adapter. If your device requires different constraints, you can allocate another DMA adapter for 32 bit physical (logical) address allocations.

Hi,

I’m specifying WdfDmaProfileScatterGather64Duplex when I create my DMA adapter, which is what the device is capable of. The constraint is purely on the common buffer where I setup the data structures for the scatter/gather. Once it has loaded the scatter/gather table it is capable of dual address cycles for transferring the data.

I understand that if I specified WdfDmaProfileScatterGatherDuplex then this would solve the problem, but transfers on machines with >4GB would potentially become slower.

Thanks,
John

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@broadcom.com
Sent: 25 January 2012 17:47
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] Is WdfCommonBufferCreate guaranteed to return a logical address below 4GB?

You specify characteristics of your device when you allocate a DMA adapter. If your device requires different constraints, you can allocate another DMA adapter for 32 bit physical (logical) address allocations.


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

Create 2 DMA adapters. One to allow your common buffer out of, the other for your data

d

debt from my phone


From: John Hall
Sent: 1/30/2012 2:01 AM
To: Windows System Software Devs Interest List
Subject: RE: RE:[ntdev] Is WdfCommonBufferCreate guaranteed to return a logical address below 4GB?

Hi,

I’m specifying WdfDmaProfileScatterGather64Duplex when I create my DMA adapter, which is what the device is capable of. The constraint is purely on the common buffer where I setup the data structures for the scatter/gather. Once it has loaded the scatter/gather table it is capable of dual address cycles for transferring the data.

I understand that if I specified WdfDmaProfileScatterGatherDuplex then this would solve the problem, but transfers on machines with >4GB would potentially become slower.

Thanks,
John

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@broadcom.com
Sent: 25 January 2012 17:47
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] Is WdfCommonBufferCreate guaranteed to return a logical address below 4GB?

You specify characteristics of your device when you allocate a DMA adapter. If your device requires different constraints, you can allocate another DMA adapter for 32 bit physical (logical) address allocations.


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

Doron,

Thanks for that - I had not completely understood the role of the DMA adapter.

As a note, I believe that this is a bug in the PLX9x5x example - it uses a single 64bit adapter, but has two issues. The common buffer must be below 4GB and it does not configure the device correctly for dual address cycles. It does set up the second PCI address DWORD (PciAddressHigh in DMA_TRANSFER_ELEMENT), but does not set the appropriate bit in the DMAMODEx registers (bit 18, called DACChainLoad in the sample driver). This means that only the first four words of each DMA_TRANSFER_ELEMENT are actually transferred by the PLX and it only performs single address cycles.

Regards,
John

From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of Doron Holan
Sent: 30 January 2012 15:10
To: Windows System Software Devs Interest List
Subject: RE: RE:[ntdev] Is WdfCommonBufferCreate guaranteed to return a logical address below 4GB?

Create 2 DMA adapters. One to allow your common buffer out of, the other for your data

d

debt from my phone


From: John Hall
Sent: 1/30/2012 2:01 AM
To: Windows System Software Devs Interest List
Subject: RE: RE:[ntdev] Is WdfCommonBufferCreate guaranteed to return a logical address below 4GB?
Hi,

I’m specifying WdfDmaProfileScatterGather64Duplex when I create my DMA adapter, which is what the device is capable of. The constraint is purely on the common buffer where I setup the data structures for the scatter/gather. Once it has loaded the scatter/gather table it is capable of dual address cycles for transferring the data.

I understand that if I specified WdfDmaProfileScatterGatherDuplex then this would solve the problem, but transfers on machines with >4GB would potentially become slower.

Thanks,
John

-----Original Message-----
From: xxxxx@lists.osr.commailto:xxxxx [mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@broadcom.commailto:xxxxx
Sent: 25 January 2012 17:47
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] Is WdfCommonBufferCreate guaranteed to return a logical address below 4GB?

You specify characteristics of your device when you allocate a DMA adapter. If your device requires different constraints, you can allocate another DMA adapter for 32 bit physical (logical) address allocations.


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer</mailto:xxxxx></mailto:xxxxx>