]> git.proxmox.com Git - mirror_ovs.git/commitdiff
datapath/actions: Mark recalculate_csum as likely in set_ipv6_addr().
authorJarno Rajahalme <jrajahalme@nicira.com>
Mon, 11 Aug 2014 15:38:58 +0000 (08:38 -0700)
committerJarno Rajahalme <jrajahalme@nicira.com>
Mon, 11 Aug 2014 16:02:59 +0000 (09:02 -0700)
The ‘recalculate_csum’ is almost always ‘true’.  It is false only if
the ipv6 nexthdr is an extension header, and a routing header is
found.  For the majority of ipv6 packets this would not be the case,
so this can be marked as 'likely'.

Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com>
Acked-by: Jesse Gross <jesse@nicira.com>
datapath/actions.c

index 4ca86f4206ff0e0c5eb10c354a8f6258860833d8..25c5d772593bddd8aeede65052d62dcb4e41eb97 100644 (file)
@@ -394,7 +394,7 @@ static void set_ipv6_addr(struct sk_buff *skb, u8 l4_proto,
                          __be32 addr[4], const __be32 new_addr[4],
                          bool recalculate_csum)
 {
-       if (recalculate_csum)
+       if (likely(recalculate_csum))
                update_ipv6_checksum(skb, l4_proto, addr, new_addr);
 
        skb_clear_hash(skb);