The C2H Stream Engine DMA writes the stream packets to the host memory into the descriptor provided by the host driver through the C2H descriptor queue.
The Prefetch Engine is responsible for calculating the number of descriptors needed for the DMA that is writing the packet. The buffer size is fixed per queue basis. For internal and cached bypass mode, the prefetch module can fetch up to 512 descriptors for a maximum of 64 different queues at any given time.
The Prefetch Engine also offers low latency feature pfch_en = 1
, where the engine can prefetch up to qdma_c2h_pfch_cfg.num_pfch
descriptors upon receiving
the packet, so that subsequent packets can avoid the PCIe latency.
The QDMA requires software to post full ring size so the C2H stream engine can fetch the needed number of descriptors for all received packets. If there are not enough descriptors in the descriptor ring, the QDMA will stall the packet transfer. For performance reasons, the software is required to post the PIDX as soon as possible to ensure there are always enough descriptors in the ring.
C2H stream packet data length is limited to 31 * C2H buffer size. C2H buffer size can be programed from 0xAB0 to 0xAEC address, for details refer to cpm5-qdma-v4-0-pf-registers.csv file.