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 2A22FC433F7 for ; Tue, 28 Jul 2020 06:22:50 +0000 (UTC) Received: from dpdk.org (dpdk.org [92.243.14.124]) by mail.kernel.org (Postfix) with ESMTP id D67FC20759 for ; Tue, 28 Jul 2020 06:22:49 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D67FC20759 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 300991C0B9; Tue, 28 Jul 2020 08:22:48 +0200 (CEST) Received: from git-send-mailer.rdmz.labs.mlnx (unknown [37.142.13.130]) by dpdk.org (Postfix) with ESMTP id 596DD1C0B6 for ; Tue, 28 Jul 2020 08:22:46 +0200 (CEST) From: Xueming Li To: Cc: dev@dpdk.org, Asaf Penso Date: Tue, 28 Jul 2020 06:22:16 +0000 Message-Id: <1595917336-30613-1-git-send-email-xuemingl@mellanox.com> 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] [v1] vdpa/mlx5: use control core Id for vhost thread 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. The api to get event queue needs core id as input, but after commit 67ae5936c4fc36 ("eal: fix lcore accessors for non-EAL threads"), code of "vhost-event" thread to get current core returns -1, an invalid core id. As vhost thread created on same core of eal control core, this patch uses control core ID as a workaround. Signed-off-by: Xueming Li Acked-by: Matan Azrad --- drivers/vdpa/mlx5/mlx5_vdpa_event.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/vdpa/mlx5/mlx5_vdpa_event.c b/drivers/vdpa/mlx5/mlx5_vdpa_event.c index 13ad43611e..ff6db8e345 100644 --- a/drivers/vdpa/mlx5/mlx5_vdpa_event.c +++ b/drivers/vdpa/mlx5/mlx5_vdpa_event.c @@ -55,7 +55,7 @@ mlx5_vdpa_event_qp_global_prepare(struct mlx5_vdpa_priv *priv) if (priv->eventc) return 0; - lcore = (uint32_t)rte_lcore_to_cpu_id(-1); + lcore = (uint32_t)rte_get_master_lcore(); if (mlx5_glue->devx_query_eqn(priv->ctx, lcore, &priv->eqn)) { rte_errno = errno; DRV_LOG(ERR, "Failed to query EQ number %d.", rte_errno); -- 2.17.1