Data Sheet
Inline Functions—Ethernet Controller I210
311
Before taking advantage of the I210's enhanced checksum off-load capability, a checksum context
must be initialized. For the normal transmit checksum off-load feature this is performed by providing
the device with a Descriptor with TSE = 0b in the TDESD.DCMD field and setting either the TXSM or
IXSM bits in the TDESD.POPTS field. Setting TSE = 0b indicates that the normal checksum context is
being set, as opposed to the segmentation context. For additional details on contexts, refer to
Section 7.2.2.4.
Note: Enabling the checksum off loading capability without first initializing the appropriate
checksum context leads to unpredictable results. CRC appending (TDESC.CMD.IFCS) must be
enabled in TCP/IP checksum mode, since CRC must be inserted by hardware after the
checksum has been calculated.
As mentioned in Section 7.2.2, 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
off-load feature only for a particular traffic type, thereby avoiding the need to read all context
descriptors except for the initial one.
Each checksum operates independently. Insertion of the IP and TCP checksum for each packet are
enabled through the Transmit Data Descriptor POPTS.TSXM and POPTS.IXSM fields, respectively.
7.2.5.1 IP Checksum
Three fields in the Transmit Context Descriptor (TDESC) set the context of the IP checksum off loading
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 DMA'd 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 127. This 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 are unpredictable.
IPLEN specifies the IP header length. Maximum allowed value for this field is 511 Bytes.
MACLEN + IPLEN specify where the IP checksum should stop. This is limited to the first 127 + 511
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 result is unpredictable.
The 16-bit IPv4 Header Checksum is placed at the two bytes starting at MACLEN + 10.
As mentioned in Section 7.2.2.2, Transmit Contexts, 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 off-load feature only for a particular traffic type, thereby avoiding all context
descriptor reads except for the initial one.