Skip to content

Commit 7622b0c

Browse files
pkannojuSomasundaram Krishnasamy
authored andcommitted
net/rds: Extract dest qp num for displaying in rds-info
This patch extracts the source and destination qp number during the completion of an rds connection establishment and are saved in newly defined variables. These values are being passed to the user-space rds-info application when needed, for display in its output. Orabug: 31880142 Suggested-by: Rama Nichanamatlu <[email protected]> Signed-off-by: Praveen Kumar Kannoju <[email protected]> Reviewed-by: Alan Maguire <[email protected]> Signed-off-by: Somasundaram Krishnasamy <[email protected]>
1 parent 6db1938 commit 7622b0c

File tree

4 files changed

+22
-4
lines changed

4 files changed

+22
-4
lines changed

include/uapi/linux/rds.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -291,9 +291,10 @@ struct rds_info_rdma_connection {
291291
uint32_t frag;
292292
uint16_t flow_ctl_post_credit;
293293
uint16_t flow_ctl_send_credit;
294-
uint32_t qp_num;
294+
int32_t qp_num;
295295
uint32_t w_alloc_ctr;
296296
uint32_t w_free_ctr;
297+
int32_t dst_qp_num;
297298

298299
};
299300

@@ -314,9 +315,10 @@ struct rds6_info_rdma_connection {
314315
uint32_t frag;
315316
uint16_t flow_ctl_post_credit;
316317
uint16_t flow_ctl_send_credit;
317-
uint32_t qp_num;
318+
int32_t qp_num;
318319
uint32_t w_alloc_ctr;
319320
uint32_t w_free_ctr;
321+
int32_t dst_qp_num;
320322
};
321323

322324
/*

net/rds/ib.c

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -541,6 +541,9 @@ static int rds_ib_conn_info_visitor(struct rds_connection *conn,
541541
memset(&iinfo->src_gid, 0, sizeof(iinfo->src_gid));
542542
memset(&iinfo->dst_gid, 0, sizeof(iinfo->dst_gid));
543543

544+
iinfo->qp_num = -1;
545+
iinfo->dst_qp_num = -1;
546+
544547
if (ic) {
545548
iinfo->tos = conn->c_tos;
546549
iinfo->sl = ic->i_sl;
@@ -557,7 +560,8 @@ static int rds_ib_conn_info_visitor(struct rds_connection *conn,
557560
iinfo->max_send_wr = ic->i_send_ring.w_nr;
558561
iinfo->max_recv_wr = ic->i_recv_ring.w_nr;
559562
iinfo->max_send_sge = rds_ibdev->max_sge;
560-
iinfo->qp_num = ic->i_cm_id->qp->qp_num;
563+
iinfo->qp_num = ic->i_qp_num;
564+
iinfo->dst_qp_num = ic->i_dst_qp_num;
561565
iinfo->w_alloc_ctr = ic->i_recv_ring.w_alloc_ctr;
562566
iinfo->w_free_ctr =
563567
(u32)atomic_read(&ic->i_recv_ring.w_free_ctr);
@@ -589,6 +593,9 @@ static int rds6_ib_conn_info_visitor(struct rds_connection *conn,
589593
memset(&iinfo6->src_gid, 0, sizeof(iinfo6->src_gid));
590594
memset(&iinfo6->dst_gid, 0, sizeof(iinfo6->dst_gid));
591595

596+
iinfo6->qp_num = -1;
597+
iinfo6->dst_qp_num = -1;
598+
592599
if (ic) {
593600
iinfo6->tos = conn->c_tos;
594601
iinfo6->sl = ic->i_sl;
@@ -604,7 +611,8 @@ static int rds6_ib_conn_info_visitor(struct rds_connection *conn,
604611
iinfo6->max_send_wr = ic->i_send_ring.w_nr;
605612
iinfo6->max_recv_wr = ic->i_recv_ring.w_nr;
606613
iinfo6->max_send_sge = rds_ibdev->max_sge;
607-
iinfo6->qp_num = ic->i_cm_id->qp->qp_num;
614+
iinfo6->qp_num = ic->i_qp_num;
615+
iinfo6->dst_qp_num = ic->i_dst_qp_num;
608616
iinfo6->w_alloc_ctr = ic->i_recv_ring.w_alloc_ctr;
609617
iinfo6->w_free_ctr =
610618
(u32)atomic_read(&ic->i_recv_ring.w_free_ctr);

net/rds/ib.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,10 @@ struct rds_ib_connection {
291291
atomic_t i_worker_has_rx;
292292
atomic_t i_cq_quiesce;
293293
uint i_irq_local_cpu;
294+
295+
/* qp number info */
296+
s32 i_qp_num;
297+
s32 i_dst_qp_num;
294298
};
295299

296300
/* This assumes that atomic_t is at least 32 bits */

net/rds/ib_cm.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -375,6 +375,10 @@ void rds_ib_cm_connect_complete(struct rds_connection *conn, struct rdma_cm_even
375375
NULL);
376376
}
377377

378+
/* Save the qp number information in the connection details. */
379+
ic->i_qp_num = ic->i_cm_id->qp->qp_num;
380+
ic->i_dst_qp_num = event->param.conn.qp_num;
381+
378382
rds_connect_complete(conn);
379383
}
380384

0 commit comments

Comments
 (0)