Hard Processor System Technical Reference Manual: Agilex™ 5 SoCs

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

5.1.6.3.6. Header Payload Split Support

This feature supports splitting the packet header and the payload of received packets in separate buffers (buffer 1 and buffer 2). You can enable the split header feature by selecting the enable split header structure option and setting the SPH bit in the DMA_CH(#i)_Control register.

The HDSMS field of MAC_Rx_Configuration register indicates maximum header size allowed for splitting the header data in the received packet based on the value programmed. When the ARBS field of the DMA_CH(#i)_Rx_Control2 register is programmed to a non-zero value, ARBS field indicates receive buffer size for buffer 1 and the RBSZ field indicates the receive buffer size for buffer 2. The ARBS field width is 7 bits for data width of 64 bits and 6 bits for data width of 128 bits. The granularity is in data width. The ARBS field can be set to 0, for backward compatibility.

The value in the HDSMS field must be less than or equal to the buffer 1 size indicated by the ARBS field, for all the channels. The following table shows how DMA processes a packet based on the packet type.
Table 144.  Header Payload Split Support Depending on the Packet Type
Packet Type SPLM Description
TCP or UDP packet 00 (L3/L4 split) The DMA writes the Ethernet header + IP header + TCP or UDP header into the header buffer.
IP packet (not TCP/UDP) The DMA writes the Ethernet header + IP header into the header buffer.
Non-IP packet The DMA does not split the header and payload
Any packet 01 (L2 split) The DMA writes the Ethernet header based on split offset (SPLOFST) into the header buffer.
IP packet 10 (Combination of L2 or L3/L4 split) L3/L4 split
Non-IP packet L2 split
NA 11 Reserved
The IP header includes IPv4 options in case of IPv4 packet and IPv6 extension headers in case of IPv6 frames. The points at which the header is split are shown in the following figure.
Figure 68. Header Split Points
Note:
  • The VLAN tag stripping must be set for the split function. For instance, the DMA separates the header and payload of an untagged packet only. So, when a tagged packet is received, you must program the EMAC such that the VLAN tags are deleted/stripped from the received packets.
  • L3/L4 split is applicable for IP packets that are either untagged or VLAN stripped. If VLAN tag is retained in the packet is forwarded to the DMA, L3-L4 split is not performed. However, if SPLM field is set to 2, L2 split is performed for VLAN tagged IP packets.
  • For AV packets, to specify an alternative L2 split value, use the SAVE and SAVO fields of the MAC_Ext1_Cfg register.
  • L2 Split is not supported for packets with variable preamble.
The table below shows the header length availability (HL) in RDES2. This field is valid only when FD = 1 (first descriptor).
Table 145.  Header Length Availability in RDES2
Value of FD Value of LD Header Length (HL) Availability in RDES2
0 1 HL not available
1 0 HL is [9:0]
1 1
  • IP packets, HL is [9:0]
  • Non-IP packets, HL is [9:2]

Descriptor Structure

The following figure shows the descriptor structure without the split header feature.

Figure 69. Descriptors without Split Header Feature

The following figure shows the descriptor structure with the split header feature.

Figure 70. Descriptors with Split Header Feature

The DMA writes the header of the received packet by using the header address to which the RDES0 in the first descriptor is pointing (FD bit of RDES3 is set). The DMA writes the payload of the received packet into the buffer address to which the RDES2 is pointing. For subsequent descriptors (FD is set to 0), the address to which RDES0 (Header address) is pointing is not used. The payload is written only to buffers to which the RDES2 (payload address) is pointing.

The DMA writes the header length in RDES2 of the first receive descriptor (RDES3[29], FD bit is set) for the packet. The packet length is written in RDES3 of the last receive descriptor (RDES3[28], LD bit is set). The buffer length for the payload is set by the driver through the RBSZ field in the corresponding DMA channel receive control register. The DMA fills receive buffers fully in all except the last descriptor. The maximum header length is limited by the value programmed in the HDSMS field of MAC_Rx_Configuration register.

The following figure shows the descriptor structure with the Split Header feature for a tunneled packet.
Figure 71. Descriptors with Split Header for Tunneled Packets

The header of outer packet and inner packet are part of data written in the header buffer. Only the payload of the inner packet is written into the buffers pointed by RDES2.