Skip to content

Commit 732e73b

Browse files
Kamalheibgregkh
authored andcommitted
RDMA/qedr: Fix reporting QP timeout attribute
commit 118f767 upstream. 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/20220525132029.84813-1-kamalheib1@gmail.com Signed-off-by: Kamal Heib <kamalheib1@gmail.com> Acked-by: Michal Kalderon <michal.kalderon@marvell.com> Signed-off-by: Leon Romanovsky <leonro@nvidia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent c164041 commit 732e73b

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
@@ -2622,6 +2622,8 @@ int qedr_modify_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr,
26222622
1 << max_t(int, attr->timeout - 8, 0);
26232623
else
26242624
qp_params.ack_timeout = 0;
2625+
2626+
qp->timeout = attr->timeout;
26252627
}
26262628

26272629
if (attr_mask & IB_QP_RETRY_CNT) {
@@ -2781,7 +2783,7 @@ int qedr_query_qp(struct ib_qp *ibqp,
27812783
rdma_ah_set_dgid_raw(&qp_attr->ah_attr, &params.dgid.bytes[0]);
27822784
rdma_ah_set_port_num(&qp_attr->ah_attr, 1);
27832785
rdma_ah_set_sl(&qp_attr->ah_attr, 0);
2784-
qp_attr->timeout = params.timeout;
2786+
qp_attr->timeout = qp->timeout;
27852787
qp_attr->rnr_retry = params.rnr_retry;
27862788
qp_attr->retry_cnt = params.retry_cnt;
27872789
qp_attr->min_rnr_timer = params.min_rnr_nak_timer;

0 commit comments

Comments
 (0)