Skip to content

Commit 227fb00

Browse files
RN97Saeed Mirzamohammadi
authored andcommitted
rds/rdma: correctly assign the dest qp num in rds ib connection
Commit 7622b0c ("net/rds: Extract dest qp num for displaying in rds-info") assigns the dest qp num in rds ib connection during RDMA_CM_EVENT_ESTABLISHED event handling. This works good for active side of the connection. For passive side, the dest qp num is passed in the RDMA_CM_EVENT_CONNECT_REQUEST event. This patch adds the change that sets dest qp num in rds ib connection during RDMA_CM_EVENT_CONNECT_REQUEST event handling. Without this patch, the dest qp num on passive side is set to 0. We can observe this behavior in rds-info -I output. Fixes: 7622b0c ("net/rds: Extract dest qp num for displaying in rds-info") v1->v2: Addressed review comments on where to set dest qp num. Orabug: 34429478 Signed-off-by: Rohit Nair <[email protected]> Reviewed-by: Arumugam Kolappan <[email protected]> Signed-off-by: Saeed Mirzamohammadi <[email protected]>
1 parent f8942b5 commit 227fb00

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

net/rds/ib_cm.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,8 @@ void rds_ib_cm_connect_complete(struct rds_connection *conn, struct rdma_cm_even
394394

395395
/* Save the qp number information in the connection details. */
396396
ic->i_qp_num = ic->i_cm_id->qp->qp_num;
397-
ic->i_dst_qp_num = event->param.conn.qp_num;
397+
if (event->param.conn.qp_num)
398+
ic->i_dst_qp_num = event->param.conn.qp_num;
398399

399400
rds_ib_cancel_cm_watchdog(ic, "connect complete");
400401

@@ -1642,6 +1643,8 @@ int rds_ib_cm_handle_connect(struct rdma_cm_id *cm_id,
16421643
event->param.conn.initiator_depth);
16431644
if (err)
16441645
reason = "rds_ib_cm_accept failed";
1646+
else if (event->param.conn.qp_num)
1647+
ic->i_dst_qp_num = event->param.conn.qp_num;
16451648
}
16461649

16471650
out:

0 commit comments

Comments
 (0)