Commit e9c60422 authored by Thomas Graf's avatar Thomas Graf Committed by David S. Miller

[IPV4]: Avoid common branch misprediction while checking csum in ip_rcv()

Signed-off-by: default avatarThomas Graf <tgraf@suug.ch>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 58615242
...@@ -400,7 +400,7 @@ int ip_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt, ...@@ -400,7 +400,7 @@ int ip_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt,
iph = skb->nh.iph; iph = skb->nh.iph;
if (ip_fast_csum((u8 *)iph, iph->ihl) != 0) if (unlikely(ip_fast_csum((u8 *)iph, iph->ihl)))
goto inhdr_error; goto inhdr_error;
len = ntohs(iph->tot_len); len = ntohs(iph->tot_len);
......
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