Changeset View
Changeset View
Standalone View
Standalone View
contrib/ofed/libmlx5/cq.c
Show First 20 Lines • Show All 1,493 Lines • ▼ Show 20 Lines | int mlx5_alloc_cq_buf(struct mlx5_context *mctx, struct mlx5_cq *cq, | ||||
struct mlx5_device *dev = to_mdev(mctx->ibv_ctx.device); | struct mlx5_device *dev = to_mdev(mctx->ibv_ctx.device); | ||||
int ret; | int ret; | ||||
enum mlx5_alloc_type type; | enum mlx5_alloc_type type; | ||||
enum mlx5_alloc_type default_type = MLX5_ALLOC_TYPE_ANON; | enum mlx5_alloc_type default_type = MLX5_ALLOC_TYPE_ANON; | ||||
if (mlx5_use_huge("HUGE_CQ")) | if (mlx5_use_huge("HUGE_CQ")) | ||||
default_type = MLX5_ALLOC_TYPE_HUGE; | default_type = MLX5_ALLOC_TYPE_HUGE; | ||||
mlx5_get_alloc_type(MLX5_CQ_PREFIX, &type, default_type); | mlx5_get_alloc_type(mctx, MLX5_CQ_PREFIX, &type, default_type); | ||||
ret = mlx5_alloc_prefered_buf(mctx, buf, | ret = mlx5_alloc_prefered_buf(mctx, buf, | ||||
align(nent * cqe_sz, dev->page_size), | align(nent * cqe_sz, dev->page_size), | ||||
dev->page_size, | dev->page_size, | ||||
type, | type, | ||||
MLX5_CQ_PREFIX); | MLX5_CQ_PREFIX); | ||||
if (ret) | if (ret) | ||||
Show All 17 Lines |