All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 for-rc 0/3] RDMA/bnxt_re: Bug fixes
@ 2023-05-18  8:10 Selvin Xavier
  2023-05-18  8:10 ` [PATCH v2 for-rc 1/3] RDMA/bnxt_re: Fix a possible memory leak Selvin Xavier
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Selvin Xavier @ 2023-05-18  8:10 UTC (permalink / raw)
  To: jgg, leon; +Cc: linux-rdma, andrew.gospodarek, Selvin Xavier

[-- Attachment #1: Type: text/plain, Size: 606 bytes --]

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(-)

-- 
2.5.5


[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4224 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH v2 for-rc 1/3] RDMA/bnxt_re: Fix a possible memory leak
  2023-05-18  8:10 [PATCH v2 for-rc 0/3] RDMA/bnxt_re: Bug fixes Selvin Xavier
@ 2023-05-18  8:10 ` Selvin Xavier
  2023-05-18  8:11 ` [PATCH v2 for-rc 2/3] RDMA/bnxt_re: Fix return value of bnxt_re_process_raw_qp_pkt_rx Selvin Xavier
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Selvin Xavier @ 2023-05-18  8:10 UTC (permalink / raw)
  To: jgg, leon; +Cc: linux-rdma, andrew.gospodarek, Kalesh AP, Selvin Xavier

[-- Attachment #1: Type: text/plain, Size: 1660 bytes --]

From: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>

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")
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>
---
 drivers/infiniband/hw/bnxt_re/qplib_fp.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/drivers/infiniband/hw/bnxt_re/qplib_fp.c b/drivers/infiniband/hw/bnxt_re/qplib_fp.c
index f139d4c..8974f62 100644
--- a/drivers/infiniband/hw/bnxt_re/qplib_fp.c
+++ b/drivers/infiniband/hw/bnxt_re/qplib_fp.c
@@ -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);
-- 
2.5.5


[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4224 bytes --]

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH v2 for-rc 2/3] RDMA/bnxt_re: Fix return value of bnxt_re_process_raw_qp_pkt_rx
  2023-05-18  8:10 [PATCH v2 for-rc 0/3] RDMA/bnxt_re: Bug fixes Selvin Xavier
  2023-05-18  8:10 ` [PATCH v2 for-rc 1/3] RDMA/bnxt_re: Fix a possible memory leak Selvin Xavier
@ 2023-05-18  8:11 ` Selvin Xavier
  2023-05-18  8:11 ` [PATCH v2 for-rc 3/3] RDMA/bnxt_re: Do not enable congestion control on VFs Selvin Xavier
  2023-05-19 16:21 ` [PATCH v2 for-rc 0/3] RDMA/bnxt_re: Bug fixes Jason Gunthorpe
  3 siblings, 0 replies; 5+ messages in thread
From: Selvin Xavier @ 2023-05-18  8:11 UTC (permalink / raw)
  To: jgg, leon; +Cc: linux-rdma, andrew.gospodarek, Kalesh AP, Selvin Xavier

[-- Attachment #1: Type: text/plain, Size: 1080 bytes --]

From: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>

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")
Reviewed-by: Hongguang Gao <hongguang.gao@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Signed-off-by: Selvin Xavier <selvin.xavier@broadcom.com>
---
 drivers/infiniband/hw/bnxt_re/ib_verbs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/infiniband/hw/bnxt_re/ib_verbs.c b/drivers/infiniband/hw/bnxt_re/ib_verbs.c
index e86afec..0b581c2 100644
--- a/drivers/infiniband/hw/bnxt_re/ib_verbs.c
+++ b/drivers/infiniband/hw/bnxt_re/ib_verbs.c
@@ -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,
-- 
2.5.5


[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4224 bytes --]

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH v2 for-rc 3/3] RDMA/bnxt_re: Do not enable congestion control on VFs
  2023-05-18  8:10 [PATCH v2 for-rc 0/3] RDMA/bnxt_re: Bug fixes Selvin Xavier
  2023-05-18  8:10 ` [PATCH v2 for-rc 1/3] RDMA/bnxt_re: Fix a possible memory leak Selvin Xavier
  2023-05-18  8:11 ` [PATCH v2 for-rc 2/3] RDMA/bnxt_re: Fix return value of bnxt_re_process_raw_qp_pkt_rx Selvin Xavier
@ 2023-05-18  8:11 ` Selvin Xavier
  2023-05-19 16:21 ` [PATCH v2 for-rc 0/3] RDMA/bnxt_re: Bug fixes Jason Gunthorpe
  3 siblings, 0 replies; 5+ messages in thread
From: Selvin Xavier @ 2023-05-18  8:11 UTC (permalink / raw)
  To: jgg, leon; +Cc: linux-rdma, andrew.gospodarek, Kalesh AP, Selvin Xavier

[-- Attachment #1: Type: text/plain, Size: 1086 bytes --]

From: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>

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")
Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Selvin Thyparampil Xavier <selvin.xavier@broadcom.com>
Signed-off-by: Selvin Xavier <selvin.xavier@broadcom.com>
---
 drivers/infiniband/hw/bnxt_re/main.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/infiniband/hw/bnxt_re/main.c b/drivers/infiniband/hw/bnxt_re/main.c
index b9e2f89..e34eccd 100644
--- a/drivers/infiniband/hw/bnxt_re/main.c
+++ b/drivers/infiniband/hw/bnxt_re/main.c
@@ -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;
-- 
2.5.5


[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4224 bytes --]

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH v2 for-rc 0/3] RDMA/bnxt_re: Bug fixes
  2023-05-18  8:10 [PATCH v2 for-rc 0/3] RDMA/bnxt_re: Bug fixes Selvin Xavier
                   ` (2 preceding siblings ...)
  2023-05-18  8:11 ` [PATCH v2 for-rc 3/3] RDMA/bnxt_re: Do not enable congestion control on VFs Selvin Xavier
@ 2023-05-19 16:21 ` Jason Gunthorpe
  3 siblings, 0 replies; 5+ messages in thread
From: Jason Gunthorpe @ 2023-05-19 16:21 UTC (permalink / raw)
  To: Selvin Xavier; +Cc: leon, linux-rdma, andrew.gospodarek

On Thu, May 18, 2023 at 01:10:58AM -0700, Selvin Xavier wrote:
> 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

Applied to for-rc, thanks

Jason



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-05-19 16:21 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-05-18  8:10 [PATCH v2 for-rc 0/3] RDMA/bnxt_re: Bug fixes Selvin Xavier
2023-05-18  8:10 ` [PATCH v2 for-rc 1/3] RDMA/bnxt_re: Fix a possible memory leak Selvin Xavier
2023-05-18  8:11 ` [PATCH v2 for-rc 2/3] RDMA/bnxt_re: Fix return value of bnxt_re_process_raw_qp_pkt_rx Selvin Xavier
2023-05-18  8:11 ` [PATCH v2 for-rc 3/3] RDMA/bnxt_re: Do not enable congestion control on VFs Selvin Xavier
2023-05-19 16:21 ` [PATCH v2 for-rc 0/3] RDMA/bnxt_re: Bug fixes Jason Gunthorpe

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.