Commit 2a659a46 authored by Michael Chan's avatar Michael Chan Committed by Jakub Kicinski

bnxt_en: Deprecate support for legacy INTX mode

Firmware has deprecated support for legacy INTX in 2022 (since v2.27)
and INTX hasn't been tested for many years before that.  INTX was
only used as a fallback mechansim in case MSIX wasn't available.  MSIX
is always supported by all firmware.  If MSIX capability in PCI config
space is not found during probe, abort.
Reviewed-by: default avatarHongguang Gao <hongguang.gao@broadcom.com>
Reviewed-by: default avatarKalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: default avatarSomnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: default avatarSimon Horman <horms@kernel.org>
Signed-off-by: default avatarMichael Chan <michael.chan@broadcom.com>
Link: https://patch.msgid.link/20240828183235.128948-5-michael.chan@broadcom.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 26e3846e
...@@ -10770,7 +10770,7 @@ static int bnxt_get_num_msix(struct bnxt *bp) ...@@ -10770,7 +10770,7 @@ static int bnxt_get_num_msix(struct bnxt *bp)
return bnxt_nq_rings_in_use(bp); return bnxt_nq_rings_in_use(bp);
} }
static int bnxt_init_msix(struct bnxt *bp) static int bnxt_init_int_mode(struct bnxt *bp)
{ {
int i, total_vecs, max, rc = 0, min = 1, ulp_msix, tx_cp; int i, total_vecs, max, rc = 0, min = 1, ulp_msix, tx_cp;
struct msix_entry *msix_ent; struct msix_entry *msix_ent;
...@@ -10828,7 +10828,7 @@ static int bnxt_init_msix(struct bnxt *bp) ...@@ -10828,7 +10828,7 @@ static int bnxt_init_msix(struct bnxt *bp)
return 0; return 0;
msix_setup_exit: msix_setup_exit:
netdev_err(bp->dev, "bnxt_init_msix err: %x\n", rc); netdev_err(bp->dev, "bnxt_init_int_mode err: %x\n", rc);
kfree(bp->irq_tbl); kfree(bp->irq_tbl);
bp->irq_tbl = NULL; bp->irq_tbl = NULL;
pci_disable_msix(bp->pdev); pci_disable_msix(bp->pdev);
...@@ -10836,35 +10836,6 @@ static int bnxt_init_msix(struct bnxt *bp) ...@@ -10836,35 +10836,6 @@ static int bnxt_init_msix(struct bnxt *bp)
return rc; return rc;
} }
static int bnxt_init_inta(struct bnxt *bp)
{
bp->irq_tbl = kzalloc(sizeof(struct bnxt_irq), GFP_KERNEL);
if (!bp->irq_tbl)
return -ENOMEM;
bp->total_irqs = 1;
bp->rx_nr_rings = 1;
bp->tx_nr_rings = 1;
bp->cp_nr_rings = 1;
bp->flags |= BNXT_FLAG_SHARED_RINGS;
bp->irq_tbl[0].vector = bp->pdev->irq;
return 0;
}
static int bnxt_init_int_mode(struct bnxt *bp)
{
int rc = -ENODEV;
if (bp->flags & BNXT_FLAG_MSIX_CAP)
rc = bnxt_init_msix(bp);
if (!(bp->flags & BNXT_FLAG_USING_MSIX) && BNXT_PF(bp)) {
/* fallback to INTA */
rc = bnxt_init_inta(bp);
}
return rc;
}
static void bnxt_clear_int_mode(struct bnxt *bp) static void bnxt_clear_int_mode(struct bnxt *bp)
{ {
if (bp->flags & BNXT_FLAG_USING_MSIX) if (bp->flags & BNXT_FLAG_USING_MSIX)
...@@ -12910,7 +12881,7 @@ bool bnxt_rfs_capable(struct bnxt *bp, bool new_rss_ctx) ...@@ -12910,7 +12881,7 @@ bool bnxt_rfs_capable(struct bnxt *bp, bool new_rss_ctx)
!BNXT_SUPPORTS_NTUPLE_VNIC(bp)) !BNXT_SUPPORTS_NTUPLE_VNIC(bp))
return bnxt_rfs_supported(bp); return bnxt_rfs_supported(bp);
if (!(bp->flags & BNXT_FLAG_MSIX_CAP) || !bnxt_can_reserve_rings(bp) || !bp->rx_nr_rings) if (!bnxt_can_reserve_rings(bp) || !bp->rx_nr_rings)
return false; return false;
hwr.grp = bp->rx_nr_rings; hwr.grp = bp->rx_nr_rings;
...@@ -15772,6 +15743,11 @@ static int bnxt_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -15772,6 +15743,11 @@ static int bnxt_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
if (pci_is_bridge(pdev)) if (pci_is_bridge(pdev))
return -ENODEV; return -ENODEV;
if (!pdev->msix_cap) {
dev_err(&pdev->dev, "MSIX capability not found, aborting\n");
return -ENODEV;
}
/* Clear any pending DMA transactions from crash kernel /* Clear any pending DMA transactions from crash kernel
* while loading driver in capture kernel. * while loading driver in capture kernel.
*/ */
...@@ -15798,9 +15774,6 @@ static int bnxt_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -15798,9 +15774,6 @@ static int bnxt_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
if (BNXT_PF(bp)) if (BNXT_PF(bp))
SET_NETDEV_DEVLINK_PORT(dev, &bp->dl_port); SET_NETDEV_DEVLINK_PORT(dev, &bp->dl_port);
if (pdev->msix_cap)
bp->flags |= BNXT_FLAG_MSIX_CAP;
rc = bnxt_init_board(pdev, dev); rc = bnxt_init_board(pdev, dev);
if (rc < 0) if (rc < 0)
goto init_err_free; goto init_err_free;
......
...@@ -2200,7 +2200,6 @@ struct bnxt { ...@@ -2200,7 +2200,6 @@ struct bnxt {
#define BNXT_FLAG_AGG_RINGS (BNXT_FLAG_JUMBO | BNXT_FLAG_GRO | \ #define BNXT_FLAG_AGG_RINGS (BNXT_FLAG_JUMBO | BNXT_FLAG_GRO | \
BNXT_FLAG_LRO) BNXT_FLAG_LRO)
#define BNXT_FLAG_USING_MSIX 0x40 #define BNXT_FLAG_USING_MSIX 0x40
#define BNXT_FLAG_MSIX_CAP 0x80
#define BNXT_FLAG_RFS 0x100 #define BNXT_FLAG_RFS 0x100
#define BNXT_FLAG_SHARED_RINGS 0x200 #define BNXT_FLAG_SHARED_RINGS 0x200
#define BNXT_FLAG_PORT_STATS 0x400 #define BNXT_FLAG_PORT_STATS 0x400
......
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