RDMA/bnxt_re: Bug fixes
Subsystems (2)
Selvin Xavier
maintainercover RDMA/bnxt_re: Bug fixes
Couple of important bug fixes for bnxt_re driver.
Please review and apply
Thanks,
Selvin Xavier
Selvin Xavier (2):
RDMA/bnxt_re: Fix the handling of control path response data RDMA/bnxt_re: Decrement resource stats correctly
drivers/infiniband/hw/bnxt_re/ib_verbs.c | 4 ++++ drivers/infiniband/hw/bnxt_re/qplib_rcfw.c | 11 +++++++++-- 2 files changed, 13 insertions(+), 2 deletions(-)
Signature · 1 line
2.5.5
Selvin Xavier
maintainerPATCH 1/2 RDMA/bnxt_re: Fix the handling of control path response data
Flag that indicate control path command completion should be cleared only after copying the command response data. As soon as the is_in_used flag is clear, the waiting thread can proceed with wrong response data. This wrong data is causing multiple issues like wrong lkey used in data traffic and wrong AH Id etc.
Use a memory barrier to ensure that the response data is copied and visible to the process waiting on a different cpu core before clearing the is_in_used flag.
Clear the is_in_used after copying the command response.
--- drivers/infiniband/hw/bnxt_re/qplib_rcfw.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-)
drivers/infiniband/hw/bnxt_re/qplib_rcfw.c +9 -2
@@ -665,7 +665,6 @@ static int bnxt_qplib_process_qp_event(struct bnxt_qplib_rcfw *rcfw, blocked = cookie &RCFW_CMD_IS_BLOCKING ; cookie &=RCFW_MAX_COOKIE_VALUE ; crsqe = &rcfw->crsqe_tbl[cookie]; - crsqe->is_in_used = false; if (WARN_ONCE(test_bit(FIRMWARE_STALL_DETECTED, &rcfw->cmdq.flags),
@@ -681,8 +680,14 @@ static int bnxt_qplib_process_qp_event(struct bnxt_qplib_rcfw *rcfw,atomic_dec (&rcfw->timeout_send);if (crsqe->is_waiter_alive) { -if (crsqe->resp) +if (crsqe->resp) {memcpy (crsqe->resp, qp_event,sizeof (*qp_event)); +/* Insert write memory barrier to ensure that +* response data is copied before clearing the +* flags +*/ +smp_wmb (); + }if (!blocked) wait_cmds++; }
@@ -694,6 +699,8 @@ static int bnxt_qplib_process_qp_event(struct bnxt_qplib_rcfw *rcfw,if (!is_waiter_alive) crsqe->resp =NULL ; + crsqe->is_in_used = false; + hwq->cons += req_size;/* This is a case to handle below scenario -
Signature · 1 line
2.5.5
Selvin Xavier
maintainerPATCH 2/2 RDMA/bnxt_re: Decrement resource stats correctly
In reply to Selvin Xavierrc_qp_count and ud_qp_count is not decremented during qp destroy. Fix this.
--- drivers/infiniband/hw/bnxt_re/ib_verbs.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/infiniband/hw/bnxt_re/ib_verbs.c +4 -0
@@ -910,6 +910,10 @@ int bnxt_re_destroy_qp(struct ib_qp *ib_qp, struct ib_udata *udata)list_del (&qp->list);mutex_unlock (&rdev->qp_lock);atomic_dec (&rdev->stats.res.qp_count); +if (qp->qplib_qp.type ==CMDQ_CREATE_QP_TYPE_RC ) +atomic_dec (&rdev->stats.res.rc_qp_count); +else if (qp->qplib_qp.type ==CMDQ_CREATE_QP_TYPE_UD ) +atomic_dec (&rdev->stats.res.ud_qp_count);ib_umem_release (qp->rumem);ib_umem_release (qp->sumem);
Signature · 1 line
2.5.5
Leon Romanovsky
AppliedQuoted 11 lines · Selvin Xavier
Couple of important bug fixes for
bnxt_redriver.
Please review and applyThanks,
Selvin XavierSelvin Xavier (2):
RDMA/bnxt_re: Fix the handling of control path response data RDMA/bnxt_re: Decrement resource stats correctly[...]
Applied, thanks!
[1/2] RDMA/bnxt_re: Fix the handling of control path response data
https://git.kernel.org/rdma/rdma/c/9fc5f9a92fe689 [2/2] RDMA/bnxt_re: Decrement resource stats correctly https://git.kernel.org/rdma/rdma/c/a83c6927897522
Best regards,
Signature · 1 line
Leon Romanovsky <[email protected]>