#include <rdma/uverbs_std_types.h>
#include "dm.h"
#define UVERBS_MODULE_NAME …
#include <rdma/uverbs_named_ioctl.h>
static int mlx5_cmd_alloc_memic(struct mlx5_dm *dm, phys_addr_t *addr,
u64 length, u32 alignment)
{ … }
void mlx5_cmd_dealloc_memic(struct mlx5_dm *dm, phys_addr_t addr,
u64 length)
{ … }
void mlx5_cmd_dealloc_memic_op(struct mlx5_dm *dm, phys_addr_t addr,
u8 operation)
{ … }
static int mlx5_cmd_alloc_memic_op(struct mlx5_dm *dm, phys_addr_t addr,
u8 operation, phys_addr_t *op_addr)
{ … }
static int add_dm_mmap_entry(struct ib_ucontext *context,
struct mlx5_user_mmap_entry *mentry, u8 mmap_flag,
size_t size, u64 address)
{ … }
static void mlx5_ib_dm_memic_free(struct kref *kref)
{ … }
static int copy_op_to_user(struct mlx5_ib_dm_op_entry *op_entry,
struct uverbs_attr_bundle *attrs)
{ … }
static int map_existing_op(struct mlx5_ib_dm_memic *dm, u8 op,
struct uverbs_attr_bundle *attrs)
{ … }
static int UVERBS_HANDLER(MLX5_IB_METHOD_DM_MAP_OP_ADDR)(
struct uverbs_attr_bundle *attrs)
{ … }
static struct ib_dm *handle_alloc_dm_memic(struct ib_ucontext *ctx,
struct ib_dm_alloc_attr *attr,
struct uverbs_attr_bundle *attrs)
{ … }
static enum mlx5_sw_icm_type get_icm_type(int uapi_type)
{ … }
static struct ib_dm *handle_alloc_dm_sw_icm(struct ib_ucontext *ctx,
struct ib_dm_alloc_attr *attr,
struct uverbs_attr_bundle *attrs,
int type)
{ … }
struct ib_dm *mlx5_ib_alloc_dm(struct ib_device *ibdev,
struct ib_ucontext *context,
struct ib_dm_alloc_attr *attr,
struct uverbs_attr_bundle *attrs)
{ … }
static void dm_memic_remove_ops(struct mlx5_ib_dm_memic *dm)
{ … }
static void mlx5_dm_memic_dealloc(struct mlx5_ib_dm_memic *dm)
{ … }
static int mlx5_dm_icm_dealloc(struct mlx5_ib_ucontext *ctx,
struct mlx5_ib_dm_icm *dm)
{ … }
static int mlx5_ib_dealloc_dm(struct ib_dm *ibdm,
struct uverbs_attr_bundle *attrs)
{ … }
static int UVERBS_HANDLER(MLX5_IB_METHOD_DM_QUERY)(
struct uverbs_attr_bundle *attrs)
{ … }
void mlx5_ib_dm_mmap_free(struct mlx5_ib_dev *dev,
struct mlx5_user_mmap_entry *mentry)
{ … }
DECLARE_UVERBS_NAMED_METHOD(…);
ADD_UVERBS_ATTRIBUTES_SIMPLE(
mlx5_ib_dm, UVERBS_OBJECT_DM, UVERBS_METHOD_DM_ALLOC,
UVERBS_ATTR_PTR_OUT(MLX5_IB_ATTR_ALLOC_DM_RESP_START_OFFSET,
UVERBS_ATTR_TYPE(u64), UA_MANDATORY),
UVERBS_ATTR_PTR_OUT(MLX5_IB_ATTR_ALLOC_DM_RESP_PAGE_INDEX,
UVERBS_ATTR_TYPE(u16), UA_OPTIONAL),
UVERBS_ATTR_CONST_IN(MLX5_IB_ATTR_ALLOC_DM_REQ_TYPE,
enum mlx5_ib_uapi_dm_type, UA_OPTIONAL));
DECLARE_UVERBS_NAMED_METHOD(…);
DECLARE_UVERBS_GLOBAL_METHODS(…);
const struct uapi_definition mlx5_ib_dm_defs[] = …;
const struct ib_device_ops mlx5_ib_dev_dm_ops = …;