aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorEric Dumazet <eric.dumazet@gmail.com>2009-09-01 01:46:05 -0400
committerDavid S. Miller <davem@davemloft.net>2009-09-01 20:40:25 -0400
commitac06713d55d450cbc9ef871b1b238409238f0fe0 (patch)
treef344bd1ae50b520a148af928c43564fc40e13098 /drivers
parentc3c7432741211bc9f6b072958653647b9d5cdd5d (diff)
macvlan: Use compare_ether_addr_64bits()
To speedup ether addresses compares, we can use compare_ether_addr_64bits() (all operands are guaranteed to be at least 8 bytes long) Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/macvlan.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/net/macvlan.c b/drivers/net/macvlan.c
index f893cd41580a..c85c46d2a309 100644
--- a/drivers/net/macvlan.c
+++ b/drivers/net/macvlan.c
@@ -54,7 +54,7 @@ static struct macvlan_dev *macvlan_hash_lookup(const struct macvlan_port *port,
54 struct hlist_node *n; 54 struct hlist_node *n;
55 55
56 hlist_for_each_entry_rcu(vlan, n, &port->vlan_hash[addr[5]], hlist) { 56 hlist_for_each_entry_rcu(vlan, n, &port->vlan_hash[addr[5]], hlist) {
57 if (!compare_ether_addr(vlan->dev->dev_addr, addr)) 57 if (!compare_ether_addr_64bits(vlan->dev->dev_addr, addr))
58 return vlan; 58 return vlan;
59 } 59 }
60 return NULL; 60 return NULL;
@@ -92,7 +92,7 @@ static int macvlan_addr_busy(const struct macvlan_port *port,
92 * currently in use by the underlying device or 92 * currently in use by the underlying device or
93 * another macvlan. 93 * another macvlan.
94 */ 94 */
95 if (memcmp(port->dev->dev_addr, addr, ETH_ALEN) == 0) 95 if (!compare_ether_addr_64bits(port->dev->dev_addr, addr))
96 return 1; 96 return 1;
97 97
98 if (macvlan_hash_lookup(port, addr)) 98 if (macvlan_hash_lookup(port, addr))
@@ -130,7 +130,7 @@ static void macvlan_broadcast(struct sk_buff *skb,
130 dev->stats.multicast++; 130 dev->stats.multicast++;
131 131
132 nskb->dev = dev; 132 nskb->dev = dev;
133 if (!compare_ether_addr(eth->h_dest, dev->broadcast)) 133 if (!compare_ether_addr_64bits(eth->h_dest, dev->broadcast))
134 nskb->pkt_type = PACKET_BROADCAST; 134 nskb->pkt_type = PACKET_BROADCAST;
135 else 135 else
136 nskb->pkt_type = PACKET_MULTICAST; 136 nskb->pkt_type = PACKET_MULTICAST;