Skip to content

Commit

Permalink
net/rds: Use rdma_read_gids to get connection SGID/DGID in IPv6
Browse files Browse the repository at this point in the history
In IPv4, the newly introduced rdma_read_gids is used to read the SGID/DGID
for the connection which returns GID correctly for RoCE transport as well.

In IPv6, rdma_read_gids is also used. The following are why rdma_read_gids
is introduced.

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.

So the transport agnostic rdma_read_gids() API is provided by rdma_cm
module.

Signed-off-by: Zhu Yanjun <[email protected]>
Acked-by: Santosh Shilimkar <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
Zhu Yanjun authored and davem330 committed Aug 27, 2018
1 parent ad86198 commit 53ae914
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions net/rds/ib.c
Original file line number Diff line number Diff line change
Expand Up @@ -341,15 +341,10 @@ static int rds6_ib_conn_info_visitor(struct rds_connection *conn,

if (rds_conn_state(conn) == RDS_CONN_UP) {
struct rds_ib_device *rds_ibdev;
struct rdma_dev_addr *dev_addr;

ic = conn->c_transport_data;
dev_addr = &ic->i_cm_id->route.addr.dev_addr;
rdma_addr_get_sgid(dev_addr,
(union ib_gid *)&iinfo6->src_gid);
rdma_addr_get_dgid(dev_addr,
(union ib_gid *)&iinfo6->dst_gid);

rdma_read_gids(ic->i_cm_id, (union ib_gid *)&iinfo6->src_gid,
(union ib_gid *)&iinfo6->dst_gid);
rds_ibdev = ic->rds_ibdev;
iinfo6->max_send_wr = ic->i_send_ring.w_nr;
iinfo6->max_recv_wr = ic->i_recv_ring.w_nr;
Expand Down

0 comments on commit 53ae914

Please sign in to comment.