Skip to contentSkip to conversation

RDMA/qedr: Fix reporting QP timeout attribute

PATCH Applied Kamal Heib 3 participants 3 messages May 25, 2022 – Jun 7, 2022

Subsystems (2)
lore
Share & tools
lore

Kamal Heib

author
#0 lore raw

PATCH 1/1 RDMA/qedr: Fix reporting QP timeout attribute

Make sure to save the passed QP timeout attribute when the QP gets modified, so when calling query QP the right value is reported and not the converted value that is required by the firmware. This issue was found while running the pyverbs tests.

Fixes cecbcddf6461 ("qedr: Add support for QP verbs")
---
 drivers/infiniband/hw/qedr/qedr.h  | 1 +
 drivers/infiniband/hw/qedr/verbs.c | 4 +++-
 2 files changed, 4 insertions(+), 1 deletion(-)
drivers/infiniband/hw/qedr/qedr.h +1 -0
index 8def88cfa300..db9ef3e1eb97 100644
@@ -418,6 +418,7 @@ struct qedr_qp {
 	u32 sq_psn;
 	u32 qkey;
 	u32 dest_qp_num;
+	u8 timeout;
 
 	/* Relevant to qps created from kernel space only (ULPs) */
 	u8 prev_wqe_size;
drivers/infiniband/hw/qedr/verbs.c +3 -1
index f0f43b6db89e..03ed7c0fae50 100644
@@ -2613,6 +2613,8 @@ int qedr_modify_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr,
 					1 << max_t(int, attr->timeout - 8, 0);
 		else
 			qp_params.ack_timeout = 0;
+
+		qp->timeout = attr->timeout;
 	}
 
 	if (attr_mask & IB_QP_RETRY_CNT) {
@@ -2772,7 +2774,7 @@ int qedr_query_qp(struct ib_qp *ibqp,
 	rdma_ah_set_dgid_raw(&qp_attr->ah_attr, &params.dgid.bytes[0]);
 	rdma_ah_set_port_num(&qp_attr->ah_attr, 1);
 	rdma_ah_set_sl(&qp_attr->ah_attr, 0);
-	qp_attr->timeout = params.timeout;
+	qp_attr->timeout = qp->timeout;
 	qp_attr->rnr_retry = params.rnr_retry;
 	qp_attr->retry_cnt = params.retry_cnt;
 	qp_attr->min_rnr_timer = params.min_rnr_nak_timer;
Signature · 1 line
2.34.3
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 54 lines

From: Kamal Heib <[email protected]>
Sent: Wednesday, May 25, 2022 4:20 PM
----------------------------------------------------------------------
Make sure to save the passed QP timeout attribute when the QP gets modified,
so when calling query QP the right value is reported and not the converted value that is required by the firmware. This issue was found while running the pyverbs tests.

Fixes cecbcddf6461 ("qedr: Add support for QP verbs")
---
 drivers/infiniband/hw/qedr/qedr.h  | 1 +
 drivers/infiniband/hw/qedr/verbs.c | 4 +++-
 2 files changed, 4 insertions(+), 1 deletion(-)
drivers/infiniband/hw/qedr/qedr.h +1 -0
index 8def88cfa300..db9ef3e1eb97 100644
@@ -418,6 +418,7 @@ struct qedr_qp {
 	u32 sq_psn;
 	u32 qkey;
 	u32 dest_qp_num;
+	u8 timeout;
 
 	/* Relevant to qps created from kernel space only (ULPs) */
 	u8 prev_wqe_size;
drivers/infiniband/hw/qedr/verbs.c +2 -0
index f0f43b6db89e..03ed7c0fae50 100644
@@ -2613,6 +2613,8 @@ int qedr_modify_qp(struct ib_qp *ibqp, struct
 ib_qp_attr *attr,
 					1 << max_t(int, attr->timeout - 8, 0);
 		else
 			qp_params.ack_timeout = 0;
+
+		qp->timeout = attr->timeout;
 	}
 
drivers/infiniband/hw/qedr/verbs.c +1 -2
 	if (attr_mask & IB_QP_RETRY_CNT) {
@@ -2772,7 +2774,7 @@ int qedr_query_qp(struct ib_qp *ibqp,
 	rdma_ah_set_dgid_raw(&qp_attr->ah_attr, &params.dgid.bytes[0]);
 	rdma_ah_set_port_num(&qp_attr->ah_attr, 1);
 	rdma_ah_set_sl(&qp_attr->ah_attr, 0);
-	qp_attr->timeout = params.timeout;
+	qp_attr->timeout = qp->timeout;
 	qp_attr->rnr_retry = params.rnr_retry;
 	qp_attr->retry_cnt = params.retry_cnt;
 	qp_attr->min_rnr_timer = params.min_rnr_nak_timer;
--
Quoted 1 line

2.34.3

Thanks,

#2 lore raw
In reply to Kamal Heib
Quoted 5 lines · Kamal Heib

Make sure to save the passed QP timeout attribute when the QP gets modified, so when calling query QP the right value is reported and not the converted value that is required by the firmware. This issue was found while running the pyverbs tests.

Quoted 7 lines
Fixes cecbcddf6461 ("qedr: Add support for QP verbs")
---
 drivers/infiniband/hw/qedr/qedr.h  | 1 +
 drivers/infiniband/hw/qedr/verbs.c | 4 +++-
 2 files changed, 4 insertions(+), 1 deletion(-)

Thanks, applied to -rc.