On Tue, Sep 16, 2003 at 08:09:54AM -0700, Bluesea wrote: > I am also trying to use a NIC with Checksum offload. > I've a question, does the Linux TCP/IP stack calculate > the pseudo-header checksum if skb->ip_summed = > CHECKSUM_HW, or leave it to the driver? Assuming that you are referring to the transmit path, and judging from the impementation of the e100 driver, it seems that the kernel has performed no checksum calculation if ip_summed == CHECKSUM_HW. Either the hardware or the driver has to do it. In the case of e100, the driver does the pseudo-header checksum calculation and the hardware does the rest. if (ip->protocol == IPPROTO_TCP) { struct tcphdr *tcp; tcp = (struct tcphdr *) ((u32 *) ip + ip->ihl); chksum = &(tcp->check); tcb->tcbu.ipcb.ip_schedule |= IPCB_TCP_PACKET; } else { struct udphdr *udp; udp = (struct udphdr *) ((u32 *) ip + ip->ihl); chksum = &(udp->check); } *chksum = e100_pseudo_hdr_csum(ip); What I'm not sure about is whether the kernel or the hardware does the IP-header checksum calculation /npat -- A computer lets you make more mistakes faster than any invention in human history, with the possible exceptions of handguns and tequila. -- Mitch Ratcliffe, Technology Review, April 1992 - : send the line "unsubscribe linux-net" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html