Scalable Scatter-Gather DMA Intel® FPGA IP User Guide

ID 823097
Date 4/07/2025
Public
Document Table of Contents

3.8.4. Descriptor Chain

The SSGDMA IP descriptors are formed in a block of contiguous 4k Bytes in host memory which can hold up to 128 descriptors where each descriptor is 32 bytes in size. The descriptor block starts with Link Descriptor which host the next block address that chain the block together. The descriptor block is also holding the number of descriptors present in the block. There is a maximum of 127 Data descriptors following the Link Descriptor.

The descriptor blocks can be chained in a loop from last descriptor block back to the first descriptor block via Link Descriptor per the maximum descriptor blocks in a queue configured in Q_SIZE register as in figure Descriptor Chain / Ring buffer for Descriptor Blocks (Continuous Ring). The hardware stops fetching from next new block when SSGDMA Q_EXTRACT_POINTER is equal to Q_INSERT_POINTER as in Descriptor Chain for Descriptor Blocks (Stop at Last Descriptor).

Figure 8. Descriptor Chain / Ring buffer for Descriptor Blocks (Continuous Ring)
Figure 9. Descriptor Chain for Descriptor Blocks (Stop at Last Descriptor)

The responder chain is required when Write-back is enabled for completion status update. A responder block contains 128 x256bits(32 bytes) responder. The SSGDMA IP is designed to have 128 blocks of Responder block, which in return support a maximum responder circular buffer of 128 blocks x 128 x 32 Bytes = 512kByes in size. Each responder block is chained in a manner where the base address of the descriptor block hosted in Responder Table (configurable via Q_RESPONDER_ADDR_L/H).

During the initialization of the queue, the driver needs to form the responder chain and fill up the physical address of the base offset for each block into Responder Table based on the maximum responder blocks configured in Q_RESP_SIZE. During the completion of each descriptor, the SSGDMA IP hardware writes the responder descriptor in sequence. On driver, it polls the " Complete" bit in the responder structure to determine if it is valid. Upon service the responder, it moves on to poll on the next responder's " Complete" bit.

Figure 10. Descriptor Chain for Responder Block
Note: Responder descriptors must not have descriptor IDX of 1 + (n*128), for example, 1, 129, 257, where n = 0, 1, 2,..., 254. These IDX values are dedicated for link descriptors.
The SSGDMA IP uses the concept of INSERT and EXTRACT pointers to keep track availability of descriptors in the ring buffer. When driver pushes descriptor to the ring buffer, the Q_INSERT_POINTER gets updated. Once the SSGDMA IP is done servicing the descriptor, the Q_EXTRACT_POINTER gets updated. With that, the driver can recycle the descriptor entry for new User Descriptor. All descriptors are served when Q_EXTRACT_POINTER is equal to Q_INSERT_POINTER. Otherwise, there are pending descriptors to be served. To avoid overrunning the Q_EXTRACT_POINTER, the driver should always check the availability of empty slot before sending descriptor to the queue.
Figure 11. Illustration of Ring Buffer and its Pointers