On 5 Jan, 2015, at 10:06 , Joerg Sonnenberger <joerg%britannica.bec.de@localhost> wrote:
On Fri, Jan 02, 2015 at 05:02:15PM +0100, Martin Husemann wrote:
A strange network problem, reproducable on netbsd-current when using an
ARM device with awge network interface (basically all Allwinner boards)
has been reported to me:
I had a similar problem when connection to my laptop. Disabling
CPU_IN_CKSUM fixes that, so it certainly sounds like a problem with the
ARM specific checksumming rountines.
It is also possible to surmise the corner case in the checksum function
that a 61 byte IP packet might be exercising.
- The ethernet driver appears to receive an ethernet frame into
an mcluster aligned with the start of the mcluster. This leaves
the IP headers in memory with 2 byte (but not 4 byte) address
alignment.
- In ip_input() the alignment is corrected by copying the front
of the packet up into a new mbuf with m_copyup(). If IPv6 is
configured m_copyup() will copy the first 60 bytes (max_protohdr)
of the packet into the new mbuf.
- This leaves the 61 IP byte packet spread across 2 mbufs, the first
with 60 bytes aligned to a 4-byte address and the second with a
single byte located in memory with 2-byte alignment. The latter
is a significant corner case for a function trying to do the
computation in word-sized, word-aligned chunks.
That said, I can't see a problem with the arm checksum code by eye and
I'm not in a position to test for this at the moment.
Dennis Ferguson