[dpdk-stable] patch 'net/bnxt: fix error handling in VNIC prepare' has been queued to stable release 20.11.3

luca.boccassi at gmail.com luca.boccassi at gmail.com
Mon Jul 12 15:04:06 CEST 2021


Hi,

FYI, your patch has been queued to stable release 20.11.3

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 07/14/21. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://github.com/bluca/dpdk-stable

This queued commit can be viewed at:
https://github.com/bluca/dpdk-stable/commit/2f6cc4ff5f580eee7aa247558219352c7425120b

Thanks.

Luca Boccassi

---
>From 2f6cc4ff5f580eee7aa247558219352c7425120b Mon Sep 17 00:00:00 2001
From: Kalesh AP <kalesh-anakkur.purayil at broadcom.com>
Date: Mon, 31 May 2021 12:56:39 +0530
Subject: [PATCH] net/bnxt: fix error handling in VNIC prepare

[ upstream commit 4171ac66e5d3e2cef0f8e619b75883f9fe5adf12 ]

Resources should be freed on error conditions. i.e, VNIC and
VNIC context created in HW and memory allocated in
bnxt_vnic_grp_alloc() should be freed.

Added a new function bnxt_vnic_destroy() to do the cleanup.
This lightweight function can be used in flow destroy/flush
path to avoid duplicate code as well.

Fixes: d24610f7bfda ("net/bnxt: allow flow creation when RSS is enabled")

Signed-off-by: Kalesh AP <kalesh-anakkur.purayil at broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur at broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde at broadcom.com>
---
 drivers/net/bnxt/bnxt_flow.c | 18 ++++++++++++++++--
 1 file changed, 16 insertions(+), 2 deletions(-)

diff --git a/drivers/net/bnxt/bnxt_flow.c b/drivers/net/bnxt/bnxt_flow.c
index 83b92845a2..1ef6009bc7 100644
--- a/drivers/net/bnxt/bnxt_flow.c
+++ b/drivers/net/bnxt/bnxt_flow.c
@@ -919,6 +919,19 @@ bnxt_get_l2_filter(struct bnxt *bp, struct bnxt_filter_info *nf,
 	return l2_filter;
 }
 
+static void bnxt_vnic_cleanup(struct bnxt *bp, struct bnxt_vnic_info *vnic)
+{
+	if (vnic->rx_queue_cnt > 1)
+		bnxt_hwrm_vnic_ctx_free(bp, vnic);
+
+	bnxt_hwrm_vnic_free(bp, vnic);
+
+	rte_free(vnic->fw_grp_ids);
+	vnic->fw_grp_ids = NULL;
+
+	vnic->rx_queue_cnt = 0;
+}
+
 static int bnxt_vnic_prep(struct bnxt *bp, struct bnxt_vnic_info *vnic,
 			  const struct rte_flow_action *act,
 			  struct rte_flow_error *error)
@@ -949,8 +962,6 @@ static int bnxt_vnic_prep(struct bnxt *bp, struct bnxt_vnic_info *vnic,
 		goto ret;
 	}
 
-	bp->nr_vnics++;
-
 	/* RSS context is required only when there is more than one RSS ring */
 	if (vnic->rx_queue_cnt > 1) {
 		rc = bnxt_hwrm_vnic_ctx_alloc(bp, vnic, 0);
@@ -986,9 +997,12 @@ static int bnxt_vnic_prep(struct bnxt *bp, struct bnxt_vnic_info *vnic,
 		goto ret;
 	}
 
+	bp->nr_vnics++;
+
 	return 0;
 
 ret:
+	bnxt_vnic_cleanup(bp, vnic);
 	return rc;
 }
 
-- 
2.30.2

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-07-12 13:41:37.445679941 +0100
+++ 0011-net-bnxt-fix-error-handling-in-VNIC-prepare.patch	2021-07-12 13:41:36.190116361 +0100
@@ -1 +1 @@
-From 4171ac66e5d3e2cef0f8e619b75883f9fe5adf12 Mon Sep 17 00:00:00 2001
+From 2f6cc4ff5f580eee7aa247558219352c7425120b Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 4171ac66e5d3e2cef0f8e619b75883f9fe5adf12 ]
+
@@ -15 +16,0 @@
-Cc: stable at dpdk.org
@@ -25 +26 @@
-index d23f8cff6c..03c71732e7 100644
+index 83b92845a2..1ef6009bc7 100644


More information about the stable mailing list