Skip to content

Commit a83c692

Browse files
selvintxavierrleon
authored andcommitted
RDMA/bnxt_re: Decrement resource stats correctly
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 <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Leon Romanovsky <[email protected]>
1 parent 9fc5f9a commit a83c692

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

drivers/infiniband/hw/bnxt_re/ib_verbs.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -910,6 +910,10 @@ int bnxt_re_destroy_qp(struct ib_qp *ib_qp, struct ib_udata *udata)
910910
list_del(&qp->list);
911911
mutex_unlock(&rdev->qp_lock);
912912
atomic_dec(&rdev->stats.res.qp_count);
913+
if (qp->qplib_qp.type == CMDQ_CREATE_QP_TYPE_RC)
914+
atomic_dec(&rdev->stats.res.rc_qp_count);
915+
else if (qp->qplib_qp.type == CMDQ_CREATE_QP_TYPE_UD)
916+
atomic_dec(&rdev->stats.res.ud_qp_count);
913917

914918
ib_umem_release(qp->rumem);
915919
ib_umem_release(qp->sumem);

0 commit comments

Comments
 (0)