DPDK patches and discussions
 help / color / mirror / Atom feed
From: Xueming Li <xuemingl@mellanox.com>
To: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Cc: Xueming Li <xuemingl@mellanox.com>, dev@dpdk.org
Subject: [dpdk-dev] [PATCH] net/mlx5: fix secondary process TX error
Date: Tue, 17 Oct 2017 15:45:35 +0800	[thread overview]
Message-ID: <20171017074535.80245-1-xuemingl@mellanox.com> (raw)

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 ...")

Signed-off-by: Xueming Li <xuemingl@mellanox.com>
---
 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 9deaa7ea3..290e614dc 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.13.3

             reply	other threads:[~2017-10-17  7:45 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-17  7:45 Xueming Li [this message]
2017-10-17  7:51 ` [dpdk-dev] [PATCH v2] " Xueming Li
2017-10-17  7:57   ` Nélio Laranjeiro
2017-10-23 17:28     ` Ferruh Yigit

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171017074535.80245-1-xuemingl@mellanox.com \
    --to=xuemingl@mellanox.com \
    --cc=dev@dpdk.org \
    --cc=nelio.laranjeiro@6wind.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).