Using 64-bit DMA transfer

The 64-bit direct memory access (DMA) transfer enables devices to extend beyond the 2 GB size limit and enables DMA windows to be placed above the 4 GB limit in system memory. The 64-bit DMA transfer is only supported on PCI-E devices that have support for dynamic DMA Windows. A device that uses the 64-bit DMA transfer forfeits the use of the 32-bit DMA transfer on that device.

To use the 64-bit DMA support, the d_map_query service must be called along with the DDW_QUERY command.

The d_map_query service returns the maximum number of contiguous pages available for a window, and the supported page sizes. The driver can find the maximum size allowed by multiplying the number of pages available and their desired supported page size. After a suitable space is found, the driver must call the d_map_init_ext service along with the DMA_PRIME flag to create a DDW. To create a DMA handle, the device driver must specify the DMA_HUGE flag along with the DMA_PRIME flag or both flags along with the d_map_init_ext service. The calls to the d_map_init_ext service, where both DMA_PRIME and DMA_HUGE flags are specified, uses the same size input for both the DDW and DMA handle.

The device driver can be bypass using the DMA_PRIME flag to create a window by specifying the DMA_HUGE flag in the d_map_init_ext service. If no DDW window was created for the slot previously, then one is created for it. However, the 32-bit DMA handles can not be allocated at the time.

Using DMA_HUGE

The DMA_HUGE flag creates a 64-bit direct memory access (DMA) handle. The 64-bit DMA handle is allocated within a dynamic DMA Windows. The DMA_HUGE flag handles up to 512 GB depending on the dynamic DMA Window size. Using the d_map_query service along with the DMA_QUERY flag specifies the maximum amount of DMA space available in the currently existing windows.

If the DMA_HUGE flag is specified before the DMA_PRIME flag, the DMA_HUGE flag then searches through any current dynamic DMA Windows for space available. If the DMA_PRIME flag is not specified, it creates one of maximum size and allocates a handle of specified size to the DMA space.

Using DMA_PRIME

The DMA_PRIME flag is only supported by the 64-bit direct memory access (DMA) transfer and indicates that a new dynamic DMA Window is required. If the DMA_PRIME flag is used along with the DMA_HUGE flag, both the new DDW window and the DMA handle is of the same size.

If only the DMA_PRIME flag is specified, a dynamic DMA Window is created. The d_map_init_ext service along with the specified DMA_HUGE flag must then be called to allocate a DMA handle. The DMA_PRIME flag creates up to a 512 GB window depending on system resources.

Using the d_map_query service along with the DDW_QUERY command specifies the maximum amount of pages available for the window. The amount of pages multiplied by the desired page size for the window specifies the amount of space available for the window.