#include "mlx5_core.h"
#include "lib/crypto.h"
#define MLX5_CRYPTO_DEK_POOLS_NUM …
#define type2idx(type) …
#define MLX5_CRYPTO_DEK_POOL_SYNC_THRESH …
#define MLX5_CRYPTO_DEK_CALC_FREED(a) …
#define MLX5_CRYPTO_DEK_POOL_CALC_FREED(pool) …
#define MLX5_CRYPTO_DEK_BULK_CALC_FREED(bulk) …
#define MLX5_CRYPTO_DEK_BULK_IDLE(bulk) …
enum { … };
struct mlx5_crypto_dek_pool { … };
struct mlx5_crypto_dek_bulk { … };
struct mlx5_crypto_dek_priv { … };
struct mlx5_crypto_dek { … };
u32 mlx5_crypto_dek_get_id(struct mlx5_crypto_dek *dek)
{ … }
static int mlx5_crypto_dek_get_key_sz(struct mlx5_core_dev *mdev,
u32 sz_bytes, u8 *key_sz_p)
{ … }
static int mlx5_crypto_dek_fill_key(struct mlx5_core_dev *mdev, u8 *key_obj,
const void *key, u32 sz_bytes)
{ … }
static int mlx5_crypto_cmd_sync_crypto(struct mlx5_core_dev *mdev,
int crypto_type)
{ … }
static int mlx5_crypto_create_dek_bulk(struct mlx5_core_dev *mdev,
u32 key_purpose, int log_obj_range,
u32 *obj_id)
{ … }
static int mlx5_crypto_modify_dek_key(struct mlx5_core_dev *mdev,
const void *key, u32 sz_bytes, u32 key_purpose,
u32 obj_id, u32 obj_offset)
{ … }
static int mlx5_crypto_create_dek_key(struct mlx5_core_dev *mdev,
const void *key, u32 sz_bytes,
u32 key_purpose, u32 *p_key_id)
{ … }
static void mlx5_crypto_destroy_dek_key(struct mlx5_core_dev *mdev, u32 key_id)
{ … }
int mlx5_create_encryption_key(struct mlx5_core_dev *mdev,
const void *key, u32 sz_bytes,
u32 key_type, u32 *p_key_id)
{ … }
void mlx5_destroy_encryption_key(struct mlx5_core_dev *mdev, u32 key_id)
{ … }
static struct mlx5_crypto_dek_bulk *
mlx5_crypto_dek_bulk_create(struct mlx5_crypto_dek_pool *pool)
{ … }
static struct mlx5_crypto_dek_bulk *
mlx5_crypto_dek_pool_add_bulk(struct mlx5_crypto_dek_pool *pool)
{ … }
static void mlx5_crypto_dek_bulk_free(struct mlx5_crypto_dek_bulk *bulk)
{ … }
static void mlx5_crypto_dek_pool_remove_bulk(struct mlx5_crypto_dek_pool *pool,
struct mlx5_crypto_dek_bulk *bulk,
bool delay)
{ … }
static struct mlx5_crypto_dek_bulk *
mlx5_crypto_dek_pool_pop(struct mlx5_crypto_dek_pool *pool, u32 *obj_offset)
{ … }
static bool mlx5_crypto_dek_need_sync(struct mlx5_crypto_dek_pool *pool)
{ … }
static int mlx5_crypto_dek_free_locked(struct mlx5_crypto_dek_pool *pool,
struct mlx5_crypto_dek *dek)
{ … }
static int mlx5_crypto_dek_pool_push(struct mlx5_crypto_dek_pool *pool,
struct mlx5_crypto_dek *dek)
{ … }
static void mlx5_crypto_dek_bulk_reset_synced(struct mlx5_crypto_dek_pool *pool,
struct mlx5_crypto_dek_bulk *bulk)
{ … }
static bool mlx5_crypto_dek_bulk_handle_avail(struct mlx5_crypto_dek_pool *pool,
struct mlx5_crypto_dek_bulk *bulk,
struct list_head *destroy_list)
{ … }
static void mlx5_crypto_dek_pool_splice_destroy_list(struct mlx5_crypto_dek_pool *pool,
struct list_head *list,
struct list_head *head)
{ … }
static void mlx5_crypto_dek_pool_free_wait_keys(struct mlx5_crypto_dek_pool *pool)
{ … }
static void mlx5_crypto_dek_pool_reset_synced(struct mlx5_crypto_dek_pool *pool)
{ … }
static void mlx5_crypto_dek_sync_work_fn(struct work_struct *work)
{ … }
struct mlx5_crypto_dek *mlx5_crypto_dek_create(struct mlx5_crypto_dek_pool *dek_pool,
const void *key, u32 sz_bytes)
{ … }
void mlx5_crypto_dek_destroy(struct mlx5_crypto_dek_pool *dek_pool,
struct mlx5_crypto_dek *dek)
{ … }
static void mlx5_crypto_dek_free_destroy_list(struct list_head *destroy_list)
{ … }
static void mlx5_crypto_dek_destroy_work_fn(struct work_struct *work)
{ … }
struct mlx5_crypto_dek_pool *
mlx5_crypto_dek_pool_create(struct mlx5_core_dev *mdev, int key_purpose)
{ … }
void mlx5_crypto_dek_pool_destroy(struct mlx5_crypto_dek_pool *pool)
{ … }
void mlx5_crypto_dek_cleanup(struct mlx5_crypto_dek_priv *dek_priv)
{ … }
struct mlx5_crypto_dek_priv *mlx5_crypto_dek_init(struct mlx5_core_dev *mdev)
{ … }