cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
TaekyungHeo
Contributor
Contributor
752 Views
Registered: ‎07-10-2020

QDMA - Running out of credits in C2H cache bypass mode

Jump to solution

QDMA supports three types of C2H stream modes: simple bypass, cache bypass, and cache internal.

Currently, I am working on the cache bypass mode with prefetch to send data from the card to the host.

 

The problem is that QDMA does not transfer data to the host after receiving a specific number of requests.

It seems that the problem originates from the shortage of credits.

I have measured the number of credits with dma-ctl, and I have found that QDMA does not accept requests when "Software Credit" becomes zero.

However, according to the manual, credits should be managed by the prefetch engine when prefetch is enabled.

 

"In cache bypass or internal mode prefetch mode can be turned on which will prefetch descriptor and that this will reduce transfer latency significantly. When prefetch mode is enabled, user can not send credits as input in "QDMA Descriptor Credit input ports". Credits for all queues will be maintained by prefetch engine."

 

I can confirm that I have enabled the prefetch mode.

First, I can see prefetched descriptors from the bypass out interface with ILA.

Second, the number of prefetched descriptors is non-zero.

----------------------------------------------------------------------------
Prefetch Context
----------------------------------------------------------------------------
Bypass 0x0 0
Buffer Size Index 0x0 0
Port Id 0x0 0
Variable Descriptor 0x0 0
Number of descriptors prefetched 0x1f 31
Error 0x0 0
Prefetch Enable 0x1 1
In Prefetch 0x1 1
Software Credit 0x5df 1503
Valid 0x1 1

 

The queue has been started with the following command.

dma-ctl qdma02000 q start idx 1 dir c2h desc_bypass_en pfetch_en cmptsz 2

 

Additionally, I have programmed CSR registers with the following commands.

dma-ctl qdma02000 reg write bar 0 0xA84 0x810017DF # QDMA_C2H_PFCH_CFG_2
dma-ctl qdma02000 reg write bar 0 0x1400 0x410 # QDMA_C2H_CRDT_COAL_CFG_1
dma-ctl qdma02000 reg write bar 0 0x1404 0x80002 # QDMA_C2H_CRDT_COAL_CFG_2

 

I am using the latest version of Vivado and driver for this project (2020.2).

 

Can anyone help me to fix this bug?

0 Kudos
1 Solution

Accepted Solutions
TaekyungHeo
Contributor
Contributor
619 Views
Registered: ‎07-10-2020

I have found that PIDX is not updated properly.

Updating PIDX in the driver code has solved the problem.

View solution in original post

6 Replies
TaekyungHeo
Contributor
Contributor
620 Views
Registered: ‎07-10-2020

I have found that PIDX is not updated properly.

Updating PIDX in the driver code has solved the problem.

View solution in original post

dsakjl
Voyager
Voyager
571 Views
Registered: ‎07-20-2018

Hi @TaekyungHeo ,

did you find a bug in Xilinx QDMA driver (https://github.com/Xilinx/dma_ip_drivers/tree/master/QDMA) ?

If yes, please, can you share it?

Thank you, best regards.

0 Kudos
TaekyungHeo
Contributor
Contributor
534 Views
Registered: ‎07-10-2020

Hi, @dsakjl .

 

I don't think it is a bug.

The driver is a reference driver, and I had to modify it for my use case.

0 Kudos
dsakjl
Voyager
Voyager
531 Views
Registered: ‎07-20-2018

Hi @TaekyungHeo ,

ok, thank you.

0 Kudos
dsakjl
Voyager
Voyager
521 Views
Registered: ‎07-20-2018

Hi @TaekyungHeo ,

did you get the following error:

Invalid PIDX update error detected

in linux dmesg from the driver?

If yes, it is possible that the bug you found is relevant to fix the reference driver.

0 Kudos
TaekyungHeo
Contributor
Contributor
486 Views
Registered: ‎07-10-2020

I didn't see the error message yet. I will let you know when I find the same one.

0 Kudos