[PATCH v2] graph: fix head move when graph walk in mcore dispatch

Jingjing Wu jingjing.wu at intel.com
Fri Mar 22 16:46:37 CET 2024


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 <jingjing.wu at intel.com>
---
 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 &&
-- 
2.34.1



More information about the dev mailing list