Skip to content

Commit a2e812e

Browse files
paravmellanoxjgunthorpe
authored andcommitted
net/rds: Use rdma_read_gids to read connection GIDs
Use the newly introduced rdma_read_gids() to read the SGID and DGID for the connection which returns GID correctly for RoCE transport as well. 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]> Acked-by: Santosh Shilimkar <[email protected]> Signed-off-by: Leon Romanovsky <[email protected]> Signed-off-by: Jason Gunthorpe <[email protected]>
1 parent 7a2f64e commit a2e812e

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

net/rds/ib.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -301,13 +301,11 @@ static int rds_ib_conn_info_visitor(struct rds_connection *conn,
301301
memset(&iinfo->dst_gid, 0, sizeof(iinfo->dst_gid));
302302
if (rds_conn_state(conn) == RDS_CONN_UP) {
303303
struct rds_ib_device *rds_ibdev;
304-
struct rdma_dev_addr *dev_addr;
305304

306305
ic = conn->c_transport_data;
307-
dev_addr = &ic->i_cm_id->route.addr.dev_addr;
308306

309-
rdma_addr_get_sgid(dev_addr, (union ib_gid *) &iinfo->src_gid);
310-
rdma_addr_get_dgid(dev_addr, (union ib_gid *) &iinfo->dst_gid);
307+
rdma_read_gids(ic->i_cm_id, (union ib_gid *)&iinfo->src_gid,
308+
(union ib_gid *)&iinfo->dst_gid);
311309

312310
rds_ibdev = ic->rds_ibdev;
313311
iinfo->max_send_wr = ic->i_send_ring.w_nr;

0 commit comments

Comments
 (0)