Skip to content

Commit

Permalink
RDMA/bnxt_re: Decrement resource stats correctly
Browse files Browse the repository at this point in the history
rc_qp_count and ud_qp_count is not decremented during qp destroy.
Fix this.

Fixes: cb95709 ("bnxt_re: Update the hw counters for resource stats")
Signed-off-by: Selvin Xavier <selvin.xavier@broadcom.com>
Link: https://lore.kernel.org/r/1695199280-13520-3-git-send-email-selvin.xavier@broadcom.com
Signed-off-by: Leon Romanovsky <leon@kernel.org>
  • Loading branch information
Selvin Xavier authored and Leon Romanovsky committed Sep 21, 2023
1 parent 9fc5f9a commit a83c692
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions drivers/infiniband/hw/bnxt_re/ib_verbs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit a83c692

Please sign in to comment.