UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Explorer
Explorer
713 Views
Registered: ‎03-22-2016

AXI stream messages being dropped by XDMA block

I set up a design using a VCU118 with a DMA/Bridge Subsystem for PCIe configured in streaming mode. I looped the H2C output back to the C2H input by way of a stream FIFO. My expectation is that any data I send to the FPGA via DMA I can then receive from the DMA. Multiple messages queued in the FIFO or XDMA block waiting to be read.

Instead, I'm only able to ever receive the first message when multiple messages are sent in a row.

 

Steps to reproduce:

- Create design as described above (DMA/Bridge Subsystem for PCIe in a streaming loopback configuration)

- Build and insert xdma.ko module from AR65444
- Use dma_to_device tool included in AR65444 to send multiple messages to the FPGA
- Use dma_from_device tool to receive messages from the FPGA

 

Expected results:

- The number and contents of messages sent to the FPGA should match the received, provided the FIFO hasn't been overrun.

Actual results:
- Only the first message is received. Subsequent messages that are sent are dropped.

Any thoughts on this behavior? Is this expected or is there some way to address it? Thanks.

0 Kudos
3 Replies
Xilinx Employee
Xilinx Employee
672 Views
Registered: ‎12-10-2013

Re: AXI stream messages being dropped by XDMA block

With XDMA C2H Stream, the driver creates a non-blocking descriptor loop.  This means that once the first dma_from_device is done, c2h_tready will no longer deassert, and all the data will go into the core.  You need to set up all the descriptor for dma_from_device, prior to setting up the dma_to_device.  Basically if you only do the "first" dma_from_device, now all the data sets are sent to that location.   If you set all the C2H descriptors up ahead of time, the core is now waiting for that data to flow in.   Once it comes in the H2C side, it can then flow into the C2H side to independent memory locations, rather than all going to the same place, and overwriting. 

 

 

 

 

-------------------------------------------------------------------------
Don’t forget to reply, kudo, and accept as solution.
-------------------------------------------------------------------------
0 Kudos
Explorer
Explorer
653 Views
Registered: ‎03-22-2016

Re: AXI stream messages being dropped by XDMA block


@bethe wrote:

With XDMA C2H Stream, the driver creates a non-blocking descriptor loop.  This means that once the first dma_from_device is done, c2h_tready will no longer deassert, and all the data will go into the core.  You need to set up all the descriptor for dma_from_device, prior to setting up the dma_to_device.  Basically if you only do the "first" dma_from_device, now all the data sets are sent to that location.   If you set all the C2H descriptors up ahead of time, the core is now waiting for that data to flow in.   Once it comes in the H2C side, it can then flow into the C2H side to independent memory locations, rather than all going to the same place, and overwriting.


Thanks for the info.

 

Can you explain what you mean by "set up all the descriptor for dma_from_device"? "dma_from_device" is a standalone linux utility provided with AR65444. It opens the xdma device node and issues a read() system call, which sets up a DMA transfer and blocks until completion. I don't believe it is possible to set up multiple DMA transfers ahead of time in this way.

If I understand correctly, a DMA transfer is complete when TLAST is received on the C2H stream. At that point, read() returns the received data to the userspace application. If the userspace application then immediately calls read() again, it will still be some number of clock cycles later that the next DMA transfer is set up. In that time, would data from the AXI stream have been dropped? Is it possible to receive back-to-back packets using this driver? Thanks.

For context, the application I am developing is not a continuous flow of data, but rather asynchronous packets.

EDIT: I may have just realized that the subtle difference between running dma_from_device multiple times and issuing multiple read() calls back-to-back from within something like dma_from_device is that close() is not called. Is that sufficient to prevent the data from dropping? I will test this shortly. Thanks.

0 Kudos
Observer david.krolik
Observer
135 Views
Registered: ‎08-20-2019

Re: AXI stream messages being dropped by XDMA block

Did this work?

0 Kudos