Commit 0e4e4220 authored by Stephen Hemminger's avatar Stephen Hemminger Committed by David S. Miller

[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: default avatarStephen Hemminger <shemminger@osdl.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 1b11d78c
...@@ -1167,7 +1167,7 @@ static inline void skb_postpull_rcsum(struct sk_buff *skb, ...@@ -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) static inline int pskb_trim_rcsum(struct sk_buff *skb, unsigned int len)
{ {
if (len >= skb->len) if (likely(len >= skb->len))
return 0; return 0;
if (skb->ip_summed == CHECKSUM_HW) if (skb->ip_summed == CHECKSUM_HW)
skb->ip_summed = CHECKSUM_NONE; skb->ip_summed = CHECKSUM_NONE;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment