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 95b8c28..6334285 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;
                }