Skip to content

Commit f5f77d6

Browse files
paravmellanoxgerd-rausch
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]> (cherry picked from commit a2e812e) Orabug: 28289486 Signed-off-by: Zhu Yanjun <[email protected]> Reviewed-by: Håkon Bugge <[email protected]>
1 parent 9e41a75 commit f5f77d6

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

net/rds/ib.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -269,14 +269,11 @@ static int rds_ib_conn_info_visitor(struct rds_connection *conn,
269269

270270
if (rds_conn_state(conn) == RDS_CONN_UP) {
271271
struct rds_ib_device *rds_ibdev;
272-
struct rdma_dev_addr *dev_addr;
273272

274273
ic = conn->c_transport_data;
275-
dev_addr = &ic->i_cm_id->route.addr.dev_addr;
276-
rdma_addr_get_sgid(dev_addr,
277-
(union ib_gid *) &iinfo->src_gid);
278-
rdma_addr_get_dgid(dev_addr,
279-
(union ib_gid *) &iinfo->dst_gid);
274+
275+
rdma_read_gids(ic->i_cm_id, (union ib_gid *)&iinfo->src_gid,
276+
(union ib_gid *)&iinfo->dst_gid);
280277

281278
rds_ibdev = ic->rds_ibdev;
282279
iinfo->max_send_wr = ic->i_send_ring.w_nr;

0 commit comments

Comments
 (0)