Skip to content

Commit 118f767

Browse files
Kamalheibrleon
authored andcommitted
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: cecbcdd ("qedr: Add support for QP verbs") Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Kamal Heib <[email protected]> Acked-by: Michal Kalderon <[email protected]> Signed-off-by: Leon Romanovsky <[email protected]>
1 parent f2906aa commit 118f767

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

drivers/infiniband/hw/qedr/qedr.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -418,6 +418,7 @@ struct qedr_qp {
418418
u32 sq_psn;
419419
u32 qkey;
420420
u32 dest_qp_num;
421+
u8 timeout;
421422

422423
/* Relevant to qps created from kernel space only (ULPs) */
423424
u8 prev_wqe_size;

drivers/infiniband/hw/qedr/verbs.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2613,6 +2613,8 @@ int qedr_modify_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr,
26132613
1 << max_t(int, attr->timeout - 8, 0);
26142614
else
26152615
qp_params.ack_timeout = 0;
2616+
2617+
qp->timeout = attr->timeout;
26162618
}
26172619

26182620
if (attr_mask & IB_QP_RETRY_CNT) {
@@ -2772,7 +2774,7 @@ int qedr_query_qp(struct ib_qp *ibqp,
27722774
rdma_ah_set_dgid_raw(&qp_attr->ah_attr, &params.dgid.bytes[0]);
27732775
rdma_ah_set_port_num(&qp_attr->ah_attr, 1);
27742776
rdma_ah_set_sl(&qp_attr->ah_attr, 0);
2775-
qp_attr->timeout = params.timeout;
2777+
qp_attr->timeout = qp->timeout;
27762778
qp_attr->rnr_retry = params.rnr_retry;
27772779
qp_attr->retry_cnt = params.retry_cnt;
27782780
qp_attr->min_rnr_timer = params.min_rnr_nak_timer;

0 commit comments

Comments
 (0)