net: cxgb3: slight optimization of addr compare
authordingtianhong <dingtianhong@huawei.com>
Mon, 30 Dec 2013 07:40:35 +0000 (15:40 +0800)
committerDavid S. Miller <davem@davemloft.net>
Tue, 31 Dec 2013 21:48:30 +0000 (16:48 -0500)
Use possibly more efficient ether_addr_equal
to instead of memcmp.

Cc: Santosh Raspatur <santosh@chelsio.com>
Signed-off-by: Ding Tianhong <dingtianhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/chelsio/cxgb3/cxgb3_offload.c
drivers/net/ethernet/chelsio/cxgb3/l2t.c

index 76ae09999b5b86bd15c71da88368eb0a9dea63a7..c0a9dd55f4e55215bb0e42902c12c97b241d0d3f 100644 (file)
@@ -182,7 +182,7 @@ static struct net_device *get_iff_from_mac(struct adapter *adapter,
        for_each_port(adapter, i) {
                struct net_device *dev = adapter->port[i];
 
-               if (!memcmp(dev->dev_addr, mac, ETH_ALEN)) {
+               if (ether_addr_equal(dev->dev_addr, mac)) {
                        rcu_read_lock();
                        if (vlan && vlan != VLAN_VID_MASK) {
                                dev = __vlan_find_dev_deep(dev, htons(ETH_P_8021Q), vlan);
index 8d53438638b20f9dffa3b96c332751aeaf111dcf..5f226eda8cd68751aa7360534f74f59604f88374 100644 (file)
@@ -429,7 +429,7 @@ found:
                } else {
                        e->state = neigh->nud_state & NUD_CONNECTED ?
                            L2T_STATE_VALID : L2T_STATE_STALE;
-                       if (memcmp(e->dmac, neigh->ha, 6))
+                       if (!ether_addr_equal(e->dmac, neigh->ha))
                                setup_l2e_send_pending(dev, NULL, e);
                }
        }