From: Thomas Graf Date: Sun, 21 Aug 2005 00:25:52 +0000 (-0700) Subject: [IPV4]: Avoid common branch misprediction while checking csum in ip_rcv() X-Git-Tag: v2.6.14-rc1~1035^2~55 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=e9c604227391308b185aa6b14c7f93b0a0c2e51b;p=linux-2.6-omap-h63xx.git [IPV4]: Avoid common branch misprediction while checking csum in ip_rcv() Signed-off-by: Thomas Graf Signed-off-by: David S. Miller --- diff --git a/net/ipv4/ip_input.c b/net/ipv4/ip_input.c index 322b082ede1..6a06e15694d 100644 --- a/net/ipv4/ip_input.c +++ b/net/ipv4/ip_input.c @@ -400,7 +400,7 @@ int ip_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt, 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; len = ntohs(iph->tot_len);