IP/TCP/UDP Transmit Checksum Offloading in Non-Segmentation Mode — Intel
®
82575EB
Gigabit Ethernet Controller
324632-003 Intel
®
82575EB Gigabit Ethernet Controller
Revision: 2.1 Software Developer’s Manual and EEPROM Guide
January 2011 159
5.10 IP/TCP/UDP Transmit Checksum
Offloading in Non-Segmentation Mode
The previous section on TCP Segmentation offload describes the IP/TCP/UDP checksum offloading
mechanism used in conjunction with TCP Segmentation. The same underlying mechanism can also be
applied as a standalone feature. The main difference in normal packet mode (non-TCP Segmentation) is
that only the checksum fields in the IP/TCP/UDP headers need to be updated.
Before taking advantage of the 82575’s enhanced checksum offload capability, a checksum context
must be initialized. For the normal transmit checksum offload feature this is performed by providing the
82575 with a TCP/IP Context Descriptor with TUCMD.TSE = 0b. Setting TSE = 0b indicates that the
normal checksum context is being set, as opposed to the segmentation context.
Note: Enabling the checksum offloading capability without first initializing the appropriate
checksum context leads to unpredictable results. CRC appending (DCMD.IFCS) must be
enabled in TCP/IP checksum mode, since CRC must be inserted by hardware after the
checksums have been calculated.
As mentioned in Section 5.7, it is not necessary to set a new context for each new packet. In many
cases, the same checksum context can be used for a majority of the packet stream. In this case, some
performance can be gained by only changing the context on an as needed basis or electing to use the
offload feature only for a particular traffic type, thereby avoiding all context descriptors except for the
initial one.
Each checksum operates independently. Inserting IP and TCP checksums for each packet are enabled
through the Transmit Data Descriptor POPTS.TSXM and POPTS.IXSM fields, respectively.
5.10.1 IP Checksum
Three fields in the Transmit Context Descriptor set the context of the IP checksum offloading feature:
• TUCMD.IPv4
• IPLEN
• MACLEN
TUCMD.IPv4 = 1b specifies that the packet type for this context is IPv4 and that the IP header
checksum should be inserted. TUCMD.IPv4 = 0b indicates that the packet type is IPv6 (or some other
protocol) and that the IP header checksum should not be inserted.
MACLEN specifies the byte offset from the start of the transferred data to the first byte to be included in
the checksum, the start of the IP header. The minimal allowed value for this field is 12. Note that the
maximum value for this field is 255 which is adequate for typical applications.
Note: The MACLEN+IPLEN value needs to be less than the total DMA length for a packet. If this is
not the case, the results will be unpredictable.
IPLEN specifies where the IP checksum should stop. Again, this is limited to the first 256 bytes of the
packet and must be less than or equal to the total length of a given packet. If this is not the case, the
checksum is not inserted.
The 16-bit IPv4 header checksum is placed at the two bytes starting at MACLEN+10.