#include <linux/mlx5/driver.h>
#include "vhca_event.h"
#include "priv.h"
#include "sf.h"
#include "mlx5_ifc_vhca_event.h"
#include "ecpf.h"
#include "mlx5_core.h"
#include "eswitch.h"
#include "diag/sf_tracepoint.h"
#include "devlink.h"
struct mlx5_sf_hw { … };
struct mlx5_sf_hwc_table { … };
enum mlx5_sf_hwc_index { … };
struct mlx5_sf_hw_table { … };
static struct mlx5_sf_hwc_table *
mlx5_sf_controller_to_hwc(struct mlx5_core_dev *dev, u32 controller)
{ … }
u16 mlx5_sf_sw_to_hw_id(struct mlx5_core_dev *dev, u32 controller, u16 sw_id)
{ … }
static u16 mlx5_sf_hw_to_sw_id(struct mlx5_sf_hwc_table *hwc, u16 hw_id)
{ … }
static struct mlx5_sf_hwc_table *
mlx5_sf_table_fn_to_hwc(struct mlx5_sf_hw_table *table, u16 fn_id)
{ … }
static int mlx5_sf_hw_table_id_alloc(struct mlx5_sf_hw_table *table, u32 controller,
u32 usr_sfnum)
{ … }
static void mlx5_sf_hw_table_id_free(struct mlx5_sf_hw_table *table, u32 controller, int id)
{ … }
int mlx5_sf_hw_table_sf_alloc(struct mlx5_core_dev *dev, u32 controller, u32 usr_sfnum)
{ … }
void mlx5_sf_hw_table_sf_free(struct mlx5_core_dev *dev, u32 controller, u16 id)
{ … }
static void mlx5_sf_hw_table_hwc_sf_free(struct mlx5_core_dev *dev,
struct mlx5_sf_hwc_table *hwc, int idx)
{ … }
void mlx5_sf_hw_table_sf_deferred_free(struct mlx5_core_dev *dev, u32 controller, u16 id)
{ … }
static void mlx5_sf_hw_table_hwc_dealloc_all(struct mlx5_core_dev *dev,
struct mlx5_sf_hwc_table *hwc)
{ … }
static void mlx5_sf_hw_table_dealloc_all(struct mlx5_sf_hw_table *table)
{ … }
static int mlx5_sf_hw_table_hwc_init(struct mlx5_sf_hwc_table *hwc, u16 max_fn, u16 base_id)
{ … }
static void mlx5_sf_hw_table_hwc_cleanup(struct mlx5_sf_hwc_table *hwc)
{ … }
static void mlx5_sf_hw_table_res_unregister(struct mlx5_core_dev *dev)
{ … }
static int mlx5_sf_hw_table_res_register(struct mlx5_core_dev *dev, u16 max_fn,
u16 max_ext_fn)
{ … }
int mlx5_sf_hw_table_init(struct mlx5_core_dev *dev)
{ … }
void mlx5_sf_hw_table_cleanup(struct mlx5_core_dev *dev)
{ … }
static int mlx5_sf_hw_vhca_event(struct notifier_block *nb, unsigned long opcode, void *data)
{ … }
int mlx5_sf_hw_table_create(struct mlx5_core_dev *dev)
{ … }
void mlx5_sf_hw_table_destroy(struct mlx5_core_dev *dev)
{ … }
bool mlx5_sf_hw_table_supported(const struct mlx5_core_dev *dev)
{ … }