1 /* SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB */
2 /* Copyright (c) 2021 Mellanox Technologies. */
3 
4 #ifndef __MLX5_IRQ_H__
5 #define __MLX5_IRQ_H__
6 
7 #include <linux/mlx5/driver.h>
8 
9 #define MLX5_COMP_EQS_PER_SF 8
10 
11 struct mlx5_irq;
12 
13 int mlx5_irq_table_init(struct mlx5_core_dev *dev);
14 void mlx5_irq_table_cleanup(struct mlx5_core_dev *dev);
15 int mlx5_irq_table_create(struct mlx5_core_dev *dev);
16 void mlx5_irq_table_destroy(struct mlx5_core_dev *dev);
17 int mlx5_irq_table_get_num_comp(struct mlx5_irq_table *table);
18 int mlx5_irq_table_get_sfs_vec(struct mlx5_irq_table *table);
19 struct mlx5_irq_table *mlx5_irq_table_get(struct mlx5_core_dev *dev);
20 
21 int mlx5_set_msix_vec_count(struct mlx5_core_dev *dev, int devfn,
22 			    int msix_vec_count);
23 int mlx5_get_default_msix_vec_count(struct mlx5_core_dev *dev, int num_vfs);
24 
25 struct mlx5_irq *mlx5_irq_request(struct mlx5_core_dev *dev, u16 vecidx,
26 				  struct cpumask *affinity);
27 void mlx5_irq_release(struct mlx5_irq *irq);
28 int mlx5_irq_attach_nb(struct mlx5_irq *irq, struct notifier_block *nb);
29 int mlx5_irq_detach_nb(struct mlx5_irq *irq, struct notifier_block *nb);
30 struct cpumask *mlx5_irq_get_affinity_mask(struct mlx5_irq *irq);
31 int mlx5_irq_get_index(struct mlx5_irq *irq);
32 
33 #endif /* __MLX5_IRQ_H__ */
34