From: Viacheslav Ovsiienko Date: Tue, 10 Nov 2020 16:04:18 +0000 (+0000) Subject: vdpa/mlx5: fix UAR allocation X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=b9aa4ba7ce8035183abb03faa8a3f2ee3fe11cc6;p=dpdk.git vdpa/mlx5: fix UAR allocation This patch provides the UAR allocation workaround for the hosts where UAR allocation with Write-Combining memory mapping type fails. Fixes: 8395927cdfaf ("vdpa/mlx5: prepare HW queues") Cc: stable@dpdk.org Signed-off-by: Viacheslav Ovsiienko Acked-by: Matan Azrad --- diff --git a/drivers/vdpa/mlx5/mlx5_vdpa_event.c b/drivers/vdpa/mlx5/mlx5_vdpa_event.c index 010543cb6a..3aeaeb893f 100644 --- a/drivers/vdpa/mlx5/mlx5_vdpa_event.c +++ b/drivers/vdpa/mlx5/mlx5_vdpa_event.c @@ -77,7 +77,12 @@ mlx5_vdpa_event_qp_global_prepare(struct mlx5_vdpa_priv *priv) DRV_LOG(ERR, "Failed to change event channel FD."); goto error; } - priv->uar = mlx5_glue->devx_alloc_uar(priv->ctx, 0); + /* + * This PMD always claims the write memory barrier on UAR + * registers writings, it is safe to allocate UAR with any + * memory mapping type. + */ + priv->uar = mlx5_devx_alloc_uar(priv->ctx, -1); if (!priv->uar) { rte_errno = errno; DRV_LOG(ERR, "Failed to allocate UAR.");