diff options
author | Stephen Hemminger <shemminger@osdl.org> | 2005-09-08 12:32:03 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2005-09-08 12:32:03 -0700 |
commit | 0e4e4220f10bf8f58a8606f0cb28538088c64b1a (patch) | |
tree | 5700dfd0ceab3b435a7fc91cc25e56bb911ce2a9 | |
parent | 1b11d78cf87a7014f96e5b7fa2e1233cc8081a00 (diff) | |
download | linux-3.10-0e4e4220f10bf8f58a8606f0cb28538088c64b1a.tar.gz linux-3.10-0e4e4220f10bf8f58a8606f0cb28538088c64b1a.tar.bz2 linux-3.10-0e4e4220f10bf8f58a8606f0cb28538088c64b1a.zip |
[NET]: Optimize pskb_trim_rcsum()
Since packets almost never contain extra garbage at the end, it is
worthwhile to optimize for that case.
Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | include/linux/skbuff.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index da7da9c0ed1..2741c0c55e8 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h @@ -1167,7 +1167,7 @@ static inline void skb_postpull_rcsum(struct sk_buff *skb, static inline int pskb_trim_rcsum(struct sk_buff *skb, unsigned int len) { - if (len >= skb->len) + if (likely(len >= skb->len)) return 0; if (skb->ip_summed == CHECKSUM_HW) skb->ip_summed = CHECKSUM_NONE; |