lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  PHC 
Open Source and information security mailing list archives
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Fri, 5 Sep 2008 10:37:31 -0700
From:	"prodyut hazarika" <>
To:	"Ben Dooks" <>
Subject: Re: include/linux/skbuff.h: checksumming documentation

> The first line does not make sense, and the rest of it is an
> unslightly rant about hardware manufacturers.

The documentation is kind of confusing.
It took me some time to figure this whole thing out.

Note that Linux TCP stack does not support IP checksum offload.
Only TCP/UDP offload is supported - but to confuse all we have skb->ipsummed,
which in reality holds the L4 partial checksum state.
Also, note that the stack always does the L4 pseudo header calculation,
even though the underlying device might be able to perform it. Only
the L4 payload
checksum is offloaded to the device.

The driver exports its capability using the features flag (eg. NETIF_F_HW_CSUM).
In transmit path, Linux TCP stack calculates the L4 partial checksum
(pseudo-header only),
and puts the partial checksum in skb->csum. Look at tcp_v4_send_check.
CHECKSUM_PARTIAL means that the device is capable of performing
partial L4 checksum offload.
The emac driver then grabs this partial checksum and XORs it with the
checksum over the data,
puts this new checksum in the tcp packet header, and sends the packet out.

For RX side, if the driver is capable of computing the complete L4
checksum, it marks
skb->ipsummed = CHECKSUM_UNNECESARY. If it computes the partial L4 checksum,
it puts the partial L4 checksum in skb->csum and marks ip_summed as
The tcp stack then XORs this value with the psuedo header.
See tcp_v4_checksum_init() which is called from tcp_v4_rcv

> I will have to research what the chip does with checksumming on IP
> fragments as, IIRC, the UDP and TCP checksums cover the entriety of
> the data before fragmentation.
Look at Intel e1000 driver to understand checksum offload.

Prodyut Hazarika
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to
More majordomo info at

Powered by blists - more mailing lists