#include <linux/pci.h>
#include <linux/interrupt.h>
#include <linux/notifier.h>
#include <linux/mlx5/driver.h>
#include <linux/mlx5/vport.h>
#include "mlx5_core.h"
#include "mlx5_irq.h"
#include "pci_irq.h"
#include "lib/sf.h"
#include "lib/eq.h"
#ifdef CONFIG_RFS_ACCEL
#include <linux/cpu_rmap.h>
#endif
#define MLX5_SFS_PER_CTRL_IRQ …
#define MLX5_MAX_MSIX_PER_SF …
#define MLX5_IRQ_CTRL_SF_MAX …
#define MLX5_IRQ_VEC_COMP_BASE_SF …
#define MLX5_IRQ_VEC_COMP_BASE …
#define MLX5_EQ_SHARE_IRQ_MAX_COMP …
#define MLX5_EQ_SHARE_IRQ_MAX_CTRL …
#define MLX5_EQ_SHARE_IRQ_MIN_COMP …
#define MLX5_EQ_SHARE_IRQ_MIN_CTRL …
struct mlx5_irq { … };
struct mlx5_irq_table { … };
static int mlx5_core_func_to_vport(const struct mlx5_core_dev *dev,
int func,
bool ec_vf_func)
{ … }
int mlx5_get_default_msix_vec_count(struct mlx5_core_dev *dev, int num_vfs)
{ … }
int mlx5_set_msix_vec_count(struct mlx5_core_dev *dev, int function_id,
int msix_vec_count)
{ … }
static void mlx5_system_free_irq(struct mlx5_irq *irq)
{ … }
static void irq_release(struct mlx5_irq *irq)
{ … }
int mlx5_irq_put(struct mlx5_irq *irq)
{ … }
int mlx5_irq_read_locked(struct mlx5_irq *irq)
{ … }
int mlx5_irq_get_locked(struct mlx5_irq *irq)
{ … }
static int irq_get(struct mlx5_irq *irq)
{ … }
static irqreturn_t irq_int_handler(int irq, void *nh)
{ … }
static void irq_sf_set_name(struct mlx5_irq_pool *pool, char *name, int vecidx)
{ … }
static void irq_set_name(struct mlx5_irq_pool *pool, char *name, int vecidx)
{ … }
struct mlx5_irq *mlx5_irq_alloc(struct mlx5_irq_pool *pool, int i,
struct irq_affinity_desc *af_desc,
struct cpu_rmap **rmap)
{ … }
int mlx5_irq_attach_nb(struct mlx5_irq *irq, struct notifier_block *nb)
{ … }
int mlx5_irq_detach_nb(struct mlx5_irq *irq, struct notifier_block *nb)
{ … }
struct cpumask *mlx5_irq_get_affinity_mask(struct mlx5_irq *irq)
{ … }
int mlx5_irq_get_irq(const struct mlx5_irq *irq)
{ … }
int mlx5_irq_get_index(struct mlx5_irq *irq)
{ … }
static struct mlx5_irq *
irq_pool_request_vector(struct mlx5_irq_pool *pool, int vecidx,
struct irq_affinity_desc *af_desc,
struct cpu_rmap **rmap)
{ … }
static struct mlx5_irq_pool *sf_ctrl_irq_pool_get(struct mlx5_irq_table *irq_table)
{ … }
static struct mlx5_irq_pool *sf_irq_pool_get(struct mlx5_irq_table *irq_table)
{ … }
struct mlx5_irq_pool *mlx5_irq_pool_get(struct mlx5_core_dev *dev)
{ … }
static struct mlx5_irq_pool *ctrl_irq_pool_get(struct mlx5_core_dev *dev)
{ … }
static void _mlx5_irq_release(struct mlx5_irq *irq)
{ … }
void mlx5_ctrl_irq_release(struct mlx5_core_dev *dev, struct mlx5_irq *ctrl_irq)
{ … }
struct mlx5_irq *mlx5_ctrl_irq_request(struct mlx5_core_dev *dev)
{ … }
struct mlx5_irq *mlx5_irq_request(struct mlx5_core_dev *dev, u16 vecidx,
struct irq_affinity_desc *af_desc,
struct cpu_rmap **rmap)
{ … }
void mlx5_irq_release_vector(struct mlx5_irq *irq)
{ … }
struct mlx5_irq *mlx5_irq_request_vector(struct mlx5_core_dev *dev, u16 cpu,
u16 vecidx, struct cpu_rmap **rmap)
{ … }
static struct mlx5_irq_pool *
irq_pool_alloc(struct mlx5_core_dev *dev, int start, int size, char *name,
u32 min_threshold, u32 max_threshold)
{ … }
static void irq_pool_free(struct mlx5_irq_pool *pool)
{ … }
static int irq_pools_init(struct mlx5_core_dev *dev, int sf_vec, int pcif_vec)
{ … }
static void irq_pools_destroy(struct mlx5_irq_table *table)
{ … }
static void mlx5_irq_pool_free_irqs(struct mlx5_irq_pool *pool)
{ … }
static void mlx5_irq_pools_free_irqs(struct mlx5_irq_table *table)
{ … }
int mlx5_irq_table_init(struct mlx5_core_dev *dev)
{ … }
void mlx5_irq_table_cleanup(struct mlx5_core_dev *dev)
{ … }
int mlx5_irq_table_get_num_comp(struct mlx5_irq_table *table)
{ … }
int mlx5_irq_table_create(struct mlx5_core_dev *dev)
{ … }
void mlx5_irq_table_destroy(struct mlx5_core_dev *dev)
{ … }
void mlx5_irq_table_free_irqs(struct mlx5_core_dev *dev)
{ … }
int mlx5_irq_table_get_sfs_vec(struct mlx5_irq_table *table)
{ … }
struct mlx5_irq_table *mlx5_irq_table_get(struct mlx5_core_dev *dev)
{ … }