Commit 86937fcd authored by Parav Pandit's avatar Parav Pandit Committed by Jason Gunthorpe
Browse files

RDMA/core: Avoid redundant memcpy in rdma_addr_find_l2_eth_by_grh

rdma_resolve_ip already copies 'addr' to its dev_addr argument.
Remove the duplicate memcpy and since it was the only user, remove the
'addr' member from resolve_cb_context.

Signed-off-by: default avatarParav Pandit <>
Reviewed-by: default avatarDaniel Jurgens <>
Signed-off-by: default avatarLeon Romanovsky <>
Signed-off-by: default avatarJason Gunthorpe <>
parent 1c43d5d3
......@@ -744,7 +744,6 @@ void rdma_addr_cancel(struct rdma_dev_addr *addr)
struct resolve_cb_context {
struct rdma_dev_addr *addr;
struct completion comp;
int status;
......@@ -752,9 +751,6 @@ struct resolve_cb_context {
static void resolve_cb(int status, struct sockaddr *src_addr,
struct rdma_dev_addr *addr, void *context)
if (!status)
memcpy(((struct resolve_cb_context *)context)->addr,
addr, sizeof(struct rdma_dev_addr));
((struct resolve_cb_context *)context)->status = status;
complete(&((struct resolve_cb_context *)context)->comp);
......@@ -780,7 +776,6 @@ int rdma_addr_find_l2_eth_by_grh(const union ib_gid *sgid,
dev_addr.bound_dev_if = ndev->ifindex; = &init_net;
ctx.addr = &dev_addr;
ret = rdma_resolve_ip(&self, &sgid_addr._sockaddr, &dgid_addr._sockaddr,
&dev_addr, 1000, resolve_cb, &ctx);
Supports Markdown
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