cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
sasquatch
Contributor
Contributor
3,402 Views
Registered: ‎07-22-2018

XDMA streaming C2H question 2

Hello,

 

I'm using the XDMA 2018.2 under Windows 10 64-bit.  I was able to run the memory-mapped examples with the 8 MB buffer size with the WriteFile() and ReadFile() functions.

 

I'm now trying the streaming version of the XDMA, and was able to transfer the 8 MB buffer size successfully from H2C using WriteFile().

 

To test the C2H streaming interface, I've added a counter to continuously push data into the C2H interface when c2h_tready is high.  I am able to transfer buffer sizes up to 1MB successfully using ReadFile(), but unlike the H2C interface where I hit an upper limit of 8 MB on buffer size, I am unable to transfer more than 1MB using ReadFile on C2H.  This results in a really slow transfer speed.  Can you think of any reason why I would not be able to transfer greater than 1MB with C2H?

 

Thanks!

 

 

 

Thanks for any help!

Tags (1)
0 Kudos
5 Replies
stepmalchi
Observer
Observer
3,363 Views
Registered: ‎02-25-2015

Hi,

 

We are using XDMA on Windows 10 64-bit as well and are facing similar issues. 

 

The ring buffer is set as follows. 

 

1. There are 256 elements in the ring

2. Each ring is 4KB deep, which gives a total of 1MB

3. The packet size of counter on  the streaming interface is 4KB as well. When the packet size is increased to 8K the read fails.

 

I have included my code below if you see any issues please let me know.

 

 

Rgds,

Stephen

 

 

 

 

 

0 Kudos
pumpkin
Explorer
Explorer
3,348 Views
Registered: ‎06-22-2011

hi,

 

If you care about performance, maybe the overlapped IO should be used.

I'm not sure if this driver support it.

 

 

regards

 

Xiang

 

0 Kudos
deepeshm
Xilinx Employee
Xilinx Employee
3,260 Views
Registered: ‎08-06-2008

Just as a reference:

To test C2H streaming with the example design for 32M transfer change transferSize in run_test.sh to 32768

In dma_streaming_test.sh, change data/datafile${i}_4K.bin to data/datafile_32M.bin in the following command line:

$tool_path/dma_to_device -d dev/xdma0_h2c_{i} -f data/datafile${i}_4K.bin -s $trasnferSize -c $transferCount &

jsara
Participant
Participant
3,068 Views
Registered: ‎08-14-2015

What is run_test.sh?  Is this for linux?  Is there an equivalent windows app?  What is $tool_path/dma_to_device?  How do I find this application in windows?

0 Kudos
eric_chen
Observer
Observer
2,962 Views
Registered: ‎07-09-2008

hi pumpkin,

I have the same problem, C2H stream received wrong number bytes . I used XDMA ip example design test C2H,when I run dma_streaming_test.sh,if the count is large than 1,maybe appear the wrong.

htpc@htpc:~/fpga/driver/ord/tests$ sudo ./dma_streaming_test.sh 4096 10000 1
Info: Running PCIe DMA streaming test
      transfer size:  4096
      transfer count: 10000
Info: Only channels that have both h2c and c2h will be tested as the other
      interfaces are left unconnected in the PCIe DMA example design.
Info: DMA setup to read from c2h channel 0. Waiting on write data to channel 0.
Info: Writing to h2c channel 0. This will also start reading data on c2h channel 0.
Info: Wait the for current transactions to complete.
** Average BW = 4096, 102.659798
/dev/xdma0_c2h_0, R off 0x0, 0x0 != 0x1000.
read file: Success
Info: Checking data integrity.
Info: Data check passed for c2h and h2c channel 0.
Info: All PCIe DMA streaming tests passed.
htpc@htpc:~/fpga/driver/ord/tests$

 

I see in dma_utils.c ,from line 69:

/* read data from file into memory buffer */
        rc = read(fd, buf, bytes);
        if (rc != bytes) {
            fprintf(stderr, "%s, R off 0x%lx, 0x%lx != 0x%lx.\n",
                fname, count, rc, bytes);
                perror("read file");
            return -EIO;
        }

The driver's version that I used is Xilinx_Answer_65444_Linux_Files_rel20180420.zip.

I found the other solution https://forums.xilinx.com/t5/PCI-Express/C2H-Streaming-XDMA-Linux-Driver-Broken/td-p/833977  ,but this is not xilinx version ,and I need C2H and H2C both, the solution only C2H,now I found H2C is ok,and performance for GEN2X4 can reach 10GBPS. I want use xilinx drvier,could you kindly help me?

 

 

 

0 Kudos