From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 3B1E5A052B; Tue, 28 Jul 2020 11:22:56 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 2F93B1C039; Tue, 28 Jul 2020 11:22:55 +0200 (CEST) Received: from git-send-mailer.rdmz.labs.mlnx (unknown [37.142.13.130]) by dpdk.org (Postfix) with ESMTP id 761E41BFF3 for ; Tue, 28 Jul 2020 11:22:53 +0200 (CEST) From: Xueming Li To: Cc: dev@dpdk.org, Asaf@dpdk.org, "Penso X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1595916684-30135-1-git-send-email-xuemingl@mellanox.com> References: <1595916684-30135-1-git-send-email-xuemingl@mellanox.com> Subject: [dpdk-dev] [v2] vdpa/mlx5: fix event queue number query X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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 Acked-by: Matan Azrad --- 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