* [PATCH for-next] RDMA/qedr: Fix reporting QP timeout attribute
@ 2022-05-25 13:20 Kamal Heib
2022-05-29 8:25 ` [EXT] " Michal Kalderon
2022-06-07 8:48 ` Leon Romanovsky
0 siblings, 2 replies; 3+ messages in thread
From: Kamal Heib @ 2022-05-25 13:20 UTC (permalink / raw)
To: linux-rdma; +Cc: Michal Kalderon, Ariel Elior, Jason Gunthorpe, 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.
Fixes: cecbcddf6461 ("qedr: Add support for QP verbs")
Signed-off-by: Kamal Heib <kamalheib1@gmail.com>
---
drivers/infiniband/hw/qedr/qedr.h | 1 +
drivers/infiniband/hw/qedr/verbs.c | 4 +++-
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/infiniband/hw/qedr/qedr.h b/drivers/infiniband/hw/qedr/qedr.h
index 8def88cfa300..db9ef3e1eb97 100644
--- a/drivers/infiniband/hw/qedr/qedr.h
+++ b/drivers/infiniband/hw/qedr/qedr.h
@@ -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;
diff --git a/drivers/infiniband/hw/qedr/verbs.c b/drivers/infiniband/hw/qedr/verbs.c
index f0f43b6db89e..03ed7c0fae50 100644
--- a/drivers/infiniband/hw/qedr/verbs.c
+++ b/drivers/infiniband/hw/qedr/verbs.c
@@ -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, ¶ms.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;
--
2.34.3
^ permalink raw reply related [flat|nested] 3+ messages in thread
* RE: [EXT] [PATCH for-next] RDMA/qedr: Fix reporting QP timeout attribute
2022-05-25 13:20 [PATCH for-next] RDMA/qedr: Fix reporting QP timeout attribute Kamal Heib
@ 2022-05-29 8:25 ` Michal Kalderon
2022-06-07 8:48 ` Leon Romanovsky
1 sibling, 0 replies; 3+ messages in thread
From: Michal Kalderon @ 2022-05-29 8:25 UTC (permalink / raw)
To: Kamal Heib, linux-rdma@vger.kernel.org
Cc: Ariel Elior, Jason Gunthorpe, Alok Prasad
> From: Kamal Heib <kamalheib1@gmail.com>
> 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")
> Signed-off-by: Kamal Heib <kamalheib1@gmail.com>
> ---
> drivers/infiniband/hw/qedr/qedr.h | 1 +
> drivers/infiniband/hw/qedr/verbs.c | 4 +++-
> 2 files changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/infiniband/hw/qedr/qedr.h
> b/drivers/infiniband/hw/qedr/qedr.h
> index 8def88cfa300..db9ef3e1eb97 100644
> --- a/drivers/infiniband/hw/qedr/qedr.h
> +++ b/drivers/infiniband/hw/qedr/qedr.h
> @@ -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;
> diff --git a/drivers/infiniband/hw/qedr/verbs.c
> b/drivers/infiniband/hw/qedr/verbs.c
> index f0f43b6db89e..03ed7c0fae50 100644
> --- a/drivers/infiniband/hw/qedr/verbs.c
> +++ b/drivers/infiniband/hw/qedr/verbs.c
> @@ -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, ¶ms.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;
> --
> 2.34.3
Thanks,
Acked-by: Michal Kalderon <michal.kalderon@marvell.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH for-next] RDMA/qedr: Fix reporting QP timeout attribute
2022-05-25 13:20 [PATCH for-next] RDMA/qedr: Fix reporting QP timeout attribute Kamal Heib
2022-05-29 8:25 ` [EXT] " Michal Kalderon
@ 2022-06-07 8:48 ` Leon Romanovsky
1 sibling, 0 replies; 3+ messages in thread
From: Leon Romanovsky @ 2022-06-07 8:48 UTC (permalink / raw)
To: Kamal Heib; +Cc: linux-rdma, Michal Kalderon, Ariel Elior, Jason Gunthorpe
On Wed, May 25, 2022 at 04:20:29PM +0300, Kamal Heib wrote:
> 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")
> Signed-off-by: Kamal Heib <kamalheib1@gmail.com>
> ---
> 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.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-06-07 8:49 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-05-25 13:20 [PATCH for-next] RDMA/qedr: Fix reporting QP timeout attribute Kamal Heib
2022-05-29 8:25 ` [EXT] " Michal Kalderon
2022-06-07 8:48 ` Leon Romanovsky
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox