Messages in this thread | | | Date | Sat, 23 Feb 2002 08:34:16 +0100 | From | Andi Kleen <> | Subject | Re: Need some help with IP/TCP Checksum Offload |
| |
On Fri, Feb 22, 2002 at 02:57:22PM -0800, harish.vasudeva@amd.com wrote: > Hi All, > > I am trying to offload checksum calculation to my hardware. What i am doing in my driver (kernel 2.4.6) is : > > dev->features = NETIF_F_IP_CHECKSUM; > > Then, in my start_xmit( ) routine, i am parsing for the right headers & when i get the IP/TCP header, i print out the checksum & it is already the right checksum. When does the OS/Protocol offload this task? Am i missing something here?
For TX the checksum is only offloaded when you set and support NETIF_F_SG as well. Otherwise the stack has to copy anyways and can compute the checksum during the copy operation. Then with NETIF_F_SG the TX checksumming will only be used with sendfile(), because that is the only way to do zero copy for now.
For RX you should set skb->ip_summed and skb->csum. The hardware checksum is more useful in this case.
-Andi - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |