From patchwork Fri Mar 22 15:46:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jingjing Wu X-Patchwork-Id: 138739 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id DB67743D1E; Fri, 22 Mar 2024 08:54:46 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9471F42DF1; Fri, 22 Mar 2024 08:54:46 +0100 (CET) Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.15]) by mails.dpdk.org (Postfix) with ESMTP id 36E714003C for ; Fri, 22 Mar 2024 08:54:44 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1711094084; x=1742630084; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=CZO8OW3lwL+kxAVB96e7MrjR+ogwZsOG0ITm4MsfNCQ=; b=gkRQHTcJ2XFXlfNma3gnd/vxxF+i1iQkOM593AVi7/+2wy0PFCz9T43r P39l2V2Dd3PzcUtxZNmbDhn8W3qbF1Sx/0994fVmnDEMfY6+eSMsnP2IQ ec9ASTr15KP85bLvpnrNz7WToyCaLOVUA3QsniZLvKtrj7Rn+eMZj9/qT +7LzXYt9VO4Z/OFCH94VaingY+lq1OBQ4A1dMP+FPz7RxjI6+Xeh9Zjs5 Kj5QaAzLuBhhNCMCypbs84JGI0DFkeMr1kbIAFysE8FVfHjOYm5d8Elbd EJRdxUEE7UWGlCp/xx/AChKhN/5+g7GsSD/hiozdhOkV4DB6X0PQJSEo3 w==; X-IronPort-AV: E=McAfee;i="6600,9927,11020"; a="6314441" X-IronPort-AV: E=Sophos;i="6.07,145,1708416000"; d="scan'208";a="6314441" Received: from orviesa005.jf.intel.com ([10.64.159.145]) by fmvoesa109.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Mar 2024 00:54:43 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,145,1708416000"; d="scan'208";a="19531810" Received: from dpdk-wujingji-spr.sh.intel.com ([10.67.111.103]) by orviesa005.jf.intel.com with ESMTP; 22 Mar 2024 00:54:42 -0700 From: Jingjing Wu To: dev@dpdk.org Cc: jingjing.wu@intel.com, jerinj@marvell.com, pbhagavatula@marvell.com, zhirun.yan@intel.com Subject: [PATCH v2] graph: fix head move when graph walk in mcore dispatch Date: Fri, 22 Mar 2024 15:46:37 +0000 Message-Id: <20240322154637.1346239-1-jingjing.wu@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240319141454.3275543-1-jingjing.wu@intel.com> References: <20240319141454.3275543-1-jingjing.wu@intel.com> MIME-Version: 1.0 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Head move happens before the core id check, which will cause the last source node be executed even core id is not correct. This patch changes head check to less than 1 instead of 0 to fix this issue. Fixes: 35dfd9b9fd85 ("graph: introduce graph walk by cross-core dispatch") Signed-off-by: Jingjing Wu Acked-by: Zhirun Yan --- lib/graph/rte_graph_model_mcore_dispatch.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/graph/rte_graph_model_mcore_dispatch.h b/lib/graph/rte_graph_model_mcore_dispatch.h index 75ec388cad..1cc75b7ac4 100644 --- a/lib/graph/rte_graph_model_mcore_dispatch.h +++ b/lib/graph/rte_graph_model_mcore_dispatch.h @@ -100,9 +100,8 @@ rte_graph_walk_mcore_dispatch(struct rte_graph *graph) node = (struct rte_node *)RTE_PTR_ADD(graph, cir_start[(int32_t)head++]); /* skip the src nodes which not bind with current worker */ - if ((int32_t)head < 0 && node->dispatch.lcore_id != graph->dispatch.lcore_id) + if ((int32_t)head < 1 && node->dispatch.lcore_id != graph->dispatch.lcore_id) continue; - /* Schedule the node until all task/objs are done */ if (node->dispatch.lcore_id != RTE_MAX_LCORE && graph->dispatch.lcore_id != node->dispatch.lcore_id &&