]> git.hungrycats.org Git - linux/commit
[NET]: Use pskb_expand_head() instead of skb_copy() in skb_checksum_help().
authorHerbert Xu <herbert@gondor.apana.org.au>
Tue, 24 Aug 2004 10:03:36 +0000 (03:03 -0700)
committerDavid S. Miller <davem@nuts.davemloft.net>
Tue, 24 Aug 2004 10:03:36 +0000 (03:03 -0700)
commit33c1abbe284d50447e0247bc35a4e117640a2988
tree50685602a64f1384700874e74732b77b268383a2
parentaab66c401b583d39dc05dd1d6e9cab50e8df92dd
[NET]: Use pskb_expand_head() instead of skb_copy() in skb_checksum_help().

Here is the patch that you wanted to shoot holes at :)

The idea is simple.  None of the callers of skb_checksum are passing it
skb's which are shared.  They may be cloned however.  But the application
checksum is always in the skb header so there is no need to linearise it.

Supposing all these assumptions are correct, then we can avoid the overhead
of skb_copy() and get away with pskb_expand_head().

If the assumption is wrong, we will find out because
pskb_expand_head() will BUG() if skb_shared() is true.

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