DPDK patches and discussions
 help / color / mirror / Atom feed
From: Xueming Li <xuemingl@mellanox.com>
Cc: dev@dpdk.org, Asaf@dpdk.org, "Penso <asafp"@mellanox.com
Subject: [dpdk-dev] [v2] vdpa/mlx5: fix event queue number query
Date: Tue, 28 Jul 2020 09:22:39 +0000	[thread overview]
Message-ID: <1595928159-10346-1-git-send-email-xuemingl@mellanox.com> (raw)
In-Reply-To: <1595916684-30135-1-git-send-email-xuemingl@mellanox.com>

With latest rte api, vdpa example failed on vq setup, the api to get
event queue of specified core failed.

After
commit 67ae5936c4fc36 ("eal: fix lcore accessors for non-EAL threads"),
code of "vhost-event" thread to get current cpu id returns -1.

On the other hand, internal api devx_query_eqn expects index of event
queue vectors, no need to use cpu id. As the doorbell handling thread is
per device, it's sufficient to use default event queue.

This patch uses the default id(0) as event queue index.

Fixes: 8395927cdfaf ("vdpa/mlx5: prepare HW queues")

Signed-off-by: Xueming Li <xuemingl@mellanox.com>
Acked-by: Matan Azrad <matan@mellanox.com>
---
 drivers/vdpa/mlx5/mlx5_vdpa_event.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/vdpa/mlx5/mlx5_vdpa_event.c b/drivers/vdpa/mlx5/mlx5_vdpa_event.c
index 13ad43611e..159831920f 100644
--- a/drivers/vdpa/mlx5/mlx5_vdpa_event.c
+++ b/drivers/vdpa/mlx5/mlx5_vdpa_event.c
@@ -51,12 +51,9 @@ mlx5_vdpa_event_qp_global_release(struct mlx5_vdpa_priv *priv)
 static int
 mlx5_vdpa_event_qp_global_prepare(struct mlx5_vdpa_priv *priv)
 {
-	uint32_t lcore;
-
 	if (priv->eventc)
 		return 0;
-	lcore = (uint32_t)rte_lcore_to_cpu_id(-1);
-	if (mlx5_glue->devx_query_eqn(priv->ctx, lcore, &priv->eqn)) {
+	if (mlx5_glue->devx_query_eqn(priv->ctx, 0, &priv->eqn)) {
 		rte_errno = errno;
 		DRV_LOG(ERR, "Failed to query EQ number %d.", rte_errno);
 		return -1;
-- 
2.17.1


  parent reply	other threads:[~2020-07-28  9:22 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-28  6:11 [dpdk-dev] [PATCH] vdpa/mlx5: use master core Id for vhost thread Xueming Li
2020-07-28  6:22 ` [dpdk-dev] [v1] vdpa/mlx5: use control " Xueming Li
2020-07-28  7:08 ` [dpdk-dev] [PATCH] vdpa/mlx5: use master " David Marchand
2020-07-28  7:19   ` Matan Azrad
2020-07-28  7:25     ` David Marchand
2020-07-28  7:30       ` Matan Azrad
2020-07-28  7:53         ` David Marchand
2020-07-28  8:06           ` Xueming(Steven) Li
2020-07-28  8:27             ` Matan Azrad
2020-07-28  8:30               ` David Marchand
2020-07-28  8:24 ` Xueming(Steven) Li
2020-07-28  9:22 ` Xueming Li [this message]
2020-07-28 12:05   ` [dpdk-dev] [v2] vdpa/mlx5: fix event queue number query David Marchand
2020-07-28 12:26     ` Xueming(Steven) Li
2020-07-28 12:32 ` [dpdk-dev] [v3] " Xueming Li
2020-07-28 14:04   ` Maxime Coquelin
2020-07-28 15:55   ` Maxime Coquelin

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=1595928159-10346-1-git-send-email-xuemingl@mellanox.com \
    --to=xuemingl@mellanox.com \
    --cc="Penso <asafp"@mellanox.com \
    --cc=Asaf@dpdk.org \
    --cc=dev@dpdk.org \
    /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).