Commit 02b61955 authored by David Miller's avatar David Miller Committed by David S. Miller
Browse files

infiniband: Convert dst_fetch_ha() over to dst_neigh_lookup().



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: default avatarDavid S. Miller <davem@davemloft.net>
parent 9b28ecd6
...@@ -178,22 +178,26 @@ static void queue_req(struct addr_req *req) ...@@ -178,22 +178,26 @@ static void queue_req(struct addr_req *req)
mutex_unlock(&lock); mutex_unlock(&lock);
} }
static int dst_fetch_ha(struct dst_entry *dst, struct rdma_dev_addr *addr) static int dst_fetch_ha(struct dst_entry *dst, struct rdma_dev_addr *dev_addr, void *daddr)
{ {
struct neighbour *n; struct neighbour *n;
int ret; int ret;
n = dst_neigh_lookup(dst, daddr);
rcu_read_lock(); rcu_read_lock();
n = dst_get_neighbour_noref(dst);
if (!n || !(n->nud_state & NUD_VALID)) { if (!n || !(n->nud_state & NUD_VALID)) {
if (n) if (n)
neigh_event_send(n, NULL); neigh_event_send(n, NULL);
ret = -ENODATA; ret = -ENODATA;
} else { } else {
ret = rdma_copy_addr(addr, dst->dev, n->ha); ret = rdma_copy_addr(dev_addr, dst->dev, n->ha);
} }
rcu_read_unlock(); rcu_read_unlock();
if (n)
neigh_release(n);
return ret; return ret;
} }
...@@ -232,7 +236,7 @@ static int addr4_resolve(struct sockaddr_in *src_in, ...@@ -232,7 +236,7 @@ static int addr4_resolve(struct sockaddr_in *src_in,
goto put; goto put;
} }
ret = dst_fetch_ha(&rt->dst, addr); ret = dst_fetch_ha(&rt->dst, addr, &fl4.daddr);
put: put:
ip_rt_put(rt); ip_rt_put(rt);
out: out:
...@@ -280,7 +284,7 @@ static int addr6_resolve(struct sockaddr_in6 *src_in, ...@@ -280,7 +284,7 @@ static int addr6_resolve(struct sockaddr_in6 *src_in,
goto put; goto put;
} }
ret = dst_fetch_ha(dst, addr); ret = dst_fetch_ha(dst, addr, &fl6.daddr);
put: put:
dst_release(dst); dst_release(dst);
return ret; return ret;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment