Skip to content

Commit

Permalink
infiniband: nes: Convert nes_addr_resolve_neigh() over to dst_neigh_l…
Browse files Browse the repository at this point in the history
…ookup().

Now we must provide the IP destination address, and a reference has
to be dropped when we're done with the entry.

Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
David Miller committed Jan 26, 2012
1 parent 64b7007 commit e55684f
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions drivers/infiniband/hw/nes/nes_cm.c
Original file line number Diff line number Diff line change
Expand Up @@ -1348,8 +1348,9 @@ static int nes_addr_resolve_neigh(struct nes_vnic *nesvnic, u32 dst_ip, int arpi
else
netdev = nesvnic->netdev;

neigh = dst_neigh_lookup(&rt->dst, &dst_ip);

rcu_read_lock();
neigh = dst_get_neighbour_noref(&rt->dst);
if (neigh) {
if (neigh->nud_state & NUD_VALID) {
nes_debug(NES_DBG_CM, "Neighbor MAC address for 0x%08X"
Expand All @@ -1360,8 +1361,7 @@ static int nes_addr_resolve_neigh(struct nes_vnic *nesvnic, u32 dst_ip, int arpi
if (!memcmp(nesadapter->arp_table[arpindex].mac_addr,
neigh->ha, ETH_ALEN)) {
/* Mac address same as in nes_arp_table */
ip_rt_put(rt);
return rc;
goto out;
}

nes_manage_arp_cache(nesvnic->netdev,
Expand All @@ -1377,7 +1377,12 @@ static int nes_addr_resolve_neigh(struct nes_vnic *nesvnic, u32 dst_ip, int arpi
neigh_event_send(neigh, NULL);
}
}
out:
rcu_read_unlock();

if (neigh)
neigh_release(neigh);

ip_rt_put(rt);
return rc;
}
Expand Down

0 comments on commit e55684f

Please sign in to comment.