[PATCH rdma-core] mlx5: Return pointer to CQ doorbell

Yishai Hadas
2017-08-17T13:36:38Z

From: Leon Romanovsky <leonro-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>

The returned UAR pointer is actually void ** and points to whole
UAR database.

Because user is not supposed to access it and expected to use
the CQ doorbell, we will return uar[0] (CQ doorbell) directly
and eliminate the following logic in the applications:

uint64_t cq_db_reg = (uint64_t *)(((uint64_t)(uint64_t *)rxq->cq_uar) +
MLX5_CQ_DOORBELL;

Signed-off-by: Leon Romanovsky <leonro-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
Reviewed-by: Yishai Hadas <yishaih-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
---

Pull request was sent:
https://github.com/linux-rdma/rdma-core/pull/184

providers/mlx5/mlx5.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/providers/mlx5/mlx5.c b/providers/mlx5/mlx5.c
index ede91cb..c7a6efb 100644
--- a/providers/mlx5/mlx5.c
+++ b/providers/mlx5/mlx5.c
@@ -678,7 +678,7 @@ static int mlx5dv_get_cq(struct ibv_cq *cq_in,
cq_out->cqe_size = mcq->cqe_sz;
cq_out->buf = mcq->active_buf->buf;
cq_out->dbrec = mcq->dbrec;
- cq_out->uar = mctx->uar;
+ cq_out->uar = mctx->uar[0];

mcq->flags |= MLX5_CQ_FLAGS_DV_OWNED;

--
1.8.3.1