]> git.baikalelectronics.ru Git - kernel.git/commit
[NET]: Avoid copying TCP packets unnecessarily
authorHerbert Xu <herbert@gondor.apana.org.au>
Mon, 15 Oct 2007 08:47:15 +0000 (01:47 -0700)
committerDavid S. Miller <davem@sunset.davemloft.net>
Mon, 15 Oct 2007 19:26:34 +0000 (12:26 -0700)
commitbd8e63ce504d89b6015de3230ae7e48cc969b9c9
tree60beb818cf95e16ab598b8177355eba845fc5015
parent7ba224de177ddace03ea4b573188b436d4766c16
[NET]: Avoid copying TCP packets unnecessarily

TCP packets all have writable heads, that is, even though it's cloned, it is
writable up to the end of the TCP header.  This patch makes skb_checksum_help
aware of this fact by using skb_clone_writable and avoiding a copy for TCP.

I've also modified the BUG_ON tests to be unsigned.  The only case where this
makes a difference is if csum_start points to a location before skb->data.
Since skb->data should always include the header where the checksum field
is (and all currently callers adhere to that), this change is safe and may
uncover bugs later.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/core/dev.c