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 DFDC6A0521; Tue, 28 Jul 2020 08:11:45 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id BD53F1C027; Tue, 28 Jul 2020 08:11:44 +0200 (CEST) Received: from git-send-mailer.rdmz.labs.mlnx (unknown [37.142.13.130]) by dpdk.org (Postfix) with ESMTP id D63481C012 for ; Tue, 28 Jul 2020 08:11:42 +0200 (CEST) From: Xueming Li To: Cc: dev@dpdk.org, Asaf Penso Date: Tue, 28 Jul 2020 06:11:24 +0000 Message-Id: <1595916684-30135-1-git-send-email-xuemingl@mellanox.com> X-Mailer: git-send-email 1.8.3.1 Subject: [dpdk-dev] [PATCH] vdpa/mlx5: use master 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 master core, this patch uses master 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