AR# 72813

|

Queue DMA subsystem for PCI Express (PCIe) (Vivado 2019.1) - Read file: Input/output error

Description

When using the Queue DMA subsystem for PCI Express (PCIe) and testing the following application with the example design, the system reports - "read file: Input/output error".


[root@xyz linux]# dma_from_device -d /dev/qdma01000-ST-0 -s 512
/dev/qdma01000-ST-0, read off 0x0 + 0x200 failed -1.
read file: Input/output error


This article is part of the PCI Express Solution Centre

(Xilinx Answer 34536)Xilinx Solution Center for PCI Express

Solution

For ST C2H, the user application should configure the user logic to generate packets.

If the packets are not generated, the driver will fail to get the requested data.

In the Xilinx example design, user logic provides the interface to program the user bar registers to write the queue number, packet size, and packet number and generate the packets. 

Please see example design registers section in (PG302). 

Once the packets are generated, dma_from_device will get the data from QDMA rings and display to the user.

Please find an example below and note how it is subject to change based on user logic.

[root@lab21 linux]# dmactl qdma01000 q add idx 0 mode st dir bi
qdma01000-ST-0 C2H added.
qdma01000-ST-0 H2C added.
Added 1 Queues.


[root@lab21 linux]# dmactl qdma01000 q list
H2C Q: 1, C2H Q: 1.
qdma01000-ST-0 H2C online
hw_ID 0, thp ?, desc 0xffff9e0a476b8000/0xff9e8000, 1536
qdma01000-ST-0 C2H online
hw_ID 0, thp ?, desc 0xffff9e0a372e0000/0xffff8000, 1536
cmpt desc 0xffff9e0a35378000/0xff9f0000, 2048



[root@lab21 linux]# dma_from_device -d /dev/qdma01000-ST-0 -s 512
/dev/qdma01000-ST-0, read off 0x0 + 0x200 failed -1.
read file: Input/output error


The above error goes away after programming the corresponding registers in the user logic:


[root@lab21 linux]# dmactl qdma01000 reg write bar 2 0x0 0
qdma01000, 01:00.00, bar#2, reg 0x0 -> 0x0, read back 0x0.
[root@lab21 linux]# dmactl qdma01000 reg write bar 2 0x4 512
qdma01000, 01:00.00, bar#2, reg 0x4 -> 0x200, read back 0x200.
[root@lab21 linux]# dmactl qdma01000 reg write bar 2 0x20 1
qdma01000, 01:00.00, bar#2, reg 0x20 -> 0x1, read back 0x1.
[root@lab21 linux]# dmactl qdma01000 reg write bar 2 0x8 2
qdma01000, 01:00.00, bar#2, reg 0x8 -> 0x2, read back 0x0.
[root@xsjpcielab21 linux]# dma_from_device -d /dev/qdma01000-ST-0 -s 512
** Average BW = 512, 9.636196


Revision History:

  • 09/30/2019 - Initial Release
AR# 72813
Date 10/02/2019
Status Active
Type General Article
IP
People Also Viewed