Subject: hardware checksum busted for Sun NICs
To: None <tech-kern@netbsd.org>
From: Garrett D'Amore <Garrett.Damore@Sun.COM>
List: tech-kern
Date: 07/31/2007 10:04:23
FYI,

I've been working on Solaris, and recently added hardware checksum to
hme.  In the course of this, it became known to me that NetBSD's hme
driver suffers from a flaw (same as mine) involving hardware checksum
(tx side) with tiny packets.  The checksum code is busted for packets
less than 64-bytes in length, due to a limitation in the controller.

Someone might want to look into falling back to software checksum if the
packet to be sent is less than 64-bytes on hme hardware.

Another problem, and this probably occurs with all Sun NICs (hme, gem,
etc.) is that partial checksum doesn't consider UDP vs TCP semantics
when the checksum calculation returns a zero value.

The RFC for UDP says that in this case 0xffff should be substituted for
the 0 value checksum.  For TCP the original zero is passed unmodified
(passing 0xffff is toxic to some TCP implementations.)

I'm not sure what we are going to do about this in Solaris land right
now, but I wanted to make the problem known to NetBSD, since I think it
is impacted by this.

	-- Garrett