Skip to content

Commit 7a2f64e

Browse files
paravmellanoxjgunthorpe
authored andcommitted
RDMA/ucma: Use rdma cm API to query GID
Make use of rdma_read_gids() API to read SGID and DGID which returns correct GIDs for RoCE and other transports. rdma_addr_get_dgid() for RoCE for client side connections returns MAC address, instead of DGID. rdma_addr_get_sgid() for RoCE doesn't return correct SGID for IPv6 and when more than one IP address is assigned to the netdevice. Therefore use transport agnostic rdma_read_gids() API provided by rdma_cm module. Signed-off-by: Parav Pandit <[email protected]> Reviewed-by: Daniel Jurgens <[email protected]> Signed-off-by: Leon Romanovsky <[email protected]> Signed-off-by: Jason Gunthorpe <[email protected]>
1 parent 411460a commit 7a2f64e

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

drivers/infiniband/core/ucma.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -944,8 +944,8 @@ static ssize_t ucma_query_gid(struct ucma_context *ctx,
944944
} else {
945945
addr->sib_family = AF_IB;
946946
addr->sib_pkey = (__force __be16) resp.pkey;
947-
rdma_addr_get_sgid(&ctx->cm_id->route.addr.dev_addr,
948-
(union ib_gid *) &addr->sib_addr);
947+
rdma_read_gids(ctx->cm_id, (union ib_gid *)&addr->sib_addr,
948+
NULL);
949949
addr->sib_sid = rdma_get_service_id(ctx->cm_id, (struct sockaddr *)
950950
&ctx->cm_id->route.addr.src_addr);
951951
}
@@ -957,8 +957,8 @@ static ssize_t ucma_query_gid(struct ucma_context *ctx,
957957
} else {
958958
addr->sib_family = AF_IB;
959959
addr->sib_pkey = (__force __be16) resp.pkey;
960-
rdma_addr_get_dgid(&ctx->cm_id->route.addr.dev_addr,
961-
(union ib_gid *) &addr->sib_addr);
960+
rdma_read_gids(ctx->cm_id, NULL,
961+
(union ib_gid *)&addr->sib_addr);
962962
addr->sib_sid = rdma_get_service_id(ctx->cm_id, (struct sockaddr *)
963963
&ctx->cm_id->route.addr.dst_addr);
964964
}

0 commit comments

Comments
 (0)