Offloading TCP Segmentation Using Context Descriptors lets a driver offload ‘TCP Segmentation’ as well as checksum calculations
What is ‘segmentation’? packet ‘data’ payload TCP header IP header MAC header The sender creates an Ethernet packet – but it’s longer than the LAN allows partial payload TCP header IP header MAC header TCP header IP header MAC header TCP header IP header MAC header partial payload – so our NIC can be programmed to ‘carve it up’ into smaller Ethernet packets
NIC’s segmentation parameters HDRLEN = total length of packet-headers PAYLEN = total length of data to be sent DTALEN = length of packet-buffer content MSS = Maximum Segment Size (w/o hdrs) POPTS = Packet Options
Context descriptor (type 0) IPCSS PAYLEN DTYP =0 MSS IPCSEIPCSOTUCSSTUCSETUCSO TUCMDSTAHDRLEN RSV Legend: IPCSS (IP CheckSum Start)TUCSS (TCP/UDP CheckSum Start) IPCSO (IP CheckSum Offset)TUCSO (TCP/UDP CheckSum Offset) IPCSE (IP CheckSum Ending) TUCSE (TCP/UDP CheckSum Ending) PAYLEN (Payload Length)DTYP (Descriptor Type) TUCMD (TCP/UCP Command)STA (TCP/UDP Status) HDRLEN (Header Length)MSS (Maximum Segment Size) DEXT=1 (Extended Descriptor)
The TUCMD byte IDESNAP DEXT (=1) reserved (=0) RSTSEIPTCP Legend: IDE (Interrupt Delay Enable) SNAP (Sub-Network Access Protocol) DEXT (Descriptor Extension) RS (Report Status) TSE (TCP-Segmentation Enable) IP (Internet Protocol) TCP (Transport Control Protocol) always valid valid only when TSE=1
Context descriptor (type 1) ADDRESS DTALEN DTYP =1 VLANDCMDSTAPOPTS RSV Legend: DTALEN (Data Length) DTYP (Descriptor Type) DCMD (Descriptor Command) STA (Status) RSV (Reserved) POPTS (Packet Options) VLAN (VLAN tag) DEXT=1 (Extended Descriptor)
The DCMD byte IDEVLE DEXT (=1) reserved (=0) RSTSEIFCSEOP Legend: IDE (Interrupt Delay Enable) VLE (VLAN Enable) DEXT (Descriptor Extension) RS (Report Status) TSE (TCP-Segmentation Enable) IFCS (Insert Frame CheckSum) EOP (End Of Packet)) always valid valid only when EOP=1
Context descriptor-pairs The sender accompanies each packet with a Type 0 Context Descriptor and with (one or more ) Type 1 Context Descriptor(s) IPCSS PAYLEN DTYP =0 MSS IPCSEIPCSOTUCSSTUCSETUCSO TUCMDSTAHDRLEN RSV BASE ADDRESS DTALEN DTYP =1 VLANDCMDSTAPOPTS RSV
Internet Protocol Header Leave these fields equal to zero
Transport Control Protocol Header Setup this field with ones-complement sum of words from ‘partial’ pseudo-header
The ‘partial’ pseudo-header Source IP-address Destination IP-address ZERO protocol ID 31 0
64-bit Statistical Counters The NIC’s statistical counters are intended to operate in a ‘clear-upon-read’ manner, but this requires reading the entire register A few of the NIC’s statistical counters are 64-bit registers (even though a CPU may have to access them 32-bits at a time) Examples: TOTL/TOTH, TORL/TORH You must be sure to access both halves!