]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
RDMA/bnxt_re: Don't fail destroy QP and cleanup debugfs earlier
authorKalesh AP <kalesh-anakkur.purayil@broadcom.com>
Wed, 4 Dec 2024 07:54:16 +0000 (13:24 +0530)
committerLeon Romanovsky <leon@kernel.org>
Thu, 5 Dec 2024 08:59:44 +0000 (03:59 -0500)
Change bnxt_re_destroy_qp to always return 0 and don't fail
in case of error during destroy.

In addition, delete debugfs QP to earlier stage.

Fixes: d7d54769c042 ("RDMA/bnxt_re: Add debugfs hook in the driver")
Reviewed-by: Kashyap Desai <kashyap.desai@broadcom.com>
Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Signed-off-by: Selvin Xavier <selvin.xavier@broadcom.com>
Link: https://patch.msgid.link/20241204075416.478431-6-kalesh-anakkur.purayil@broadcom.com
Signed-off-by: Leon Romanovsky <leon@kernel.org>
drivers/infiniband/hw/bnxt_re/ib_verbs.c

index 5428a1408ceeead9c008df2ce65db1165e5db4f6..215074c0860b865b0e68fc42ba8842800b97f70c 100644 (file)
@@ -967,13 +967,13 @@ int bnxt_re_destroy_qp(struct ib_qp *ib_qp, struct ib_udata *udata)
        unsigned int flags;
        int rc;
 
+       bnxt_re_debug_rem_qpinfo(rdev, qp);
+
        bnxt_qplib_flush_cqn_wq(&qp->qplib_qp);
 
        rc = bnxt_qplib_destroy_qp(&rdev->qplib_res, &qp->qplib_qp);
-       if (rc) {
+       if (rc)
                ibdev_err(&rdev->ibdev, "Failed to destroy HW QP");
-               return rc;
-       }
 
        if (rdma_is_kernel_res(&qp->ib_qp.res)) {
                flags = bnxt_re_lock_cqs(qp);
@@ -983,11 +983,8 @@ int bnxt_re_destroy_qp(struct ib_qp *ib_qp, struct ib_udata *udata)
 
        bnxt_qplib_free_qp_res(&rdev->qplib_res, &qp->qplib_qp);
 
-       if (ib_qp->qp_type == IB_QPT_GSI && rdev->gsi_ctx.gsi_sqp) {
-               rc = bnxt_re_destroy_gsi_sqp(qp);
-               if (rc)
-                       return rc;
-       }
+       if (ib_qp->qp_type == IB_QPT_GSI && rdev->gsi_ctx.gsi_sqp)
+               bnxt_re_destroy_gsi_sqp(qp);
 
        mutex_lock(&rdev->qp_lock);
        list_del(&qp->list);
@@ -998,8 +995,6 @@ int bnxt_re_destroy_qp(struct ib_qp *ib_qp, struct ib_udata *udata)
        else if (qp->qplib_qp.type == CMDQ_CREATE_QP_TYPE_UD)
                atomic_dec(&rdev->stats.res.ud_qp_count);
 
-       bnxt_re_debug_rem_qpinfo(rdev, qp);
-
        ib_umem_release(qp->rumem);
        ib_umem_release(qp->sumem);