What's the deal with hardware checksum and net.inet.udp.checksum?

gnn at FreeBSD.org gnn at FreeBSD.org
Thu Jul 10 19:54:00 UTC 2008


At Thu, 10 Jul 2008 11:43:23 +0100 (BST),
rwatson wrote:
> 
> On Wed, 9 Jul 2008, gnn at freebsd.org wrote:
> 
> > I would assume that if a card, say the em, has hardware TX checksum that the 
> > UDP checksum could be calculated by the hardware, but this seems not to be 
> > the case.  The manual pages are unhelpful in this regard.
> 
> On the whole, they should be generated in hardware as long as it's
> not administratively disabled with ifconfig, and as long as there
> aren't know bugs in the hardware for the rev you're using.  Just for
> example, hardware checksumming is disabled in software for quite a
> few early 1gbps cards due to bugs in the hardware causing rather
> nasty side effects.  What specific problem are you seeing?  We do do
> a software checksum of the pseudo-header, but the UDP data should be
> checksummed by hardware.
> 
> (The usual test for hardware checksum being enabled on transmit is
> to tcpdump the interface and see tcpdump reporting lots of bad
> checksums, as the BPF capture happens before hardware checksumming
> is run -- in principle on the receive side that shouldn't happen!)
> 

If the sysctl it turned off on the transmitter then the receiving
machine sees UDP checksums of 0.

Best,
George


More information about the freebsd-net mailing list