User manual

Table Of Contents
Zynq-7000 AP SoC Technical Reference Manual www.xilinx.com 499
UG585 (v1.11) September 27, 2016
Chapter 16: Gigabit Ethernet Controller
Rx Checksum Offload
When receive checksum offloading is enabled, the IPv4 header checksum is checked per RFC 791,
where the packet meets the following criteria:
If present, the VLAN header must be four octets long and the CFI bit must not be set
Encapsulation must be RFC 894 Ethernet Type encoding or RFC 1042 SNAP encoding
•IPv4 packet
IP header is of a valid length
The controller also checks the TCP checksum per RFC 793, or the UDP checksum per RFC 768, if the
following criteria are met:
•IPv4 or IPv6 packet
Good IP header checksum (if IPv4)
•No IP fragmentation
•TCP or UDP packet
When an IP, TCP, or UDP frame is received, the receive buffer descriptor provides an indication if the
controller was able to verify the checksums. There is also an indication if the frame had LLC SNAP
encapsulation. These indication bits replace the type ID match indication bits when receive checksum
offload is enabled.
If any of the checksums are verified to be incorrect by the controller, the packet is discarded and the
appropriate statistics counter is incremented.
Tx Checksum Offload
The transmitter checksum offload is only available when the full store and forward mode is enabled.
This is because the complete frame to be transmitted must be read into the packet buffer memory
before the checksum can be calculated and written back into the headers at the beginning of the
frame.
Transmitter checksum offload is enabled by setting bit [11] in the DMA Configuration register. When
enabled, it monitors the frame as it is written into the transmitter packet buffer memory to
automatically detect the protocol of the frame. Protocol support is identical to the receiver checksum
offload.
For transmit checksum generation and substitution to occur, the protocol of the frame must be
recognized and the frame must be provided without the FCS field, by ensuring that bit [16] of the
transmit descriptor word 1 is clear. If the frame data already had the FCS field, this would be
corrupted by the substitution of the new checksum fields.
If these conditions are met, the transmit checksum offload engine calculates the IP, TCP, and UDP
checksums as appropriate. When the full packet is completely written into packet buffer memory, the
checksums are valid and the relevant DPRAM locations are updated for the new checksum fields as
per standard IP/TCP and UDP packet structures.