diff options
author | David Miller <davem@davemloft.net> | 2011-12-02 11:52:27 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-12-05 15:20:19 -0500 |
commit | 40e2bb588f7712e4d58191ccc08b716927d9c7d0 (patch) | |
tree | 32bb6a47e965619438923c659eeb45de22b8c6fc /drivers/infiniband | |
parent | c4be62a4d27cf4170c2e0eca5a4f8d6fa84d85e4 (diff) |
infiniband: nes: Use dst's neighbour entry.
Do this instead of performing a by-hand lookup.
Signed-off-by: David S. Miller <davem@davemloft.net>
Acked-by: Roland Dreier <roland@purestorage.com>
Diffstat (limited to 'drivers/infiniband')
-rw-r--r-- | drivers/infiniband/hw/nes/nes_cm.c | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/drivers/infiniband/hw/nes/nes_cm.c b/drivers/infiniband/hw/nes/nes_cm.c index 686667a362cf..b1e6cae5f47e 100644 --- a/drivers/infiniband/hw/nes/nes_cm.c +++ b/drivers/infiniband/hw/nes/nes_cm.c | |||
@@ -1348,7 +1348,8 @@ static int nes_addr_resolve_neigh(struct nes_vnic *nesvnic, u32 dst_ip, int arpi | |||
1348 | else | 1348 | else |
1349 | netdev = nesvnic->netdev; | 1349 | netdev = nesvnic->netdev; |
1350 | 1350 | ||
1351 | neigh = neigh_lookup(&arp_tbl, &rt->rt_gateway, netdev); | 1351 | rcu_read_lock(); |
1352 | neigh = dst_get_neighbour_noref(&rt->dst); | ||
1352 | if (neigh) { | 1353 | if (neigh) { |
1353 | if (neigh->nud_state & NUD_VALID) { | 1354 | if (neigh->nud_state & NUD_VALID) { |
1354 | nes_debug(NES_DBG_CM, "Neighbor MAC address for 0x%08X" | 1355 | nes_debug(NES_DBG_CM, "Neighbor MAC address for 0x%08X" |
@@ -1359,7 +1360,6 @@ static int nes_addr_resolve_neigh(struct nes_vnic *nesvnic, u32 dst_ip, int arpi | |||
1359 | if (!memcmp(nesadapter->arp_table[arpindex].mac_addr, | 1360 | if (!memcmp(nesadapter->arp_table[arpindex].mac_addr, |
1360 | neigh->ha, ETH_ALEN)) { | 1361 | neigh->ha, ETH_ALEN)) { |
1361 | /* Mac address same as in nes_arp_table */ | 1362 | /* Mac address same as in nes_arp_table */ |
1362 | neigh_release(neigh); | ||
1363 | ip_rt_put(rt); | 1363 | ip_rt_put(rt); |
1364 | return rc; | 1364 | return rc; |
1365 | } | 1365 | } |
@@ -1373,15 +1373,11 @@ static int nes_addr_resolve_neigh(struct nes_vnic *nesvnic, u32 dst_ip, int arpi | |||
1373 | dst_ip, NES_ARP_ADD); | 1373 | dst_ip, NES_ARP_ADD); |
1374 | rc = nes_arp_table(nesvnic->nesdev, dst_ip, NULL, | 1374 | rc = nes_arp_table(nesvnic->nesdev, dst_ip, NULL, |
1375 | NES_ARP_RESOLVE); | 1375 | NES_ARP_RESOLVE); |
1376 | } else { | ||
1377 | neigh_event_send(neigh, NULL); | ||
1376 | } | 1378 | } |
1377 | neigh_release(neigh); | ||
1378 | } | ||
1379 | |||
1380 | if ((neigh == NULL) || (!(neigh->nud_state & NUD_VALID))) { | ||
1381 | rcu_read_lock(); | ||
1382 | neigh_event_send(dst_get_neighbour_noref(&rt->dst), NULL); | ||
1383 | rcu_read_unlock(); | ||
1384 | } | 1379 | } |
1380 | rcu_read_unlock(); | ||
1385 | ip_rt_put(rt); | 1381 | ip_rt_put(rt); |
1386 | return rc; | 1382 | return rc; |
1387 | } | 1383 | } |