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 84DFBA0521; Tue, 28 Jul 2020 08:22:49 +0200 (CEST) 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