Skip to content

Commit 673e40a

Browse files
kadesai16gregkh
authored andcommitted
RDMA/bnxt_re: Fix to remove workload check in SRQ limit path
[ Upstream commit 666bce0 ] There should not be any checks of current workload to set srq_limit value to SRQ hw context. Remove all such workload checks and make a direct call to set srq_limit via doorbell SRQ_ARM. Fixes: 37cb11a ("RDMA/bnxt_re: Add SRQ support for Broadcom adapters") Signed-off-by: Kashyap Desai <kashyap.desai@broadcom.com> Signed-off-by: Saravanan Vajravel <saravanan.vajravel@broadcom.com> Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com> Link: https://patch.msgid.link/20250805101000.233310-3-kalesh-anakkur.purayil@broadcom.com Signed-off-by: Leon Romanovsky <leon@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent ac23dfb commit 673e40a

File tree

3 files changed

+2
-35
lines changed

3 files changed

+2
-35
lines changed

drivers/infiniband/hw/bnxt_re/ib_verbs.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1921,7 +1921,6 @@ int bnxt_re_modify_srq(struct ib_srq *ib_srq, struct ib_srq_attr *srq_attr,
19211921
struct bnxt_re_srq *srq = container_of(ib_srq, struct bnxt_re_srq,
19221922
ib_srq);
19231923
struct bnxt_re_dev *rdev = srq->rdev;
1924-
int rc;
19251924

19261925
switch (srq_attr_mask) {
19271926
case IB_SRQ_MAX_WR:
@@ -1933,11 +1932,8 @@ int bnxt_re_modify_srq(struct ib_srq *ib_srq, struct ib_srq_attr *srq_attr,
19331932
return -EINVAL;
19341933

19351934
srq->qplib_srq.threshold = srq_attr->srq_limit;
1936-
rc = bnxt_qplib_modify_srq(&rdev->qplib_res, &srq->qplib_srq);
1937-
if (rc) {
1938-
ibdev_err(&rdev->ibdev, "Modify HW SRQ failed!");
1939-
return rc;
1940-
}
1935+
bnxt_qplib_srq_arm_db(&srq->qplib_srq.dbinfo, srq->qplib_srq.threshold);
1936+
19411937
/* On success, update the shadow */
19421938
srq->srq_limit = srq_attr->srq_limit;
19431939
/* No need to Build and send response back to udata */

drivers/infiniband/hw/bnxt_re/qplib_fp.c

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -706,7 +706,6 @@ int bnxt_qplib_create_srq(struct bnxt_qplib_res *res,
706706
srq->dbinfo.max_slot = 1;
707707
srq->dbinfo.priv_db = res->dpi_tbl.priv_db;
708708
bnxt_qplib_armen_db(&srq->dbinfo, DBC_DBC_TYPE_SRQ_ARMENA);
709-
srq->arm_req = false;
710709

711710
return 0;
712711
fail:
@@ -716,24 +715,6 @@ int bnxt_qplib_create_srq(struct bnxt_qplib_res *res,
716715
return rc;
717716
}
718717

719-
int bnxt_qplib_modify_srq(struct bnxt_qplib_res *res,
720-
struct bnxt_qplib_srq *srq)
721-
{
722-
struct bnxt_qplib_hwq *srq_hwq = &srq->hwq;
723-
u32 count;
724-
725-
count = __bnxt_qplib_get_avail(srq_hwq);
726-
if (count > srq->threshold) {
727-
srq->arm_req = false;
728-
bnxt_qplib_srq_arm_db(&srq->dbinfo, srq->threshold);
729-
} else {
730-
/* Deferred arming */
731-
srq->arm_req = true;
732-
}
733-
734-
return 0;
735-
}
736-
737718
int bnxt_qplib_query_srq(struct bnxt_qplib_res *res,
738719
struct bnxt_qplib_srq *srq)
739720
{
@@ -775,7 +756,6 @@ int bnxt_qplib_post_srq_recv(struct bnxt_qplib_srq *srq,
775756
struct bnxt_qplib_hwq *srq_hwq = &srq->hwq;
776757
struct rq_wqe *srqe;
777758
struct sq_sge *hw_sge;
778-
u32 count = 0;
779759
int i, next;
780760

781761
spin_lock(&srq_hwq->lock);
@@ -807,15 +787,8 @@ int bnxt_qplib_post_srq_recv(struct bnxt_qplib_srq *srq,
807787

808788
bnxt_qplib_hwq_incr_prod(&srq->dbinfo, srq_hwq, srq->dbinfo.max_slot);
809789

810-
spin_lock(&srq_hwq->lock);
811-
count = __bnxt_qplib_get_avail(srq_hwq);
812-
spin_unlock(&srq_hwq->lock);
813790
/* Ring DB */
814791
bnxt_qplib_ring_prod_db(&srq->dbinfo, DBC_DBC_TYPE_SRQ);
815-
if (srq->arm_req == true && count > srq->threshold) {
816-
srq->arm_req = false;
817-
bnxt_qplib_srq_arm_db(&srq->dbinfo, srq->threshold);
818-
}
819792

820793
return 0;
821794
}

drivers/infiniband/hw/bnxt_re/qplib_fp.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -543,8 +543,6 @@ int bnxt_qplib_enable_nq(struct pci_dev *pdev, struct bnxt_qplib_nq *nq,
543543
srqn_handler_t srq_handler);
544544
int bnxt_qplib_create_srq(struct bnxt_qplib_res *res,
545545
struct bnxt_qplib_srq *srq);
546-
int bnxt_qplib_modify_srq(struct bnxt_qplib_res *res,
547-
struct bnxt_qplib_srq *srq);
548546
int bnxt_qplib_query_srq(struct bnxt_qplib_res *res,
549547
struct bnxt_qplib_srq *srq);
550548
void bnxt_qplib_destroy_srq(struct bnxt_qplib_res *res,

0 commit comments

Comments
 (0)