@@ -1712,7 +1712,7 @@ static int ena_request_io_irq(struct ena_adapter *adapter)
for (i = 0; i < io_queue_count; i++) {
irq_idx = ENA_IO_IRQ_IDX(i);
irq = &adapter->irq_tbl[irq_idx];
- netif_napi_set_irq(&adapter->ena_napi[i].napi, irq->vector);
+ netif_napi_set_irq(&adapter->ena_napi[i].napi, irq->vector, 0);
}
return rc;
@@ -11225,7 +11225,7 @@ static int bnxt_request_irq(struct bnxt *bp)
if (rc)
break;
- netif_napi_set_irq(&bp->bnapi[i]->napi, irq->vector);
+ netif_napi_set_irq(&bp->bnapi[i]->napi, irq->vector, 0);
irq->requested = 1;
if (zalloc_cpumask_var(&irq->cpu_mask, GFP_KERNEL)) {
@@ -7447,7 +7447,7 @@ static void tg3_napi_init(struct tg3 *tp)
for (i = 0; i < tp->irq_cnt; i++) {
netif_napi_add(tp->dev, &tp->napi[i].napi,
i ? tg3_poll_msix : tg3_poll);
- netif_napi_set_irq(&tp->napi[i].napi, tp->napi[i].irq_vec);
+ netif_napi_set_irq(&tp->napi[i].napi, tp->napi[i].irq_vec, 0);
}
}
@@ -111,7 +111,7 @@ void gve_add_napi(struct gve_priv *priv, int ntfy_idx,
struct gve_notify_block *block = &priv->ntfy_blocks[ntfy_idx];
netif_napi_add(priv->dev, &block->napi, gve_poll);
- netif_napi_set_irq(&block->napi, block->irq);
+ netif_napi_set_irq(&block->napi, block->irq, 0);
}
void gve_remove_napi(struct gve_priv *priv, int ntfy_idx)
@@ -1394,7 +1394,7 @@ int e1000_open(struct net_device *netdev)
/* From here on the code is the same as e1000_up() */
clear_bit(__E1000_DOWN, &adapter->flags);
- netif_napi_set_irq(&adapter->napi, adapter->pdev->irq);
+ netif_napi_set_irq(&adapter->napi, adapter->pdev->irq, 0);
napi_enable(&adapter->napi);
netif_queue_set_napi(netdev, 0, NETDEV_QUEUE_TYPE_RX, &adapter->napi);
netif_queue_set_napi(netdev, 0, NETDEV_QUEUE_TYPE_TX, &adapter->napi);
@@ -4676,7 +4676,7 @@ int e1000e_open(struct net_device *netdev)
else
irq = adapter->pdev->irq;
- netif_napi_set_irq(&adapter->napi, irq);
+ netif_napi_set_irq(&adapter->napi, irq, 0);
napi_enable(&adapter->napi);
netif_queue_set_napi(netdev, 0, NETDEV_QUEUE_TYPE_RX, &adapter->napi);
netif_queue_set_napi(netdev, 0, NETDEV_QUEUE_TYPE_TX, &adapter->napi);
@@ -2735,7 +2735,7 @@ void ice_vsi_set_napi_queues(struct ice_vsi *vsi)
ice_for_each_q_vector(vsi, v_idx) {
struct ice_q_vector *q_vector = vsi->q_vectors[v_idx];
- netif_napi_set_irq(&q_vector->napi, q_vector->irq.virq);
+ netif_napi_set_irq(&q_vector->napi, q_vector->irq.virq, 0);
}
}
@@ -150,7 +150,7 @@ int mlx4_en_activate_cq(struct mlx4_en_priv *priv, struct mlx4_en_cq *cq,
case TX:
cq->mcq.comp = mlx4_en_tx_irq;
netif_napi_add_tx(cq->dev, &cq->napi, mlx4_en_poll_tx_cq);
- netif_napi_set_irq(&cq->napi, irq);
+ netif_napi_set_irq(&cq->napi, irq, 0);
napi_enable(&cq->napi);
netif_queue_set_napi(cq->dev, cq_idx, NETDEV_QUEUE_TYPE_TX, &cq->napi);
break;
@@ -158,7 +158,7 @@ int mlx4_en_activate_cq(struct mlx4_en_priv *priv, struct mlx4_en_cq *cq,
cq->mcq.comp = mlx4_en_rx_irq;
netif_napi_add_config(cq->dev, &cq->napi, mlx4_en_poll_rx_cq,
cq_idx);
- netif_napi_set_irq(&cq->napi, irq);
+ netif_napi_set_irq(&cq->napi, irq, 0);
napi_enable(&cq->napi);
netif_queue_set_napi(cq->dev, cq_idx, NETDEV_QUEUE_TYPE_RX, &cq->napi);
break;
@@ -2733,7 +2733,7 @@ static int mlx5e_open_channel(struct mlx5e_priv *priv, int ix,
c->lag_port = mlx5e_enumerate_lag_port(mdev, ix);
netif_napi_add_config(netdev, &c->napi, mlx5e_napi_poll, ix);
- netif_napi_set_irq(&c->napi, irq);
+ netif_napi_set_irq(&c->napi, irq, 0);
err = mlx5e_open_queues(c, params, cparam);
if (unlikely(err))
@@ -1227,7 +1227,8 @@ static int fbnic_alloc_napi_vector(struct fbnic_dev *fbd, struct fbnic_net *fbn,
/* Record IRQ to NAPI struct */
netif_napi_set_irq(&nv->napi,
- pci_irq_vector(to_pci_dev(fbd->dev), nv->v_idx));
+ pci_irq_vector(to_pci_dev(fbd->dev), nv->v_idx),
+ 0);
/* Tie nv back to PCIe dev */
nv->dev = fbd->dev;
@@ -392,6 +392,7 @@ struct napi_struct {
struct list_head dev_list;
struct hlist_node napi_hash_node;
int irq;
+ unsigned long irq_flags;
int index;
struct napi_config *config;
};
@@ -2671,10 +2672,7 @@ void netif_queue_set_napi(struct net_device *dev, unsigned int queue_index,
enum netdev_queue_type type,
struct napi_struct *napi);
-static inline void netif_napi_set_irq(struct napi_struct *napi, int irq)
-{
- napi->irq = irq;
-}
+void netif_napi_set_irq(struct napi_struct *napi, int irq, unsigned long flags);
/* Default NAPI poll() weight
* Device drivers are strongly advised to not use bigger value
@@ -6705,6 +6705,13 @@ void netif_queue_set_napi(struct net_device *dev, unsigned int queue_index,
}
EXPORT_SYMBOL(netif_queue_set_napi);
+void netif_napi_set_irq(struct napi_struct *napi, int irq, unsigned long flags)
+{
+ napi->irq = irq;
+ napi->irq_flags = flags;
+}
+EXPORT_SYMBOL(netif_napi_set_irq);
+
static void napi_restore_config(struct napi_struct *n)
{
n->defer_hard_irqs = n->config->defer_hard_irqs;
@@ -6770,7 +6777,7 @@ void netif_napi_add_weight(struct net_device *dev, struct napi_struct *napi,
*/
if (dev->threaded && napi_kthread_create(napi))
dev->threaded = false;
- netif_napi_set_irq(napi, -1);
+ netif_napi_set_irq(napi, -1, 0);
}
EXPORT_SYMBOL(netif_napi_add_weight);
Add irq_flags to the napi struct. This will allow the drivers to choose how the core handles the IRQ assigned to the napi via netif_napi_set_irq(). Signed-off-by: Ahmed Zaki <ahmed.zaki@intel.com> --- drivers/net/ethernet/amazon/ena/ena_netdev.c | 2 +- drivers/net/ethernet/broadcom/bnxt/bnxt.c | 2 +- drivers/net/ethernet/broadcom/tg3.c | 2 +- drivers/net/ethernet/google/gve/gve_utils.c | 2 +- drivers/net/ethernet/intel/e1000/e1000_main.c | 2 +- drivers/net/ethernet/intel/e1000e/netdev.c | 2 +- drivers/net/ethernet/intel/ice/ice_lib.c | 2 +- drivers/net/ethernet/mellanox/mlx4/en_cq.c | 4 ++-- drivers/net/ethernet/mellanox/mlx5/core/en_main.c | 2 +- drivers/net/ethernet/meta/fbnic/fbnic_txrx.c | 3 ++- include/linux/netdevice.h | 6 ++---- net/core/dev.c | 9 ++++++++- 12 files changed, 22 insertions(+), 16 deletions(-)