From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: From: David Presotto To: 9fans@cse.psu.edu MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Subject: [9fans] on board IP/TCP/UDP checksums Date: Wed, 12 Feb 2003 13:54:20 -0500 Topicbox-Message-UUID: 59a896d4-eacb-11e9-9e20-41e7f4b1d025 Anyone out there know the details of checksum calculations on various ether chips/cards? Jmk and I are currently sticking in support for hardware checksuming on the intel 82543gc. We created flags in the Block header that mean 'do IP and/or UDP and/or TCP checksum for this packet' outbound to the interface and mean 'IP and/or UDP and/or TCP checksum already done' for incoming packets. We also added a ushort that can be used to carry the whole packet checksum so that we can support v6: /* flag values */ enum { BINTR = (1<<0), BFREE = (1<<1), Bipck = (1<<2), /* ip checksum */ Budpck = (1<<3), /* udp checksum */ Btcpck = (1<<4), /* tcp checksum */ Bpktck = (1<<5), /* packet checksum */ }; struct Block { Block* next; Block* list; uchar* rp; /* first unconsumed byte */ uchar* wp; /* first empty byte */ uchar* lim; /* 1 past the end of the buffer */ uchar* base; /* start of the buffer */ void (*free)(Block*); ushort flag; ushort checksum; /* IP checksum of complete packet (minus media header) */ }; I'm wondering if this will be sufficient for other chips/cards but know nothing about them and would appreciate any elucidation from the community.