patches for DPDK stable branches
 help / color / mirror / Atom feed
* [dpdk-stable] [PATCH 18.11 1/2] net/bnxt: fix checking VNIC in shutdown path
@ 2020-12-03  4:32 Somnath Kotur
  2020-12-03  4:32 ` [dpdk-stable] [PATCH 18.11 2/2] net/bnxt: fix queue release Somnath Kotur
  2020-12-03 16:43 ` [dpdk-stable] [PATCH 18.11 1/2] net/bnxt: fix checking VNIC in shutdown path Kevin Traynor
  0 siblings, 2 replies; 3+ messages in thread
From: Somnath Kotur @ 2020-12-03  4:32 UTC (permalink / raw)
  To: stable; +Cc: Somnath Kotur, Ajit Khaparde

[upstream commit 4b029f02de3a0ce9cdd9a3475b84ca2e42d74281]

Add a couple of NULL pointer checks in bnxt_free_all_filters()
and bnxt_free_vnics() respectively to guard against certain error
injection/recovery scenarios where it was found that the application
was crashing with the bp->vnic_info pointer being NULL.

Fixes: 51fafb89a9a0 ("net/bnxt: get rid of ff pools and use VNIC info array")
Cc: stable@dpdk.org

Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
 drivers/net/bnxt/bnxt_filter.c | 15 +++++++++------
 drivers/net/bnxt/bnxt_vnic.c   |  3 +++
 2 files changed, 12 insertions(+), 6 deletions(-)

diff --git a/drivers/net/bnxt/bnxt_filter.c b/drivers/net/bnxt/bnxt_filter.c
index b64ae1b20e..3dbd004924 100644
--- a/drivers/net/bnxt/bnxt_filter.c
+++ b/drivers/net/bnxt/bnxt_filter.c
@@ -80,6 +80,15 @@ void bnxt_free_all_filters(struct bnxt *bp)
 	struct bnxt_filter_info *filter, *temp_filter;
 	unsigned int i;
 
+	for (i = 0; i < bp->pf.max_vfs; i++) {
+		STAILQ_FOREACH(filter, &bp->pf.vf_info[i].filter, next) {
+			bnxt_hwrm_clear_l2_filter(bp, filter);
+		}
+	}
+
+	if (bp->vnic_info == NULL)
+		return;
+
 	for (i = 0; i < bp->nr_vnics; i++) {
 		vnic = &bp->vnic_info[i];
 		filter = STAILQ_FIRST(&vnic->filter);
@@ -93,12 +102,6 @@ void bnxt_free_all_filters(struct bnxt *bp)
 		}
 		STAILQ_INIT(&vnic->filter);
 	}
-
-	for (i = 0; i < bp->pf.max_vfs; i++) {
-		STAILQ_FOREACH(filter, &bp->pf.vf_info[i].filter, next) {
-			bnxt_hwrm_clear_l2_filter(bp, filter);
-		}
-	}
 }
 
 void bnxt_free_filter_mem(struct bnxt *bp)
diff --git a/drivers/net/bnxt/bnxt_vnic.c b/drivers/net/bnxt/bnxt_vnic.c
index 30af7a56c8..183a62d94c 100644
--- a/drivers/net/bnxt/bnxt_vnic.c
+++ b/drivers/net/bnxt/bnxt_vnic.c
@@ -78,6 +78,9 @@ void bnxt_free_all_vnics(struct bnxt *bp)
 	struct bnxt_vnic_info *temp;
 	unsigned int i;
 
+	if (bp->vnic_info == NULL)
+		return;
+
 	for (i = 0; i < bp->nr_vnics; i++) {
 		temp = &bp->vnic_info[i];
 		STAILQ_INSERT_TAIL(&bp->free_vnic_list, temp, next);
-- 
2.28.0.497.g54e85e7


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

end of thread, other threads:[~2020-12-03 16:44 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-03  4:32 [dpdk-stable] [PATCH 18.11 1/2] net/bnxt: fix checking VNIC in shutdown path Somnath Kotur
2020-12-03  4:32 ` [dpdk-stable] [PATCH 18.11 2/2] net/bnxt: fix queue release Somnath Kotur
2020-12-03 16:43 ` [dpdk-stable] [PATCH 18.11 1/2] net/bnxt: fix checking VNIC in shutdown path Kevin Traynor

patches for DPDK stable branches

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://inbox.dpdk.org/stable/0 stable/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 stable stable/ https://inbox.dpdk.org/stable \
		stable@dpdk.org
	public-inbox-index stable

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.stable


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git