DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] net/mlx5: fix secondary process TX error
@ 2017-10-17  7:45 Xueming Li
  2017-10-17  7:51 ` [dpdk-dev] [PATCH v2] " Xueming Li
  0 siblings, 1 reply; 4+ messages in thread
From: Xueming Li @ 2017-10-17  7:45 UTC (permalink / raw)
  To: Nelio Laranjeiro; +Cc: Xueming Li, dev

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [dpdk-dev] [PATCH v2] net/mlx5: fix secondary process TX error
  2017-10-17  7:45 [dpdk-dev] [PATCH] net/mlx5: fix secondary process TX error Xueming Li
@ 2017-10-17  7:51 ` Xueming Li
  2017-10-17  7:57   ` Nélio Laranjeiro
  0 siblings, 1 reply; 4+ messages in thread
From: Xueming Li @ 2017-10-17  7:51 UTC (permalink / raw)
  To: Nelio Laranjeiro; +Cc: Xueming Li, dev

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..3d5f03370 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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [dpdk-dev] [PATCH v2] net/mlx5: fix secondary process TX error
  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
  0 siblings, 1 reply; 4+ messages in thread
From: Nélio Laranjeiro @ 2017-10-17  7:57 UTC (permalink / raw)
  To: Xueming Li; +Cc: dev

On Tue, Oct 17, 2017 at 03:51:17PM +0800, Xueming Li wrote:
> 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>
Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>

-- 
Nélio Laranjeiro
6WIND

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [dpdk-dev] [PATCH v2] net/mlx5: fix secondary process TX error
  2017-10-17  7:57   ` Nélio Laranjeiro
@ 2017-10-23 17:28     ` Ferruh Yigit
  0 siblings, 0 replies; 4+ messages in thread
From: Ferruh Yigit @ 2017-10-23 17:28 UTC (permalink / raw)
  To: Nélio Laranjeiro, Xueming Li; +Cc: dev

On 10/17/2017 12:57 AM, Nélio Laranjeiro wrote:
> On Tue, Oct 17, 2017 at 03:51:17PM +0800, Xueming Li wrote:
>> 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>
> Acked-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>

Applied to dpdk-next-net/master, thanks.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-10-23 17:28 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-17  7:45 [dpdk-dev] [PATCH] net/mlx5: fix secondary process TX error Xueming Li
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

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