forked from Minki/linux
bnxt_en: Do not modify max IRQ count after RDMA driver requests/frees IRQs.
Calling bnxt_set_max_func_irqs() to modify the max IRQ count requested or
freed by the RDMA driver is flawed. The max IRQ count is checked when
re-initializing the IRQ vectors and this can happen multiple times
during ifup or ethtool -L. If the max IRQ is reduced and the RDMA
driver is operational, we may not initailize IRQs correctly. This
problem shows up on VFs with very small number of MSIX.
There is no other logic that relies on the IRQ count excluding the ones
used by RDMA. So we fix it by just removing the call to subtract or
add the IRQs used by RDMA.
Fixes: a588e4580a
("bnxt_en: Add interface to support RDMA driver.")
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
30e338487a
commit
30f529473e
@ -5919,7 +5919,7 @@ unsigned int bnxt_get_max_func_irqs(struct bnxt *bp)
|
||||
return min_t(unsigned int, hw_resc->max_irqs, hw_resc->max_cp_rings);
|
||||
}
|
||||
|
||||
void bnxt_set_max_func_irqs(struct bnxt *bp, unsigned int max_irqs)
|
||||
static void bnxt_set_max_func_irqs(struct bnxt *bp, unsigned int max_irqs)
|
||||
{
|
||||
bp->hw_resc.max_irqs = max_irqs;
|
||||
}
|
||||
|
@ -1470,7 +1470,6 @@ void bnxt_set_max_func_stat_ctxs(struct bnxt *bp, unsigned int max);
|
||||
unsigned int bnxt_get_max_func_cp_rings(struct bnxt *bp);
|
||||
void bnxt_set_max_func_cp_rings(struct bnxt *bp, unsigned int max);
|
||||
unsigned int bnxt_get_max_func_irqs(struct bnxt *bp);
|
||||
void bnxt_set_max_func_irqs(struct bnxt *bp, unsigned int max);
|
||||
int bnxt_get_avail_msix(struct bnxt *bp, int num);
|
||||
int bnxt_reserve_rings(struct bnxt *bp);
|
||||
void bnxt_tx_disable(struct bnxt *bp);
|
||||
|
@ -169,7 +169,6 @@ static int bnxt_req_msix_vecs(struct bnxt_en_dev *edev, int ulp_id,
|
||||
edev->ulp_tbl[ulp_id].msix_requested = avail_msix;
|
||||
}
|
||||
bnxt_fill_msix_vecs(bp, ent);
|
||||
bnxt_set_max_func_irqs(bp, bnxt_get_max_func_irqs(bp) - avail_msix);
|
||||
bnxt_set_max_func_cp_rings(bp, max_cp_rings - avail_msix);
|
||||
edev->flags |= BNXT_EN_FLAG_MSIX_REQUESTED;
|
||||
return avail_msix;
|
||||
@ -192,7 +191,6 @@ static int bnxt_free_msix_vecs(struct bnxt_en_dev *edev, int ulp_id)
|
||||
msix_requested = edev->ulp_tbl[ulp_id].msix_requested;
|
||||
bnxt_set_max_func_cp_rings(bp, max_cp_rings + msix_requested);
|
||||
edev->ulp_tbl[ulp_id].msix_requested = 0;
|
||||
bnxt_set_max_func_irqs(bp, bnxt_get_max_func_irqs(bp) + msix_requested);
|
||||
edev->flags &= ~BNXT_EN_FLAG_MSIX_REQUESTED;
|
||||
if (netif_running(dev)) {
|
||||
bnxt_close_nic(bp, true, false);
|
||||
|
Loading…
Reference in New Issue
Block a user