{
return mlx5_glue->dealloc_pd(pd);
}
+
+static inline void *
+mlx5_os_umem_reg(void *ctx, void *addr, size_t size, uint32_t access)
+{
+ return mlx5_glue->devx_umem_reg(ctx, addr, size, access);
+}
+
+static inline int
+mlx5_os_umem_dereg(void *pumem)
+{
+ return mlx5_glue->devx_umem_dereg(pumem);
+}
#endif /* RTE_PMD_MLX5_COMMON_OS_H_ */
return NULL;
}
/* Register allocated memory. */
- page->umem = mlx5_glue->devx_umem_reg(ctx, page->dbrs,
+ page->umem = mlx5_os_umem_reg(ctx, page->dbrs,
MLX5_DBR_PAGE_SIZE, 0);
if (!page->umem) {
DRV_LOG(ERR, "cannot umem reg dbr page");
/* Page not used, free it and remove from list. */
LIST_REMOVE(page, next);
if (page->umem)
- ret = -mlx5_glue->devx_umem_dereg(page->umem);
+ ret = -mlx5_os_umem_dereg(page->umem);
mlx5_free(page);
} else {
/* Mark in bitmap that this door-bell is not in use. */
LIST_REMOVE(mng, next);
claim_zero(mlx5_devx_cmd_destroy(mng->dm));
- claim_zero(mlx5_glue->devx_umem_dereg(mng->umem));
+ claim_zero(mlx5_os_umem_dereg(mng->umem));
mlx5_free(mem);
}
struct mlx5_devx_dbr_page *dbr_page = rxq_ctrl->rq_dbrec_page;
if (rxq_ctrl->wq_umem) {
- mlx5_glue->devx_umem_dereg(rxq_ctrl->wq_umem);
+ mlx5_os_umem_dereg(rxq_ctrl->wq_umem);
rxq_ctrl->wq_umem = NULL;
}
if (rxq_ctrl->rxq.wqes) {
struct mlx5_devx_dbr_page *dbr_page = rxq_ctrl->cq_dbrec_page;
if (rxq_ctrl->cq_umem) {
- mlx5_glue->devx_umem_dereg(rxq_ctrl->cq_umem);
+ mlx5_os_umem_dereg(rxq_ctrl->cq_umem);
rxq_ctrl->cq_umem = NULL;
}
if (rxq_ctrl->rxq.cqes) {
if (!buf)
return NULL;
rxq_data->wqes = buf;
- rxq_ctrl->wq_umem = mlx5_glue->devx_umem_reg(priv->sh->ctx,
+ rxq_ctrl->wq_umem = mlx5_os_umem_reg(priv->sh->ctx,
buf, wq_size, 0);
if (!rxq_ctrl->wq_umem)
goto error;
goto error;
}
rxq_data->cqes = (volatile struct mlx5_cqe (*)[])(uintptr_t)buf;
- rxq_ctrl->cq_umem = mlx5_glue->devx_umem_reg(priv->sh->ctx, buf,
+ rxq_ctrl->cq_umem = mlx5_os_umem_reg(priv->sh->ctx, buf,
cq_size,
IBV_ACCESS_LOCAL_WRITE);
if (!rxq_ctrl->cq_umem) {
txq_obj->sq_devx = NULL;
}
if (txq_obj->sq_umem) {
- claim_zero(mlx5_glue->devx_umem_dereg(txq_obj->sq_umem));
+ claim_zero(mlx5_os_umem_dereg(txq_obj->sq_umem));
txq_obj->sq_umem = NULL;
}
if (txq_obj->sq_buf) {
if (txq_obj->cq_devx)
claim_zero(mlx5_devx_cmd_destroy(txq_obj->cq_devx));
if (txq_obj->cq_umem)
- claim_zero(mlx5_glue->devx_umem_dereg(txq_obj->cq_umem));
+ claim_zero(mlx5_os_umem_dereg(txq_obj->cq_umem));
if (txq_obj->cq_buf)
mlx5_free(txq_obj->cq_buf);
if (txq_obj->cq_dbrec_page)
return 0;
}
/* Register allocated buffer in user space with DevX. */
- txq_obj->cq_umem = mlx5_glue->devx_umem_reg(priv->sh->ctx,
+ txq_obj->cq_umem = mlx5_os_umem_reg(priv->sh->ctx,
(void *)txq_obj->cq_buf,
cqe_n * sizeof(struct mlx5_cqe),
IBV_ACCESS_LOCAL_WRITE);
goto error;
}
/* Register allocated buffer in user space with DevX. */
- txq_obj->sq_umem = mlx5_glue->devx_umem_reg
+ txq_obj->sq_umem = mlx5_os_umem_reg
(priv->sh->ctx,
(void *)txq_obj->sq_buf,
wqe_n * sizeof(struct mlx5_wqe),
}
mem_mng = (struct mlx5_counter_stats_mem_mng *)(mem + size) - 1;
size = sizeof(*raw_data) * MLX5_COUNTERS_PER_POOL * raws_n;
- mem_mng->umem = mlx5_glue->devx_umem_reg(sh->ctx, mem, size,
+ mem_mng->umem = mlx5_os_umem_reg(sh->ctx, mem, size,
IBV_ACCESS_LOCAL_WRITE);
if (!mem_mng->umem) {
rte_errno = errno;
mkey_attr.relaxed_ordering_read = sh->cmng.relaxed_ordering_read;
mem_mng->dm = mlx5_devx_cmd_mkey_create(sh->ctx, &mkey_attr);
if (!mem_mng->dm) {
- mlx5_glue->devx_umem_dereg(mem_mng->umem);
+ mlx5_os_umem_dereg(mem_mng->umem);
rte_errno = errno;
mlx5_free(mem);
return -rte_errno;
if (wq->sq)
claim_zero(mlx5_devx_cmd_destroy(wq->sq));
if (wq->sq_umem)
- claim_zero(mlx5_glue->devx_umem_dereg(wq->sq_umem));
+ claim_zero(mlx5_os_umem_dereg(wq->sq_umem));
if (wq->sq_buf)
mlx5_free((void *)(uintptr_t)wq->sq_buf);
if (wq->cq)
claim_zero(mlx5_devx_cmd_destroy(wq->cq));
if (wq->cq_umem)
- claim_zero(mlx5_glue->devx_umem_dereg(wq->cq_umem));
+ claim_zero(mlx5_os_umem_dereg(wq->cq_umem));
if (wq->cq_buf)
mlx5_free((void *)(uintptr_t)wq->cq_buf);
memset(wq, 0, sizeof(*wq));
return -ENOMEM;
}
/* Register allocated buffer in user space with DevX. */
- wq->cq_umem = mlx5_glue->devx_umem_reg(sh->ctx,
+ wq->cq_umem = mlx5_os_umem_reg(sh->ctx,
(void *)(uintptr_t)wq->cq_buf,
umem_size,
IBV_ACCESS_LOCAL_WRITE);
goto error;
}
/* Register allocated buffer in user space with DevX. */
- wq->sq_umem = mlx5_glue->devx_umem_reg(sh->ctx,
+ wq->sq_umem = mlx5_os_umem_reg(sh->ctx,
(void *)(uintptr_t)wq->sq_buf,
umem_size,
IBV_ACCESS_LOCAL_WRITE);
return -ENOMEM;
}
/* Register allocated buffer in user space with DevX. */
- wq->cq_umem = mlx5_glue->devx_umem_reg(sh->ctx,
+ wq->cq_umem = mlx5_os_umem_reg(sh->ctx,
(void *)(uintptr_t)wq->cq_buf,
umem_size,
IBV_ACCESS_LOCAL_WRITE);
goto error;
}
/* Register allocated buffer in user space with DevX. */
- wq->sq_umem = mlx5_glue->devx_umem_reg(sh->ctx,
+ wq->sq_umem = mlx5_os_umem_reg(sh->ctx,
(void *)(uintptr_t)wq->sq_buf,
umem_size,
IBV_ACCESS_LOCAL_WRITE);