Commit 6b395d31 authored by Kashyap Desai's avatar Kashyap Desai Committed by Jason Gunthorpe
Browse files

RDMA/bnxt_re: Fix budget handling of notification queue

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: cb97b377 ("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: default avatarKashyap Desai <kashyap.desai@broadcom.com>
Signed-off-by: default avatarKalesh AP <kalesh-anakkur.purayil@broadcom.com>
Signed-off-by: default avatarJason Gunthorpe <jgg@nvidia.com>
parent 0af2f6be
Loading
Loading
Loading
Loading
+0 −5
Original line number Diff line number Diff line
@@ -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;
}