Blame SOURCES/_PATCH_RHEL-7_09-12_bnxt_en_Improve_NQ_reservations.patch

8fbaf1
Date: Wed,  5 Jun 2019 13:55:28 -0400
8fbaf1
From: Jonathan Toppins <jtoppins@redhat.com>
8fbaf1
To: rhkernel-list@redhat.com
8fbaf1
Cc: darcari@redhat.com, linville@redhat.com
8fbaf1
Subject: [PATCH RHEL-7 09/12] bnxt_en: Improve NQ reservations.
8fbaf1
8fbaf1
bnxt_need_reserve_rings() determines if any resources have changed and
8fbaf1
requires new reservation with firmware.  The NQ checking is currently
8fbaf1
just an approximation.  Improve the NQ checking logic to make it
8fbaf1
accurate.  NQ reservation is only needed on 57500 PFs.  This fix will
8fbaf1
eliminate unnecessary reservations and will reduce NQ reservations
8fbaf1
when some NQs have been released on 57500 PFs.
8fbaf1
8fbaf1
Fixes: c0b8cda05e1d ("bnxt_en: Fix NQ/CP rings accounting on the new 57500 chips.")
8fbaf1
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
8fbaf1
Signed-off-by: David S. Miller <davem@davemloft.net>
8fbaf1
(cherry picked from commit 01989c6b69d91a0df0af8d5c6b5f33d82a239ae0)
8fbaf1
Bugzilla: 1715161
8fbaf1
Build Info: https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=21964229
8fbaf1
Tested: build and boot
8fbaf1
Signed-off-by: Jonathan Toppins <jtoppins@redhat.com>
8fbaf1
---
8fbaf1
 drivers/net/ethernet/broadcom/bnxt/bnxt.c | 6 ++++--
8fbaf1
 1 file changed, 4 insertions(+), 2 deletions(-)
8fbaf1
8fbaf1
diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
8fbaf1
index 6ab79be9f46d..49a60a713ce4 100644
8fbaf1
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c
8fbaf1
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
8fbaf1
@@ -5489,11 +5489,13 @@ static bool bnxt_need_reserve_rings(struct bnxt *bp)
8fbaf1
 	stat = bnxt_get_func_stat_ctxs(bp);
8fbaf1
 	if (BNXT_NEW_RM(bp) &&
8fbaf1
 	    (hw_resc->resv_rx_rings != rx || hw_resc->resv_cp_rings != cp ||
8fbaf1
-	     hw_resc->resv_irqs < nq || hw_resc->resv_vnics != vnic ||
8fbaf1
-	     hw_resc->resv_stat_ctxs != stat ||
8fbaf1
+	     hw_resc->resv_vnics != vnic || hw_resc->resv_stat_ctxs != stat ||
8fbaf1
 	     (hw_resc->resv_hw_ring_grps != grp &&
8fbaf1
 	      !(bp->flags & BNXT_FLAG_CHIP_P5))))
8fbaf1
 		return true;
8fbaf1
+	if ((bp->flags & BNXT_FLAG_CHIP_P5) && BNXT_PF(bp) &&
8fbaf1
+	    hw_resc->resv_irqs != nq)
8fbaf1
+		return true;
8fbaf1
 	return false;
8fbaf1
 }
8fbaf1
 
8fbaf1
-- 
8fbaf1
2.16.4
8fbaf1
8fbaf1