RDMA/nes: Slight optimization of Ethernet address compare
authorDing Tianhong <dingtianhong@huawei.com>
Wed, 8 Jan 2014 02:53:39 +0000 (10:53 +0800)
committerRoland Dreier <roland@purestorage.com>
Thu, 23 Jan 2014 07:22:26 +0000 (23:22 -0800)
Use the possibly more efficient ether_addr_equal() instead of memcmp().

Signed-off-by: Wang Weidong <wangweidong1@huawei.com>
Signed-off-by: Ding Tianhong <dingtianhong@huawei.com>
Signed-off-by: Roland Dreier <roland@purestorage.com>
drivers/infiniband/hw/nes/nes_cm.c

index 6b29249aa85a9ed59b24df4c5fc42636371b9181..9c9f2f57e960e1803b831aaf1a94b87011822844 100644 (file)
@@ -1354,8 +1354,7 @@ static int nes_addr_resolve_neigh(struct nes_vnic *nesvnic, u32 dst_ip, int arpi
                                  neigh->ha, ntohl(rt->rt_gateway));
 
                        if (arpindex >= 0) {
-                               if (!memcmp(nesadapter->arp_table[arpindex].mac_addr,
-                                           neigh->ha, ETH_ALEN)) {
+                               if (ether_addr_equal(nesadapter->arp_table[arpindex].mac_addr, neigh->ha)) {
                                        /* Mac address same as in nes_arp_table */
                                        goto out;
                                }