Hi guys,
I am developing a KMDF PCIE driver, I developed my code based on PLX9X5X sample.
The hardware platform is a Microsemi FPGA, It has a sample firmware for DMA controller that requires logical address for DMA transfer, transfer length and direction to start a transfer. Here is a summery of hardware:
- Supports only 32-bit addressing
- 8KB buffer for DMA operations
- Supports hardware scatter/gather, 4 elements (application buffer is 8KB)
From the application point of view, DMA transfers are done via calling WriteFile and ReadFile APIs.
When firstly I wrote the driver, the buffer access method for IO operations (WriteFile , ReadFile) was BufferedIO and DMA enabler config set to WdfDmaProfileScatterGather. With this configuration my driver works fine and perform DMA transfers correctly.
Later I realized that BufferedIO decreases driver performance by copying data from user memory to kernel memory. Also because my hardware does not support 64-bit addressing, framework allocates map registers (when buffer is located above 4GB address mark) which means it again copy the buffer to a memory location in lower 4GB address space to enables hardware to access the buffer.
For the first step to improve my driver, I changed the IO method to DirectIO and I decided to change DMA enabler config to WdfDmaProfile (because my hardware does not support 64-bit). Now device registers configured correctly but DMA does not start. I debugged the driver and everything seems alright. I mean scatter/gather list is created with only one element and device registers are configured.
It seems to me that the DMA engine in the hardware can not perform DMA when buffer access method is DirectIO.
Any idea why changing IO access to DirectIO can cause this issue?