File Index
Files and directories
Sign in
FILE

mlx5_irq.h

File preview with syntax highlighting.

linux-6.19.14/drivers/net/ethernet/mellanox/mlx5/core/mlx5_irq.h C
 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
11struct mlx5_irq;
12struct cpu_rmap;
13struct mlx5_irq_pool;
14
15int mlx5_irq_table_init(struct mlx5_core_dev *dev);
16void mlx5_irq_table_cleanup(struct mlx5_core_dev *dev);
17int mlx5_irq_table_create(struct mlx5_core_dev *dev);
18void mlx5_irq_table_destroy(struct mlx5_core_dev *dev);
19void mlx5_irq_table_free_irqs(struct mlx5_core_dev *dev);
20struct mlx5_irq_pool *
21mlx5_irq_table_get_comp_irq_pool(struct mlx5_core_dev *dev);
22int mlx5_irq_table_get_num_comp(struct mlx5_irq_table *table);
23int mlx5_irq_table_get_sfs_vec(struct mlx5_irq_table *table);
24struct mlx5_irq_table *mlx5_irq_table_get(struct mlx5_core_dev *dev);
25
26int mlx5_set_msix_vec_count(struct mlx5_core_dev *dev, int devfn,
27			    int msix_vec_count);
28int mlx5_get_default_msix_vec_count(struct mlx5_core_dev *dev, int num_vfs);
29
30struct mlx5_irq *mlx5_ctrl_irq_request(struct mlx5_core_dev *dev);
31void mlx5_ctrl_irq_release(struct mlx5_core_dev *dev, struct mlx5_irq *ctrl_irq);
32struct mlx5_irq *mlx5_irq_request(struct mlx5_core_dev *dev, u16 vecidx,
33				  struct irq_affinity_desc *af_desc,
34				  struct cpu_rmap **rmap);
35struct mlx5_irq *mlx5_irq_request_vector(struct mlx5_core_dev *dev, u16 cpu,
36					 u16 vecidx, struct cpu_rmap **rmap);
37void mlx5_irq_release_vector(struct mlx5_irq *irq);
38int mlx5_irq_attach_nb(struct mlx5_irq *irq, struct notifier_block *nb);
39int mlx5_irq_detach_nb(struct mlx5_irq *irq, struct notifier_block *nb);
40struct cpumask *mlx5_irq_get_affinity_mask(struct mlx5_irq *irq);
41int mlx5_irq_get_index(struct mlx5_irq *irq);
42int mlx5_irq_get_irq(const struct mlx5_irq *irq);
43
44#ifdef CONFIG_MLX5_SF
45struct mlx5_irq *mlx5_irq_affinity_irq_request_auto(struct mlx5_core_dev *dev,
46						    struct cpumask *used_cpus, u16 vecidx);
47struct mlx5_irq *
48mlx5_irq_affinity_request(struct mlx5_core_dev *dev, struct mlx5_irq_pool *pool,
49			  struct irq_affinity_desc *af_desc);
50void mlx5_irq_affinity_irq_release(struct mlx5_core_dev *dev, struct mlx5_irq *irq);
51#else
52static inline
53struct mlx5_irq *mlx5_irq_affinity_irq_request_auto(struct mlx5_core_dev *dev,
54						    struct cpumask *used_cpus, u16 vecidx)
55{
56	return ERR_PTR(-EOPNOTSUPP);
57}
58
59static inline struct mlx5_irq *
60mlx5_irq_affinity_request(struct mlx5_core_dev *dev, struct mlx5_irq_pool *pool,
61			  struct irq_affinity_desc *af_desc)
62{
63	return ERR_PTR(-EOPNOTSUPP);
64}
65
66static inline
67void mlx5_irq_affinity_irq_release(struct mlx5_core_dev *dev, struct mlx5_irq *irq)
68{
69	mlx5_irq_release_vector(irq);
70}
71#endif
72#endif /* __MLX5_IRQ_H__ */
~/ Read-only file preview.