提交 68a946bb 编写于 作者: M Michael Chan 提交者: David S. Miller

bnxt_en: Cap the msix vector with the max completion rings.

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: NMichael Chan <michael.chan@broadcom.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 932dbf83
...@@ -5183,9 +5183,10 @@ static unsigned int bnxt_get_max_func_irqs(struct bnxt *bp) ...@@ -5183,9 +5183,10 @@ static unsigned int bnxt_get_max_func_irqs(struct bnxt *bp)
{ {
#if defined(CONFIG_BNXT_SRIOV) #if defined(CONFIG_BNXT_SRIOV)
if (BNXT_VF(bp)) if (BNXT_VF(bp))
return bp->vf.max_irqs; return min_t(unsigned int, bp->vf.max_irqs,
bp->vf.max_cp_rings);
#endif #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) void bnxt_set_max_func_irqs(struct bnxt *bp, unsigned int max_irqs)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册