Hard Processor System Technical Reference Manual: Agilex™ 5 SoCs

ID 814346
Date 4/01/2024
Public
Document Table of Contents

5.1.6.5.2. DMA Operation with TSO Feature

When the TSO feature is enabled, the TX DMA operation flow is as follows:
  1. The application sets up the transmit descriptor (TDES0-TDES3) and sets the OWN bit (TDES3[31]) after setting up the corresponding data buffers with Ethernet packet data.
  2. The application increases the offset value of the descriptor tail pointer of the DMA TX channel.
  3. While in the run state, the DMA fetches the next available descriptor and does one of the following:
    • If the descriptor is a context descriptor and the context is between the last descriptor of a packet and the first descriptor of the subsequent packet, the DMA stores the context values.
    • If the descriptor is a context descriptor and the context is between the first and last descriptors of a packet, the DMA closes the context descriptor indicating a context descriptor error (TDES3[23]) and fetches the next descriptor.
    • If the descriptor is a normal descriptor, the DMA checks for the TSE bit in the first descriptor (that contains the start of packet). If TSE bit is not set, the DMA continues with the default mode of operation or OSF operation (if enabled).
  4. The DMA calculates the number of segments from the TCP payload length (TDES3[17:0]) and the MSS value.
  5. The DMA goes through channel arbitration to fetch the data buffers. The DMA fetches the header and payload separately.
  6. For the first segment, the DMA fetches the header from the system memory and stores it in the TSO memory (if present and when the length of header is not greater than the TSO memory size). Next, the DMA sets the TMWD (TDESC2[30]) bit to disable the external memory writing even if previous conditions are true.

    If the current segmented packet is not the first segment, the DMA fetches the header from the local TSO memory if available. Otherwise, it fetches the header buffer in system memory again, as done for the first segment. For cases when header is not available in TSO memory, the DMA does not close the first descriptor containing the header buffer until the header for last segment is fetched. The TSO first descriptor (with header buffer) is always closed after the last segment.

  7. The required fields in the header bytes are modified/updated as per the segmentation requirements and written into the corresponding MTL TX queue.
  8. The DMA then takes the payload buffer pointer, fetches the MSS number of payload bytes from the system memory and directly pushes it into the MTL TX queue. In case the buffers in the descriptor do not have enough data for the MSS payload (except for the last segment), the DMA closes this descriptor, if this is not the first descriptor.
  9. The DMA jumps to step 3. and repeats the process until the last segment is written into the TX queue.
  10. The DMA closes the last descriptor and also the first descriptor containing the header buffer when it is not stored in TSO memory. The TSO first descriptor (with header buffer) is always closed after the last segment and then moves on to the next packet transfer.
The DMA repeats these steps if more descriptors are available. When no descriptor is available, the DMA enters the suspend state.
Figure 73. TCP Segmentation Offload Flow