From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.0 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8FFD9C433E8 for ; Tue, 28 Jul 2020 09:22:56 +0000 (UTC) Received: from dpdk.org (dpdk.org [92.243.14.124]) by mail.kernel.org (Postfix) with ESMTP id 4F75C206F5 for ; Tue, 28 Jul 2020 09:22:56 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4F75C206F5 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=mellanox.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=dev-bounces@dpdk.org 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