Hardware Checksum support on NetBSD-current(3)


		 * Set up checksum info for this packet.
		if ((status & WRX_ST_IXSM) == 0) {
			if (status & WRX_ST_IPCS) {
				m->m_pkthdr.csum_flags |= M_CSUM_IPv4;
				if (errors & WRX_ER_IPE)
					m->m_pkthdr.csum_flags |=



 * record/packet header in first mbuf of chain; valid if M_PKTHDR set
 * A note about csum_data: For the out-bound direction, the low 16 bits
 * indicates the offset after the L4 header where the final L4 checksum value
 * is to be stored and the high 16 bits is the length of the L3 header (the
 * start of the data to be checksumed).  For the in-bound direction, it is only
 * valid if the M_CSUM_DATA flag is set.  In this case, an L4 checksum has been
 * calculated by hardware, but it is up to software to perform final
 * verification.
 * Note for in-bound TCP/UDP checksums, we expect the csum_data to NOT
 * be bit-wise inverted (the final step in the calculation of an IP
 * checksum) -- this is so we can accumulate the checksum for fragmented
 * packets during reassembly.
struct	pkthdr {
	struct	ifnet *rcvif;		/* rcv interface */
	SLIST_HEAD(packet_tags, m_tag) tags; /* list of packet tags */
	int	len;			/* total packet length */
	int	csum_flags;		/* checksum flags */
	uint32_t csum_data;		/* checksum data */
	u_int	segsz;			/* segment size */


下位16bitがL4 checksum valueへのオフセットで上位16bitがL3ヘッダの長さって言ってる?

csum_flags |= M_CSUM_TCP_UDP_BADはL4 checksum errorなんだろうけれど、
csum_flags |= M_CSUM_TCPv4というのはどういう意味だろう?