Skip to content

Commit 9be55cf

Browse files
Arumugam Kolappanvijay-suman
authored andcommitted
rds/ib: Preserve dest qp num in the connect request
Commit 227fb00 ("rds/rdma: correctly assign the dest qp num in rds ib connection") fixed the dest qp num issue for the passive side. But if a new connect request comes for an existing connection and if RDS yields to this incoming connection, then it does not preserve the dest qp num. Hence it causes the rds-info command to show a stale destination qp number. This patch fixes the issue by storing the dest qp number from the incoming connect request. Fixes: 227fb00 ("rds/rdma: correctly assign the dest qp num in rds ib connection") Orabug: 35926163 Signed-off-by: Arumugam Kolappan <[email protected]> Reviewed-by: Håkon Bugge <[email protected]>
1 parent 345c3a5 commit 9be55cf

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

net/rds/ib.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,7 @@ struct rds_ib_connection {
293293
u32 version;
294294
u8 responder_resources;
295295
u8 initiator_depth;
296+
s32 dst_qp_num;
296297
} i_alt;
297298

298299
/* Number of wrs available for MR registration(frwr) */

net/rds/ib_cm.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2093,6 +2093,7 @@ int rds_ib_cm_handle_connect(struct rdma_cm_id *cm_id,
20932093
ic->i_alt.cm_id = cm_id;
20942094
ic->i_alt.is_stale = false;
20952095
ic->i_alt.isv6 = isv6;
2096+
ic->i_alt.dst_qp_num = event->param.conn.qp_num;
20962097
memcpy(&ic->i_alt.private_data, dp,
20972098
sizeof(ic->i_alt.private_data));
20982099
ic->i_alt.version = version;
@@ -2128,7 +2129,7 @@ int rds_ib_cm_handle_connect(struct rdma_cm_id *cm_id,
21282129
event->param.conn.initiator_depth);
21292130
if (err)
21302131
reason = "rds_ib_cm_accept failed";
2131-
else if (event->param.conn.qp_num)
2132+
else
21322133
ic->i_dst_qp_num = event->param.conn.qp_num;
21332134
}
21342135

@@ -2331,6 +2332,8 @@ int rds_ib_conn_path_connect(struct rds_conn_path *cp)
23312332
ic->i_alt.responder_resources,
23322333
ic->i_alt.initiator_depth);
23332334

2335+
if (!ret)
2336+
ic->i_dst_qp_num = ic->i_alt.dst_qp_num;
23342337
ic->i_alt.cm_id = NULL;
23352338
mutex_unlock(&conn->c_cm_lock);
23362339

0 commit comments

Comments
 (0)