Skip to content

Commit

Permalink
bnxt_en: Cap the msix vector with the max completion rings.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Michael Chan authored and David S. Miller committed Apr 5, 2017
1 parent 932dbf8 commit 68a946b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions drivers/net/ethernet/broadcom/bnxt/bnxt.c
Original file line number Diff line number Diff line change
Expand Up @@ -5183,9 +5183,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)
Expand Down

0 comments on commit 68a946b

Please sign in to comment.