Add support for disabling and polling MSIX interrupts in mlx5core.

MFC after:	1 week
Sponsored by:	Mellanox Technologies
This commit is contained in:
Hans Petter Selasky 2020-02-12 09:58:19 +00:00
parent f98977b521
commit f14d849862
3 changed files with 30 additions and 2 deletions

View file

@ -1180,4 +1180,7 @@ static inline bool mlx5_rl_is_supported(struct mlx5_core_dev *dev)
}
#endif
void mlx5_disable_interrupts(struct mlx5_core_dev *);
void mlx5_poll_interrupts(struct mlx5_core_dev *);
#endif /* MLX5_DRIVER_H */

View file

@ -739,3 +739,28 @@ static void mlx5_port_general_notification_event(struct mlx5_core_dev *dev,
}
}
void
mlx5_disable_interrupts(struct mlx5_core_dev *dev)
{
int nvec = dev->priv.eq_table.num_comp_vectors + MLX5_EQ_VEC_COMP_BASE;
int x;
for (x = 0; x != nvec; x++)
disable_irq(dev->priv.msix_arr[x].vector);
}
void
mlx5_poll_interrupts(struct mlx5_core_dev *dev)
{
struct mlx5_eq *eq;
if (unlikely(dev->priv.disable_irqs != 0))
return;
mlx5_eq_int(dev, &dev->priv.eq_table.cmd_eq);
mlx5_eq_int(dev, &dev->priv.eq_table.async_eq);
mlx5_eq_int(dev, &dev->priv.eq_table.pages_eq);
list_for_each_entry(eq, &dev->priv.eq_table.comp_eqs_list, list)
mlx5_eq_int(dev, eq);
}

View file

@ -1585,7 +1585,7 @@ done:
return 0;
}
static void mlx5_disable_interrupts(struct mlx5_core_dev *mdev)
static void mlx5_shutdown_disable_interrupts(struct mlx5_core_dev *mdev)
{
int nvec = mdev->priv.eq_table.num_comp_vectors + MLX5_EQ_VEC_COMP_BASE;
int x;
@ -1609,7 +1609,7 @@ static void shutdown_one(struct pci_dev *pdev)
set_bit(MLX5_INTERFACE_STATE_TEARDOWN, &dev->intf_state);
/* disable all interrupts */
mlx5_disable_interrupts(dev);
mlx5_shutdown_disable_interrupts(dev);
err = mlx5_try_fast_unload(dev);
if (err)