Blame SOURCES/0034-netdrv-bnxt_en-Fix-VNIC-clearing-logic-for-57500-chi.patch

f95c89
From dbe4cfd4c9843b1273f200131b94a525b58081ae Mon Sep 17 00:00:00 2001
f95c89
From: Jonathan Toppins <jtoppins@redhat.com>
f95c89
Date: Wed, 2 Oct 2019 18:22:49 -0400
f95c89
Subject: [PATCH 34/96] [netdrv] bnxt_en: Fix VNIC clearing logic for 57500
f95c89
 chips
f95c89
f95c89
Message-id: <35f3ca679fd3fa079ba85558e610e106471c630f.1570027456.git.jtoppins@redhat.com>
f95c89
Patchwork-id: 276449
f95c89
O-Subject: [RHEL-8.2 PATCH 27/78] bnxt_en: Fix VNIC clearing logic for 57500 chips.
f95c89
Bugzilla: 1724766
f95c89
RH-Acked-by: John Linville <linville@redhat.com>
f95c89
RH-Acked-by: Jarod Wilson <jarod@redhat.com>
f95c89
f95c89
During device shutdown, the VNIC clearing sequence needs to be modified
f95c89
to free the VNIC first before freeing the RSS contexts.  The current
f95c89
code is doing the reverse and we can get mis-directed RX completions
f95c89
to CP ring ID 0 when the RSS contexts are freed and zeroed.  The clearing
f95c89
of RSS contexts is not required with the new sequence.
f95c89
f95c89
Refactor the VNIC clearing logic into a new function bnxt_clear_vnic()
f95c89
and do the chip specific VNIC clearing sequence.
f95c89
f95c89
Fixes: 7b3af4f75b81 ("bnxt_en: Add RSS support for 57500 chips.")
f95c89
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
f95c89
Signed-off-by: David S. Miller <davem@davemloft.net>
f95c89
(cherry picked from commit a46ecb116fb7f722fa8cb2da01959c36e4e10c41)
f95c89
Bugzilla: 1724766
f95c89
Build Info: https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=23809532
f95c89
Tested: build, boot, basic ping
f95c89
Signed-off-by: Jonathan Toppins <jtoppins@redhat.com>
f95c89
Signed-off-by: Bruno Meneguele <bmeneg@redhat.com>
f95c89
---
f95c89
 drivers/net/ethernet/broadcom/bnxt/bnxt.c | 26 ++++++++++++++++++--------
f95c89
 1 file changed, 18 insertions(+), 8 deletions(-)
f95c89
f95c89
Index: src/drivers/net/ethernet/broadcom/bnxt/bnxt.c
f95c89
===================================================================
f95c89
--- src.orig/drivers/net/ethernet/broadcom/bnxt/bnxt.c	2020-02-06 16:23:14.827521257 +0100
f95c89
+++ src/drivers/net/ethernet/broadcom/bnxt/bnxt.c	2020-02-06 16:23:14.964520000 +0100
f95c89
@@ -7021,19 +7021,29 @@
f95c89
 		bnxt_hwrm_vnic_set_rss(bp, i, false);
f95c89
 }
f95c89
 
f95c89
-static void bnxt_hwrm_resource_free(struct bnxt *bp, bool close_path,
f95c89
-				    bool irq_re_init)
f95c89
+static void bnxt_clear_vnic(struct bnxt *bp)
f95c89
 {
f95c89
-	if (bp->vnic_info) {
f95c89
-		bnxt_hwrm_clear_vnic_filter(bp);
f95c89
+	if (!bp->vnic_info)
f95c89
+		return;
f95c89
+
f95c89
+	bnxt_hwrm_clear_vnic_filter(bp);
f95c89
+	if (!(bp->flags & BNXT_FLAG_CHIP_P5)) {
f95c89
 		/* clear all RSS setting before free vnic ctx */
f95c89
 		bnxt_hwrm_clear_vnic_rss(bp);
f95c89
 		bnxt_hwrm_vnic_ctx_free(bp);
f95c89
-		/* before free the vnic, undo the vnic tpa settings */
f95c89
-		if (bp->flags & BNXT_FLAG_TPA)
f95c89
-			bnxt_set_tpa(bp, false);
f95c89
-		bnxt_hwrm_vnic_free(bp);
f95c89
 	}
f95c89
+	/* before free the vnic, undo the vnic tpa settings */
f95c89
+	if (bp->flags & BNXT_FLAG_TPA)
f95c89
+		bnxt_set_tpa(bp, false);
f95c89
+	bnxt_hwrm_vnic_free(bp);
f95c89
+	if (bp->flags & BNXT_FLAG_CHIP_P5)
f95c89
+		bnxt_hwrm_vnic_ctx_free(bp);
f95c89
+}
f95c89
+
f95c89
+static void bnxt_hwrm_resource_free(struct bnxt *bp, bool close_path,
f95c89
+				    bool irq_re_init)
f95c89
+{
f95c89
+	bnxt_clear_vnic(bp);
f95c89
 	bnxt_hwrm_ring_free(bp, close_path);
f95c89
 	bnxt_hwrm_ring_grp_free(bp);
f95c89
 	if (irq_re_init) {