Post Go back to editing

Scatter gather DMA transfers

Category: Software

Dear all,

My use case is to stream contiguous data from an AD9361 into RAM, and fill up as much RAM as the board/system can support, using the iio subsystem and libiio.

For now I've implemented what is described wiki.analog.com/.../libiio_tips_tricks using a very large CMA block.

This is basically working but does not seem very stable, sometimes getting allocation errors at buffer time creation which I don't yet understand.

I was wondering whether iio and libiio support scatter/gather DMA transfers, to test a different approach if possible. From what i saw the axi-dmac IP looks like to support it.

I've seen some very old posts here mentioning this, thus I'm asking if it is still supported and if there is some doc/sample code somewhere to see whether I could implement it.

Thanks in advance

Parents
  • Hi,

    I was wondering whether iio and libiio support scatter/gather DMA transfers, to test a different approach if possible. From what i saw the axi-dmac IP looks like to support it.

    That's something we want to bring with libiio1 that also depends on the new dma-buf based interface in IIO. Cannot commit with any timeline but I do have a branch were I ran some tests with the new interface and libiio1:

    https://github.com/analogdevicesinc/linux/commits/staging/dmabuf-testing/

    However, note that I'm not 100% sure if that branch is up to date (I may have some local changes on my lab workstation)

    - Nuno Sá

  • Hi Nuno,

    Thanks for the quick answer.

    Please just let me rephrase to be sure I understood :

    At some point in the future it will be possible to do scatter-gather DMA, but only via libiio1. In addition, this particular functionnality will require dma-buf support (so a kernel with DMABUF support in iio, and libiio1 compiled with WITH_LOCAL_DMABUF_API).

    To the best of my knowledge, libiio1 will not require dma-buf support from the kernel side, that's why I'm asking about this small clarification.

    Are there any plans to backport this dma-buf patch to older kernels (if that make any sense) ?

    If yes, down to which kernel version ?

    Thanks in advance,

    Julien

  • Hi Julien,

    I think my reply also brought some confusion, sorry...

    At some point in the future it will be possible to do scatter-gather DMA, but only via libiio1. In addition, this particular functionnality will require dma-buf support (so a kernel with DMABUF support in iio, and libiio1 compiled with WITH_LOCAL_DMABUF_API).

    You'll just need a kernel that supports it both on the IIO DMA API and of course on the AXI DMAC IP. libiio1 just makes it easier for you to make use of it :)

    To the best of my knowledge, libiio1 will not require dma-buf support from the kernel side, that's why I'm asking about this small clarification.

    Are there any plans to backport this dma-buf patch to older kernels (if that make any sense) ?

    No, the plan is to include it in the 6.6 kernel which will be our next main branch. We then plan to continue to support the legacy MMAP interface for about one release and then drop it. That's the current plan...

    - Nuno Sá 

  • Hi Nuno,

    Thank you for all the answers.

    I just wanted to make sure that SG-DMA will require the DMABUF functionnality, but this seems to be the case from all your messages.

    As said in my first msg, I stumbled upon a very old thread, namely :

     RE: Zerocopy / DMA Scatter Gather commits? 

    suggesting SG was implemented at some point, obviously before DMABUF, but the status was not clear to me, it looked more like an experiment.

    Understood for the "not older than 6.6", fair enough. Thanks for sharing this info.

    Best,

    Julien

Reply
  • Hi Nuno,

    Thank you for all the answers.

    I just wanted to make sure that SG-DMA will require the DMABUF functionnality, but this seems to be the case from all your messages.

    As said in my first msg, I stumbled upon a very old thread, namely :

     RE: Zerocopy / DMA Scatter Gather commits? 

    suggesting SG was implemented at some point, obviously before DMABUF, but the status was not clear to me, it looked more like an experiment.

    Understood for the "not older than 6.6", fair enough. Thanks for sharing this info.

    Best,

    Julien

Children
No Data