#include "dr_types.h"
#define DR_ICM_MODIFY_HDR_ALIGN_BASE …
#define DR_ICM_POOL_STE_HOT_MEM_PERCENT …
#define DR_ICM_POOL_MODIFY_HDR_PTRN_HOT_MEM_PERCENT …
#define DR_ICM_POOL_MODIFY_ACTION_HOT_MEM_PERCENT …
struct mlx5dr_icm_hot_chunk { … };
struct mlx5dr_icm_pool { … };
struct mlx5dr_icm_dm { … };
struct mlx5dr_icm_mr { … };
static int dr_icm_create_dm_mkey(struct mlx5_core_dev *mdev,
u32 pd, u64 length, u64 start_addr, int mode,
u32 *mkey)
{ … }
u64 mlx5dr_icm_pool_get_chunk_mr_addr(struct mlx5dr_icm_chunk *chunk)
{ … }
u32 mlx5dr_icm_pool_get_chunk_rkey(struct mlx5dr_icm_chunk *chunk)
{ … }
u64 mlx5dr_icm_pool_get_chunk_icm_addr(struct mlx5dr_icm_chunk *chunk)
{ … }
u32 mlx5dr_icm_pool_get_chunk_byte_size(struct mlx5dr_icm_chunk *chunk)
{ … }
u32 mlx5dr_icm_pool_get_chunk_num_of_entries(struct mlx5dr_icm_chunk *chunk)
{ … }
static struct mlx5dr_icm_mr *
dr_icm_pool_mr_create(struct mlx5dr_icm_pool *pool)
{ … }
static void dr_icm_pool_mr_destroy(struct mlx5dr_icm_mr *icm_mr)
{ … }
static int dr_icm_buddy_get_ste_size(struct mlx5dr_icm_buddy_mem *buddy)
{ … }
static void dr_icm_chunk_ste_init(struct mlx5dr_icm_chunk *chunk, int offset)
{ … }
static int dr_icm_buddy_init_ste_cache(struct mlx5dr_icm_buddy_mem *buddy)
{ … }
static void dr_icm_buddy_cleanup_ste_cache(struct mlx5dr_icm_buddy_mem *buddy)
{ … }
static int dr_icm_buddy_create(struct mlx5dr_icm_pool *pool)
{ … }
static void dr_icm_buddy_destroy(struct mlx5dr_icm_buddy_mem *buddy)
{ … }
static void
dr_icm_chunk_init(struct mlx5dr_icm_chunk *chunk,
struct mlx5dr_icm_pool *pool,
enum mlx5dr_icm_chunk_size chunk_size,
struct mlx5dr_icm_buddy_mem *buddy_mem_pool,
unsigned int seg)
{ … }
static bool dr_icm_pool_is_sync_required(struct mlx5dr_icm_pool *pool)
{ … }
static void dr_icm_pool_clear_hot_chunks_arr(struct mlx5dr_icm_pool *pool)
{ … }
static int dr_icm_pool_sync_all_buddy_pools(struct mlx5dr_icm_pool *pool)
{ … }
static int dr_icm_handle_buddies_get_mem(struct mlx5dr_icm_pool *pool,
enum mlx5dr_icm_chunk_size chunk_size,
struct mlx5dr_icm_buddy_mem **buddy,
unsigned int *seg)
{ … }
struct mlx5dr_icm_chunk *
mlx5dr_icm_alloc_chunk(struct mlx5dr_icm_pool *pool,
enum mlx5dr_icm_chunk_size chunk_size)
{ … }
void mlx5dr_icm_free_chunk(struct mlx5dr_icm_chunk *chunk)
{ … }
struct mlx5dr_ste_htbl *mlx5dr_icm_pool_alloc_htbl(struct mlx5dr_icm_pool *pool)
{ … }
void mlx5dr_icm_pool_free_htbl(struct mlx5dr_icm_pool *pool, struct mlx5dr_ste_htbl *htbl)
{ … }
struct mlx5dr_icm_pool *mlx5dr_icm_pool_create(struct mlx5dr_domain *dmn,
enum mlx5dr_icm_type icm_type)
{ … }
void mlx5dr_icm_pool_destroy(struct mlx5dr_icm_pool *pool)
{ … }