Commit 36d65be9 authored by Michael Chan's avatar Michael Chan Committed by David S. Miller

bnxt_en: Disable MSIX before re-reserving NQs/CMPL rings.

When bringing up a device, the code checks to see if the number of
MSIX has changed.  pci_disable_msix() should be called first before
changing the number of reserved NQs/CMPL rings.  This ensures that
the MSIX vectors associated with the NQs/CMPL rings are still
properly mapped when pci_disable_msix() masks the vectors.

This patch will prevent errors when RDMA support is added for the new
57500 chips.  When the RDMA driver shuts down, the number of NQs is
decreased and we must use the new sequence to prevent MSIX errors.
Signed-off-by: default avatarMichael Chan <michael.chan@broadcom.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 780baad4
...@@ -7241,23 +7241,26 @@ static void bnxt_clear_int_mode(struct bnxt *bp) ...@@ -7241,23 +7241,26 @@ static void bnxt_clear_int_mode(struct bnxt *bp)
int bnxt_reserve_rings(struct bnxt *bp) int bnxt_reserve_rings(struct bnxt *bp)
{ {
int tcs = netdev_get_num_tc(bp->dev); int tcs = netdev_get_num_tc(bp->dev);
bool reinit_irq = false;
int rc; int rc;
if (!bnxt_need_reserve_rings(bp)) if (!bnxt_need_reserve_rings(bp))
return 0; return 0;
rc = __bnxt_reserve_rings(bp);
if (rc) {
netdev_err(bp->dev, "ring reservation failure rc: %d\n", rc);
return rc;
}
if (BNXT_NEW_RM(bp) && (bnxt_get_num_msix(bp) != bp->total_irqs)) { if (BNXT_NEW_RM(bp) && (bnxt_get_num_msix(bp) != bp->total_irqs)) {
bnxt_ulp_irq_stop(bp); bnxt_ulp_irq_stop(bp);
bnxt_clear_int_mode(bp); bnxt_clear_int_mode(bp);
rc = bnxt_init_int_mode(bp); reinit_irq = true;
}
rc = __bnxt_reserve_rings(bp);
if (reinit_irq) {
if (!rc)
rc = bnxt_init_int_mode(bp);
bnxt_ulp_irq_restart(bp, rc); bnxt_ulp_irq_restart(bp, rc);
if (rc) }
return rc; if (rc) {
netdev_err(bp->dev, "ring reservation/IRQ init failure rc: %d\n", rc);
return rc;
} }
if (tcs && (bp->tx_nr_rings_per_tc * tcs != bp->tx_nr_rings)) { if (tcs && (bp->tx_nr_rings_per_tc * tcs != bp->tx_nr_rings)) {
netdev_err(bp->dev, "tx ring reservation failure\n"); netdev_err(bp->dev, "tx ring reservation failure\n");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment