In update_mapping(), update m->hw_addr unconditionally.
authorBen Pfaff <blp@nicira.com>
Tue, 11 Nov 2008 20:58:52 +0000 (12:58 -0800)
committerBen Pfaff <blp@nicira.com>
Thu, 13 Nov 2008 20:44:04 +0000 (12:44 -0800)
There is no benefit to comparing it first, since we already know that that
cache line will be dirtied by the assignment to m->used.

datapath/nx_act_snat.c

index 95b8c2836c349d6fbb9aa5dce151ea1677a5fac3..6334285780ab58b98861bb74002a1c74ab1b07c9 100644 (file)
@@ -361,9 +361,7 @@ update_mapping(struct net_bridge_port *p, const struct sk_buff *skb)
        
        list_for_each_entry (m, &sc->mappings, node) {
                if (m->ip_addr == iph->saddr){
-                       if (memcmp(m->hw_addr, eh->h_source, ETH_ALEN)) {
-                               memcpy(m->hw_addr, eh->h_source, ETH_ALEN);
-                       }
+                       memcpy(m->hw_addr, eh->h_source, ETH_ALEN);
                        m->used = jiffies;
                        goto done;
                }