]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
bnxt_en: Cap the msix vector with the max completion rings.
authorMichael Chan <michael.chan@broadcom.com>
Tue, 4 Apr 2017 22:14:17 +0000 (18:14 -0400)
committerSomasundaram Krishnasamy <somasundaram.krishnasamy@oracle.com>
Tue, 11 Jul 2017 00:04:09 +0000 (17:04 -0700)
Orabug: 264025332632559926366387

The current code enables up to the maximum MSIX vectors in the PCIE
config space without considering the max completion rings available.
An MSIX vector is only useful when it has an associated completion
ring, so it is better to cap it.

Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 68a946bb81e07ed0e59a99e0c068d091ed42cc1b)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
Signed-off-by: Somasundaram Krishnasamy <somasundaram.krishnasamy@oracle.com>
drivers/net/ethernet/broadcom/bnxt/bnxt.c

index 13071e97d2f200c8039ebb572f754a5adb8f16c7..a86238cd173308b858a84d486930e5db8e6fa4ae 100644 (file)
@@ -5229,9 +5229,10 @@ static unsigned int bnxt_get_max_func_irqs(struct bnxt *bp)
 {
 #if defined(CONFIG_BNXT_SRIOV)
        if (BNXT_VF(bp))
-               return bp->vf.max_irqs;
+               return min_t(unsigned int, bp->vf.max_irqs,
+                            bp->vf.max_cp_rings);
 #endif
-       return bp->pf.max_irqs;
+       return min_t(unsigned int, bp->pf.max_irqs, bp->pf.max_cp_rings);
 }
 
 void bnxt_set_max_func_irqs(struct bnxt *bp, unsigned int max_irqs)