Skip to contentSkip to conversation

RDMA/bnxt_re: Bug fixes

PATCH Applied Selvin Xavier 2 participants 5 messages May 18, 2023 – May 19, 2023

Subsystems (2)
lore
Share & tools
lore

Selvin Xavier

author maintainer
#0 lore raw

v2 cover RDMA/bnxt_re: Bug fixes

Includes some of the generic bug fixes in bnxt_re driver. Please review and apply.

Thanks,
Selvin Xavier

v1 -> v2:
Dropped 7 patches from this series which
will be posted against for-next branch.

Kalesh AP (3):
RDMA/bnxt_re: Fix a possible memory leak RDMA/bnxt_re: Fix return value of bnxt_re_process_raw_qp_pkt_rx RDMA/bnxt_re: Do not enable congestion control on VFs

 drivers/infiniband/hw/bnxt_re/ib_verbs.c |  2 +-
 drivers/infiniband/hw/bnxt_re/main.c     |  4 ++++
 drivers/infiniband/hw/bnxt_re/qplib_fp.c | 11 ++++++-----
 3 files changed, 11 insertions(+), 6 deletions(-)
Signature · 1 line
2.5.5
author maintainer
#1 lore raw

PATCH v2 1/3 RDMA/bnxt_re: Fix a possible memory leak

From: Kalesh AP <[email protected]>

Inside bnxt_qplib_create_cq(), when the check for NULL DPI fails, driver returns directly without freeing the memory allocated inside bnxt_qplib_alloc_init_hwq() routine.

Fixed this by moving the check for NULL DPI before invoking bnxt_qplib_alloc_init_hwq().

Fixes 1ac5a4047975 ("RDMA/bnxt_re: Add bnxt_re RoCE driver")
---
 drivers/infiniband/hw/bnxt_re/qplib_fp.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)
drivers/infiniband/hw/bnxt_re/qplib_fp.c +6 -5
index f139d4c..8974f62 100644
@@ -2056,6 +2056,12 @@ int bnxt_qplib_create_cq(struct bnxt_qplib_res *res, struct bnxt_qplib_cq *cq)
 	u32 pg_sz_lvl;
 	int rc;
 
+	if (!cq->dpi) {
+		dev_err(&rcfw->pdev->dev,
+			"FP: CREATE_CQ failed due to NULL DPI\n");
+		return -EINVAL;
+	}
+
 	hwq_attr.res = res;
 	hwq_attr.depth = cq->max_wqe;
 	hwq_attr.stride = sizeof(struct cq_base);
@@ -2069,11 +2075,6 @@ int bnxt_qplib_create_cq(struct bnxt_qplib_res *res, struct bnxt_qplib_cq *cq)
 				 CMDQ_BASE_OPCODE_CREATE_CQ,
 				 sizeof(req));
 
-	if (!cq->dpi) {
-		dev_err(&rcfw->pdev->dev,
-			"FP: CREATE_CQ failed due to NULL DPI\n");
-		return -EINVAL;
-	}
 	req.dpi = cpu_to_le32(cq->dpi->dpi);
 	req.cq_handle = cpu_to_le64(cq->cq_handle);
 	req.cq_size = cpu_to_le32(cq->hwq.max_elements);
Signature · 1 line
2.5.5
author maintainer
#2 lore raw

PATCH v2 2/3 RDMA/bnxt_re: Fix return value of bnxt_re_process_raw_qp_pkt_rx

In reply to Selvin Xavier

From: Kalesh AP <[email protected]>

bnxt_re_process_raw_qp_pkt_rx() always return 0 and ignores the return value of bnxt_re_post_send_shadow_qp().

Fixes 1ac5a4047975 ("RDMA/bnxt_re: Add bnxt_re RoCE driver")
---
 drivers/infiniband/hw/bnxt_re/ib_verbs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/infiniband/hw/bnxt_re/ib_verbs.c +1 -1
index e86afec..0b581c2 100644
@@ -3343,7 +3343,7 @@ static int bnxt_re_process_raw_qp_pkt_rx(struct bnxt_re_qp *gsi_qp,
 	/* post data received  in the send queue */
 	rc = bnxt_re_post_send_shadow_qp(rdev, gsi_sqp, swr);
 
-	return 0;
+	return rc;
 }
 
 static void bnxt_re_process_res_rawqp1_wc(struct ib_wc *wc,
Signature · 1 line
2.5.5
author maintainer
#3 lore raw

PATCH v2 3/3 RDMA/bnxt_re: Do not enable congestion control on VFs

In reply to Selvin Xavier

From: Kalesh AP <[email protected]>

Congestion control needs to be enabled only on the PFs. FW fails the command if issued on VFs. Avoid sending the command on VFs.

Fixes f13bcef04ba0 ("RDMA/bnxt_re: Enable congestion control by default")
---
 drivers/infiniband/hw/bnxt_re/main.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/infiniband/hw/bnxt_re/main.c +4 -0
index b9e2f89..e34eccd 100644
@@ -1336,6 +1336,10 @@ static void bnxt_re_setup_cc(struct bnxt_re_dev *rdev, bool enable)
 {
 	struct bnxt_qplib_cc_param cc_param = {};
 
+	/* Do not enable congestion control on VFs */
+	if (rdev->is_virtfn)
+		return;
+
 	/* Currently enabling only for GenP5 adapters */
 	if (!bnxt_qplib_is_chip_gen_p5(rdev->chip_ctx))
 		return;
Signature · 1 line
2.5.5
maintainer Applied
#4 lore raw
In reply to Selvin Xavier
Quoted 6 lines · Selvin Xavier

Includes some of the generic bug fixes in bnxt_re driver. Please review and apply.

Thanks,
Selvin Xavier

Quoted 8 lines

v1 -> v2:
Dropped 7 patches from this series which
will be posted against for-next branch.

Kalesh AP (3):
RDMA/bnxt_re: Fix a possible memory leak RDMA/bnxt_re: Fix return value of bnxt_re_process_raw_qp_pkt_rx RDMA/bnxt_re: Do not enable congestion control on VFs

Applied to for-rc, thanks

Jason