Blame SOURCES/0033-netdrv-bnxt_en-Fix-VNIC-accounting-when-enabling-aRF.patch

f95c89
From a14a9a4590a264a697d4749b4ec88ffbb9a6bc2f Mon Sep 17 00:00:00 2001
f95c89
From: Jonathan Toppins <jtoppins@redhat.com>
f95c89
Date: Wed, 2 Oct 2019 18:22:48 -0400
f95c89
Subject: [PATCH 33/96] [netdrv] bnxt_en: Fix VNIC accounting when enabling
f95c89
 aRFS on 57500 chips
f95c89
f95c89
Message-id: <7579696a1f5495cda9cfb3e7b819d0ce20cc022b.1570027456.git.jtoppins@redhat.com>
f95c89
Patchwork-id: 276453
f95c89
O-Subject: [RHEL-8.2 PATCH 26/78] bnxt_en: Fix VNIC accounting when enabling aRFS on 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
Unlike legacy chips, 57500 chips don't need additional VNIC resources
f95c89
for aRFS/ntuple.  Fix the code accordingly so that we don't reserve
f95c89
and allocate additional VNICs on 57500 chips.  Without this patch,
f95c89
the driver is failing to initialize when it tries to allocate extra
f95c89
VNICs.
f95c89
f95c89
Fixes: ac33906c67e2 ("bnxt_en: Add support for aRFS on 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 9b3d15e6b05e0b916be5fbd915f90300a403098b)
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 | 7 +++++--
f95c89
 1 file changed, 5 insertions(+), 2 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.697522450 +0100
f95c89
+++ src/drivers/net/ethernet/broadcom/bnxt/bnxt.c	2020-02-06 16:23:14.827521257 +0100
f95c89
@@ -3080,7 +3080,7 @@
f95c89
 	int num_vnics = 1;
f95c89
 
f95c89
 #ifdef CONFIG_RFS_ACCEL
f95c89
-	if (bp->flags & BNXT_FLAG_RFS)
f95c89
+	if ((bp->flags & (BNXT_FLAG_RFS | BNXT_FLAG_CHIP_P5)) == BNXT_FLAG_RFS)
f95c89
 		num_vnics += bp->rx_nr_rings;
f95c89
 #endif
f95c89
 
f95c89
@@ -7191,6 +7191,9 @@
f95c89
 #ifdef CONFIG_RFS_ACCEL
f95c89
 	int i, rc = 0;
f95c89
 
f95c89
+	if (bp->flags & BNXT_FLAG_CHIP_P5)
f95c89
+		return 0;
f95c89
+
f95c89
 	for (i = 0; i < bp->rx_nr_rings; i++) {
f95c89
 		struct bnxt_vnic_info *vnic;
f95c89
 		u16 vnic_id = i + 1;
f95c89
@@ -9650,7 +9653,7 @@
f95c89
 		return -ENOMEM;
f95c89
 
f95c89
 	vnics = 1;
f95c89
-	if (bp->flags & BNXT_FLAG_RFS)
f95c89
+	if ((bp->flags & (BNXT_FLAG_RFS | BNXT_FLAG_CHIP_P5)) == BNXT_FLAG_RFS)
f95c89
 		vnics += rx_rings;
f95c89
 
f95c89
 	if (bp->flags & BNXT_FLAG_AGG_RINGS)