Scalable Scatter-Gather DMA Intel® FPGA IP User Guide

ID 823097
Date 1/27/2025
Public
Document Table of Contents

5.1.2. Responders 

Responders are also stored in the host memory as an array. The IP writes to the responder array, when writeback mode is enabled. However, the link descriptors do not have a responder. Hence, the responder array is not “in sync” with the descriptor array. 

Q_SIZE and Q_RESP_SIZE = 2
Table 64.  Descriptors  
 sw_idx Description  hw_idx
Block 1

Link Descriptor 

Data Descriptor 1 

Data Descriptor 2 

<n> 

Data Descriptor <n>

<n+1> 

127 

Data Descriptor 127 

128 

Block 2 

128 

Data Descriptor 128

129 

129 

Data Descriptor 129

130 

<n> 

Data Descriptor <n>

<n+1> 

255 

Data Descriptor 255 

256 

Table 65.  Responders
 sw_idx Description  hw_idx
Block 1

Responder 1 

Responder 2

Responder 3 4

<n> 

Responder <n+1>

<n+2> 

125 Responder 126 127
126 Responder 127 128

127 

Responder 128

130 

Block 2 

128 

Responder 129

131 

129 

Responder 130

132 

130 Responder 131 133

<n> 

Responder <n+1>

<n+2> 

252 Responder 253 255
253 Responder 254 256
254 Responder 255 2

255 

Responder 256

The driver also provides a responder tracking index (sw_extract_hw_idx). This index ensures that all responders are evaluated by the software. 

Responder wrap around

The sw_idx cannot be derived from hw_idx when the responder wrap around occurs, because within the responder array, there is the same hardware index. To solve this, the driver must have a responder counter(resp_ptr_act_idx) to track the completed responder. 

This counter counts each time a responder is completed and is equivalent to sw_idx

Responder block size = 1, with 3 rounds of wrap around.
Software IDX   1st Round 2nd Round 3rd Round
Hardware IDX Hardware IDX Hardware IDX
0 Responder 1 2 3 4
1 Responder 2 3 4 5
2 Responder 3 4 5 6
<n> Responder <n+1> <n+2> <n+3> <n+4>
125 Responder 126 127 128 2
126 Responder 127 128 2 3
127 Responder 128 2 3 4
 

The driver uses another counter(resp_ptr_tmp_idx) to back trace the responder. 

To update this value, call intel_ssgdma_set_resp_ptr_tmp_idx. The input previous_n_resp represents the previously completed responder(resp_ptr_tmp). It can be retrieved from intel_ssgdma_complete_callback or intel_ssgdma_device_port_poll_for_completion. To move to the next resp_ptr_tmp, use intel_ssgdma_get_next_tmp_resp, as this function deals with the wrap around of the responder buffer.