Changeset View
Changeset View
Standalone View
Standalone View
contrib/ofed/libmlx5/mlx5.c
Show First 20 Lines • Show All 730 Lines • ▼ Show 20 Lines | int mlx5dv_init_obj(struct mlx5dv_obj *obj, uint64_t obj_type) | ||||
if (!ret && (obj_type & MLX5DV_OBJ_SRQ)) | if (!ret && (obj_type & MLX5DV_OBJ_SRQ)) | ||||
ret = mlx5dv_get_srq(obj->srq.in, obj->srq.out); | ret = mlx5dv_get_srq(obj->srq.in, obj->srq.out); | ||||
if (!ret && (obj_type & MLX5DV_OBJ_RWQ)) | if (!ret && (obj_type & MLX5DV_OBJ_RWQ)) | ||||
ret = mlx5dv_get_rwq(obj->rwq.in, obj->rwq.out); | ret = mlx5dv_get_rwq(obj->rwq.in, obj->rwq.out); | ||||
return ret; | return ret; | ||||
} | } | ||||
int mlx5dv_set_context_attr(struct ibv_context *ibv_ctx, | |||||
enum mlx5dv_set_ctx_attr_type type, void *attr) | |||||
{ | |||||
struct mlx5_context *ctx = to_mctx(ibv_ctx); | |||||
switch (type) { | |||||
case MLX5DV_CTX_ATTR_BUF_ALLOCATORS: | |||||
ctx->extern_alloc = *((struct mlx5dv_ctx_allocators *)attr); | |||||
break; | |||||
default: | |||||
return ENOTSUP; | |||||
} | |||||
return 0; | |||||
} | |||||
static void adjust_uar_info(struct mlx5_device *mdev, | static void adjust_uar_info(struct mlx5_device *mdev, | ||||
struct mlx5_context *context, | struct mlx5_context *context, | ||||
struct mlx5_alloc_ucontext_resp resp) | struct mlx5_alloc_ucontext_resp resp) | ||||
{ | { | ||||
if (!resp.log_uar_size && !resp.num_uars_per_page) { | if (!resp.log_uar_size && !resp.num_uars_per_page) { | ||||
/* old kernel */ | /* old kernel */ | ||||
context->uar_size = mdev->page_size; | context->uar_size = mdev->page_size; | ||||
context->num_uars_per_page = 1; | context->num_uars_per_page = 1; | ||||
▲ Show 20 Lines • Show All 298 Lines • Show Last 20 Lines |