Question on Partial Checksum in TCP/IP

Bharath Madhavan (bharath_madhavan@ivivity.com)
Mon, 4 Jun 2001 18:14:16 -0400


Hello all,
I am trying to understand a little bit about the TCP path in the
Linux kernel.
I saw that while we were even copying the user data into kernel space, we
were doing
the partial checksum of the data portion alone (as the TCP header is not yet
filled up) and storing
it in skb->csum.
Later on when we fill the header portion, we do the checksum of the header
and "add" it to the
already calculated checksum of the data. Here we check if the HW performs
the checksum
or not (skb->ip_summed == CHECKSUM_HW). I am looking into kernel ver 2.4
My question is, why is this check not performed when the data is copied
initially. Instead of
calling csum_and_copy_from_user, if we did a memcpy in the case when HW does
the checksum,
would'nt that be more efficient? Or have I overlooked something...

Thanks a lot

PS. Please CC responses to me also as I am not subscribed to the mailing
list. Thanks

Bharath

-
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/