Scalable Scatter-Gather DMA Intel® FPGA IP User Guide

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

3.8.4.1. Descriptor Fetch and Status Update Mechanism

Follow these steps to initialize the SSGDMA IP:
  1. Issues soft reset to each device port through q_sw_reset_req in dedicated Q_CTRL register
  2. Issue soft reset the prefetcher through reset_prefetch_engine in CTRL register
Figure 12. Descriptor Fetch and Status Update Flow
The following steps illustrate SSGDMA flow in DMA PCIe mode, starting from software DMA request to data transfer completion:
  1. The User Application sends SSGDMA IP request to the SSGDMA driver.
  2. The SSGDMA Driver receives the request and translates the virtual memory of data buffer to physical memories that may fill up one or multiple descriptors. These descriptors goes to the intended descriptor queue. The driver then pack them into the descriptor block.
  3. The SSGDMA Driver updates the Q_INSERT_POINTER through PCIe link.
  4. When the SSGDMA Prefetcher Engine detects the change in the Q_INSERT_POINTER (updated by software) and Q_EXTRACT_POINTER (managed by Prefetcher Engine), the Prefetcher Engine triggers a read to the descriptor ring in host memory to get a block of descriptor.
  5. The block of descriptors dispatch into the H2D/D2H agent's descriptor FIFO.
  6. The agent's controller detects the presence of descriptor in the descriptor FIFO. The agent's controller reads a descriptor and execute the SSGDMA operation between the data in the host memory and user data. Once the SSGDMA operation completed, the responder gets constructed and get written to the Responder FIFO.
  7. The Prefetcher Engine arbitrates the responder requests from all agents. It retrieves the response from the Responder FIFO and writes the response to the SW Responder Queue if Write-back is enabled. The base address for each responder block is located at the Responder Table (configurable via Q_RESPONDER_ADDR_L/H). Every queue has its own table to host its responder queue addresses.
    Note: Responder write-back is optional and configurable via Q_CTRL registers.
  8. Upon service the responder, the Prefetcher Engine updates the Q_EXTRACT_POINTER based on the response received from the Agent.
  9. The following options is available for the driver to get the Completion status
    1. The Driver can poll for the Q_EXTRACT_POINTER to get the completion status, or
    2. Default option when write-back is enabled — The Driver can poll for the responder descriptor's Complete bit to see if the response is received. Under this mode, the driver can further decode the responder descriptor to get the detailed status of the operation.
  10. For DMA PCIe Mode, the following steps occur if the interrupt is enabled:
    1. The Prefetcher Engine generates the IRQ for the corresponding device port to MSI-X Controller upon receiving dummy completion on the successful write-back response transferred to host.
    2. The IRQ for each device agent are mapped to a dedicated pending bit from the PBA table. The corresponding pending bit is available upon receiving the IRQ from Prefetcher Engine.
    3. The MSI-X Controller detects the assertion of corresponding pending bit from PBA table, and it proceeds to retrieve the information for corresponding vector from the MSI-X table through CSR.
    4. The MSI-X Processor then setup a memory writes TLP with the corresponding message and address information retrieved from MSI-X Table to host provided if Mask bit is not set. Upon issued the memory write TLP, the MSI-X Processor proceeds to clear the corresponding pending bit from the PBA table.
  11. For DMA SoC Mode, the following steps occur if the interrupt is enabled:
    1. The Prefetcher Engine generates the IRQ for the corresponding device port to Interrupt Controller upon receiving dummy completion on the successful write-back response transferred to host.
    2. The Interrupt Controller combines all interrupt status for all device ports into a single interrupt that is connected to the Host. The irq bit of the STATUS register and the corresponding bit of the DEVICE_PORTS_IRQ_STATUS register of Global CSR is set, as well as the corresponding q_irq bits of Q_STATUS registers of Device Port CSR. Upon receiving the interrupt, the Driver polls for irq bit from the STATUS register and polls for DEVICE_PORTS_IRQ_STATUS register to identify which device port requires to be serviced. Then, the driver polls and clears the corresponding q_irq bits of the Device Port CSR registers. Before clearing the q_irq bit of Q_STATUS register, driver should update the Q_EXTRACT_POINTER_ACK to acknowledge that the descriptor has been serviced. This is to ensure that SSGDMA IP can assert the interrupt for descriptor completion by setting the q_desc_completion bit of Q_STATUS register correctly for pending descriptor to be served.

In the event if any unexpected issue or error scenario happened during the descriptor fetching or data fetching, the SSGDMA proceeds to terminate the operation. The write-back response from the corresponding device port is transferred to host and corresponding irq bits is asserted in the CSR registers.