RDMA/bnxt_re: Fix budget handling of notification queue
authorKashyap Desai <kashyap.desai@broadcom.com>
Mon, 24 Mar 2025 04:09:35 +0000 (09:39 +0530)
committerJason Gunthorpe <jgg@nvidia.com>
Mon, 7 Apr 2025 17:53:02 +0000 (14:53 -0300)
The cited commit in Fixes tag introduced a bug which can cause hang
of completion queue processing because of notification queue budget
goes to zero.

Found while doing nfs over rdma mount and umount.
Below message is noticed because of the existing bug.

kernel: cm_destroy_id_wait_timeout: cm_id=00000000ff6c6cc6 timed out. state 11 -> 0, refcnt=1

Fix to handle this issue -
Driver will not change nq->budget upon create and destroy of cq and srq
rdma resources.

Fixes: cb97b377a135 ("RDMA/bnxt_re: Refurbish CQ to NQ hash calculation")
Link: https://patch.msgid.link/r/20250324040935.90182-1-kalesh-anakkur.purayil@broadcom.com
Signed-off-by: Kashyap Desai <kashyap.desai@broadcom.com>
Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
drivers/infiniband/hw/bnxt_re/ib_verbs.c

index 9082b3fd2b47292473c6623b8c83a64b9a2d39c9..e14b05cd089ab093d735cfe04405086740d72daa 100644 (file)
@@ -1785,8 +1785,6 @@ int bnxt_re_destroy_srq(struct ib_srq *ib_srq, struct ib_udata *udata)
        bnxt_qplib_destroy_srq(&rdev->qplib_res, qplib_srq);
        ib_umem_release(srq->umem);
        atomic_dec(&rdev->stats.res.srq_count);
-       if (nq)
-               nq->budget--;
        return 0;
 }
 
@@ -1908,8 +1906,6 @@ int bnxt_re_create_srq(struct ib_srq *ib_srq,
                        goto fail;
                }
        }
-       if (nq)
-               nq->budget++;
        active_srqs = atomic_inc_return(&rdev->stats.res.srq_count);
        if (active_srqs > rdev->stats.res.srq_watermark)
                rdev->stats.res.srq_watermark = active_srqs;
@@ -3079,7 +3075,6 @@ int bnxt_re_destroy_cq(struct ib_cq *ib_cq, struct ib_udata *udata)
        ib_umem_release(cq->umem);
 
        atomic_dec(&rdev->stats.res.cq_count);
-       nq->budget--;
        kfree(cq->cql);
        return 0;
 }