2

I am working on improving the throughput of DMA transfers in my custom kernel driver from an FPGA. The current throughput is ~250 Mb/s.

The architecture is like this:

  1. FPGA connected over PCIe
  2. I am allocating a large buffer in RAM using consistent mapping with dma_alloc_coherent when probe is called
  3. The FPGA constantly transfers data over DMA.
  4. The FPGA raises an int whenever DMA is ready and then from the interrupt handler I am copying the data from the memory space mapped from the BAR register to my consistent allocated buffer using device_prep_dma_memcpy.

Is there a way to avoid this memcpy from device_prep_dma_memcpy and tell the DMA to copy the data directly to my consistent allocated buffer?

Mihai
  • 972
  • 2
  • 13
  • 35
  • How? You have your hardware to supply its own buffer thru MMIO region, right? So, in order to do something with this data you need to proceed it somehow. If your handler is fast enough, you may do it inside it, otherwise you need to store it in the bigger buffer and proceed sporadically (like other drivers in multi-tasking OS work). Or simple run RTOS with only one task that does a job. – 0andriy Apr 30 '20 at 22:55
  • From your description the device does not raise an interrupt when DMA is ready. Rather, is writes *into its own memory* and raises the interrupt when done. It's then *you* who explicitly makes it DMA that memory into CPU memory. Could it be made to write to CPU memory directly, and raise the interrupt when that is done? – Jörg Faschingbauer May 01 '20 at 09:51

0 Answers0