Commit e94d8d97 authored by Michael Chan's avatar Michael Chan Committed by Jakub Kicinski

bnxt_en: Remove BNXT_FLAG_USING_MSIX flag

Now that we only support MSIX, the BNXT_FLAG_USING_MSIX is always true.
Remove it and any if conditions checking for it.  Remove the INTX
handler and associated logic.
Reviewed-by: default avatarKalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: default avatarSomnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: default avatarHongguang Gao <hongguang.gao@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-6-michael.chan@broadcom.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 2a659a46
...@@ -2854,34 +2854,6 @@ static inline int bnxt_has_work(struct bnxt *bp, struct bnxt_cp_ring_info *cpr) ...@@ -2854,34 +2854,6 @@ static inline int bnxt_has_work(struct bnxt *bp, struct bnxt_cp_ring_info *cpr)
return TX_CMP_VALID(txcmp, raw_cons); return TX_CMP_VALID(txcmp, raw_cons);
} }
static irqreturn_t bnxt_inta(int irq, void *dev_instance)
{
struct bnxt_napi *bnapi = dev_instance;
struct bnxt *bp = bnapi->bp;
struct bnxt_cp_ring_info *cpr = &bnapi->cp_ring;
u32 cons = RING_CMP(cpr->cp_raw_cons);
u32 int_status;
prefetch(&cpr->cp_desc_ring[CP_RING(cons)][CP_IDX(cons)]);
if (!bnxt_has_work(bp, cpr)) {
int_status = readl(bp->bar0 + BNXT_CAG_REG_LEGACY_INT_STATUS);
/* return if erroneous interrupt */
if (!(int_status & (0x10000 << cpr->cp_ring_struct.fw_ring_id)))
return IRQ_NONE;
}
/* disable ring IRQ */
BNXT_CP_DB_IRQ_DIS(cpr->cp_db.doorbell);
/* Return here if interrupt is shared and is disabled. */
if (unlikely(atomic_read(&bp->intr_sem) != 0))
return IRQ_HANDLED;
napi_schedule(&bnapi->napi);
return IRQ_HANDLED;
}
static int __bnxt_poll_work(struct bnxt *bp, struct bnxt_cp_ring_info *cpr, static int __bnxt_poll_work(struct bnxt *bp, struct bnxt_cp_ring_info *cpr,
int budget) int budget)
{ {
...@@ -6876,15 +6848,14 @@ static int hwrm_ring_alloc_send_msg(struct bnxt *bp, ...@@ -6876,15 +6848,14 @@ static int hwrm_ring_alloc_send_msg(struct bnxt *bp,
req->cq_handle = cpu_to_le64(ring->handle); req->cq_handle = cpu_to_le64(ring->handle);
req->enables |= cpu_to_le32( req->enables |= cpu_to_le32(
RING_ALLOC_REQ_ENABLES_NQ_RING_ID_VALID); RING_ALLOC_REQ_ENABLES_NQ_RING_ID_VALID);
} else if (bp->flags & BNXT_FLAG_USING_MSIX) { } else {
req->int_mode = RING_ALLOC_REQ_INT_MODE_MSIX; req->int_mode = RING_ALLOC_REQ_INT_MODE_MSIX;
} }
break; break;
case HWRM_RING_ALLOC_NQ: case HWRM_RING_ALLOC_NQ:
req->ring_type = RING_ALLOC_REQ_RING_TYPE_NQ; req->ring_type = RING_ALLOC_REQ_RING_TYPE_NQ;
req->length = cpu_to_le32(bp->cp_ring_mask + 1); req->length = cpu_to_le32(bp->cp_ring_mask + 1);
if (bp->flags & BNXT_FLAG_USING_MSIX) req->int_mode = RING_ALLOC_REQ_INT_MODE_MSIX;
req->int_mode = RING_ALLOC_REQ_INT_MODE_MSIX;
break; break;
default: default:
netdev_err(bp->dev, "hwrm alloc invalid ring type %d\n", netdev_err(bp->dev, "hwrm alloc invalid ring type %d\n",
...@@ -10653,20 +10624,6 @@ static void bnxt_setup_msix(struct bnxt *bp) ...@@ -10653,20 +10624,6 @@ static void bnxt_setup_msix(struct bnxt *bp)
} }
} }
static void bnxt_setup_inta(struct bnxt *bp)
{
const int len = sizeof(bp->irq_tbl[0].name);
if (bp->num_tc) {
netdev_reset_tc(bp->dev);
bp->num_tc = 0;
}
snprintf(bp->irq_tbl[0].name, len, "%s-%s-%d", bp->dev->name, "TxRx",
0);
bp->irq_tbl[0].handler = bnxt_inta;
}
static int bnxt_init_int_mode(struct bnxt *bp); static int bnxt_init_int_mode(struct bnxt *bp);
static int bnxt_setup_int_mode(struct bnxt *bp) static int bnxt_setup_int_mode(struct bnxt *bp)
...@@ -10679,10 +10636,7 @@ static int bnxt_setup_int_mode(struct bnxt *bp) ...@@ -10679,10 +10636,7 @@ static int bnxt_setup_int_mode(struct bnxt *bp)
return rc ?: -ENODEV; return rc ?: -ENODEV;
} }
if (bp->flags & BNXT_FLAG_USING_MSIX) bnxt_setup_msix(bp);
bnxt_setup_msix(bp);
else
bnxt_setup_inta(bp);
rc = bnxt_set_real_num_queues(bp); rc = bnxt_set_real_num_queues(bp);
return rc; return rc;
...@@ -10823,7 +10777,6 @@ static int bnxt_init_int_mode(struct bnxt *bp) ...@@ -10823,7 +10777,6 @@ static int bnxt_init_int_mode(struct bnxt *bp)
rc = -ENOMEM; rc = -ENOMEM;
goto msix_setup_exit; goto msix_setup_exit;
} }
bp->flags |= BNXT_FLAG_USING_MSIX;
kfree(msix_ent); kfree(msix_ent);
return 0; return 0;
...@@ -10838,12 +10791,10 @@ static int bnxt_init_int_mode(struct bnxt *bp) ...@@ -10838,12 +10791,10 @@ static int bnxt_init_int_mode(struct bnxt *bp)
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) pci_disable_msix(bp->pdev);
pci_disable_msix(bp->pdev);
kfree(bp->irq_tbl); kfree(bp->irq_tbl);
bp->irq_tbl = NULL; bp->irq_tbl = NULL;
bp->flags &= ~BNXT_FLAG_USING_MSIX;
} }
int bnxt_reserve_rings(struct bnxt *bp, bool irq_re_init) int bnxt_reserve_rings(struct bnxt *bp, bool irq_re_init)
...@@ -10941,9 +10892,6 @@ static int bnxt_request_irq(struct bnxt *bp) ...@@ -10941,9 +10892,6 @@ static int bnxt_request_irq(struct bnxt *bp)
#ifdef CONFIG_RFS_ACCEL #ifdef CONFIG_RFS_ACCEL
rmap = bp->dev->rx_cpu_rmap; rmap = bp->dev->rx_cpu_rmap;
#endif #endif
if (!(bp->flags & BNXT_FLAG_USING_MSIX))
flags = IRQF_SHARED;
for (i = 0, j = 0; i < bp->cp_nr_rings; i++) { for (i = 0, j = 0; i < bp->cp_nr_rings; i++) {
int map_idx = bnxt_cp_num_to_irq_num(bp, i); int map_idx = bnxt_cp_num_to_irq_num(bp, i);
struct bnxt_irq *irq = &bp->irq_tbl[map_idx]; struct bnxt_irq *irq = &bp->irq_tbl[map_idx];
...@@ -11008,29 +10956,22 @@ static void bnxt_del_napi(struct bnxt *bp) ...@@ -11008,29 +10956,22 @@ static void bnxt_del_napi(struct bnxt *bp)
static void bnxt_init_napi(struct bnxt *bp) static void bnxt_init_napi(struct bnxt *bp)
{ {
int i; int (*poll_fn)(struct napi_struct *, int) = bnxt_poll;
unsigned int cp_nr_rings = bp->cp_nr_rings; unsigned int cp_nr_rings = bp->cp_nr_rings;
struct bnxt_napi *bnapi; struct bnxt_napi *bnapi;
int i;
if (bp->flags & BNXT_FLAG_USING_MSIX) { if (bp->flags & BNXT_FLAG_CHIP_P5_PLUS)
int (*poll_fn)(struct napi_struct *, int) = bnxt_poll; poll_fn = bnxt_poll_p5;
else if (BNXT_CHIP_TYPE_NITRO_A0(bp))
if (bp->flags & BNXT_FLAG_CHIP_P5_PLUS) cp_nr_rings--;
poll_fn = bnxt_poll_p5; for (i = 0; i < cp_nr_rings; i++) {
else if (BNXT_CHIP_TYPE_NITRO_A0(bp)) bnapi = bp->bnapi[i];
cp_nr_rings--; netif_napi_add(bp->dev, &bnapi->napi, poll_fn);
for (i = 0; i < cp_nr_rings; i++) { }
bnapi = bp->bnapi[i]; if (BNXT_CHIP_TYPE_NITRO_A0(bp)) {
netif_napi_add(bp->dev, &bnapi->napi, poll_fn); bnapi = bp->bnapi[cp_nr_rings];
} netif_napi_add(bp->dev, &bnapi->napi, bnxt_poll_nitroa0);
if (BNXT_CHIP_TYPE_NITRO_A0(bp)) {
bnapi = bp->bnapi[cp_nr_rings];
netif_napi_add(bp->dev, &bnapi->napi,
bnxt_poll_nitroa0);
}
} else {
bnapi = bp->bnapi[0];
netif_napi_add(bp->dev, &bnapi->napi, bnxt_poll);
} }
} }
...@@ -12149,12 +12090,6 @@ static int __bnxt_open_nic(struct bnxt *bp, bool irq_re_init, bool link_re_init) ...@@ -12149,12 +12090,6 @@ static int __bnxt_open_nic(struct bnxt *bp, bool irq_re_init, bool link_re_init)
rc = bnxt_reserve_rings(bp, irq_re_init); rc = bnxt_reserve_rings(bp, irq_re_init);
if (rc) if (rc)
return rc; return rc;
if ((bp->flags & BNXT_FLAG_RFS) &&
!(bp->flags & BNXT_FLAG_USING_MSIX)) {
/* disable RFS if falling back to INTA */
bp->dev->hw_features &= ~NETIF_F_NTUPLE;
bp->flags &= ~BNXT_FLAG_RFS;
}
rc = bnxt_alloc_mem(bp, irq_re_init); rc = bnxt_alloc_mem(bp, irq_re_init);
if (rc) { if (rc) {
......
...@@ -2199,7 +2199,6 @@ struct bnxt { ...@@ -2199,7 +2199,6 @@ struct bnxt {
#define BNXT_FLAG_STRIP_VLAN 0x20 #define BNXT_FLAG_STRIP_VLAN 0x20
#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_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
......
...@@ -902,11 +902,6 @@ int bnxt_sriov_configure(struct pci_dev *pdev, int num_vfs) ...@@ -902,11 +902,6 @@ int bnxt_sriov_configure(struct pci_dev *pdev, int num_vfs)
struct net_device *dev = pci_get_drvdata(pdev); struct net_device *dev = pci_get_drvdata(pdev);
struct bnxt *bp = netdev_priv(dev); struct bnxt *bp = netdev_priv(dev);
if (!(bp->flags & BNXT_FLAG_USING_MSIX)) {
netdev_warn(dev, "Not allow SRIOV if the irq mode is not MSIX\n");
return 0;
}
rtnl_lock(); rtnl_lock();
if (!netif_running(dev)) { if (!netif_running(dev)) {
netdev_warn(dev, "Reject SRIOV config request since if is down!\n"); netdev_warn(dev, "Reject SRIOV config request since if is down!\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