From 8fe4d212dc341de6a7d6b1c8ca8ec36653a8bb51 Mon Sep 17 00:00:00 2001 From: Xueming Li Date: Tue, 17 Oct 2017 15:51:17 +0800 Subject: [PATCH] net/mlx5: fix secondary process Tx error Uninitialized UAR mmap offset caused secondary tx doorbell mapped to wrong address. This patch restores missing UAR mmap offset init code overridden by wrong merge. Fixes: faf2667fe8d5 ("net/mlx5: separate DPDK from verbs Tx queue objects") Signed-off-by: Xueming Li Acked-by: Nelio Laranjeiro --- drivers/net/mlx5/mlx5_txq.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/net/mlx5/mlx5_txq.c b/drivers/net/mlx5/mlx5_txq.c index 9deaa7ea30..3d5f033702 100644 --- a/drivers/net/mlx5/mlx5_txq.c +++ b/drivers/net/mlx5/mlx5_txq.c @@ -303,7 +303,7 @@ mlx5_priv_txq_ibv_new(struct priv *priv, uint16_t idx) struct ibv_cq_ex cq_attr; } attr; unsigned int cqe_n; - struct mlx5dv_qp qp; + struct mlx5dv_qp qp = { .comp_mask = MLX5DV_QP_MASK_UAR_MMAP_OFFSET }; struct mlx5dv_cq cq_info; struct mlx5dv_obj obj; const int desc = 1 << txq_data->elts_n; @@ -429,6 +429,12 @@ mlx5_priv_txq_ibv_new(struct priv *priv, uint16_t idx) txq_ibv->qp = tmpl.qp; txq_ibv->cq = tmpl.cq; rte_atomic32_inc(&txq_ibv->refcnt); + if (qp.comp_mask & MLX5DV_QP_MASK_UAR_MMAP_OFFSET) { + txq_ctrl->uar_mmap_offset = qp.uar_mmap_offset; + } else { + ERROR("Failed to retrieve UAR info, invalid libmlx5.so version"); + goto error; + } DEBUG("%p: Verbs Tx queue %p: refcnt %d", (void *)priv, (void *)txq_ibv, rte_atomic32_read(&txq_ibv->refcnt)); LIST_INSERT_HEAD(&priv->txqsibv, txq_ibv, next); -- 2.20.1