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

Message ID 20240322154637.1346239-1-jingjing.wu@intel.com (mailing list archive)
State New
Delegated to: Thomas Monjalon
Headers
Series [v2] graph: fix head move when graph walk in mcore dispatch |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/loongarch-compilation success Compilation OK
ci/loongarch-unit-testing success Unit Testing PASS
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/github-robot: build success github build: passed
ci/intel-Functional success Functional PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-compile-amd64-testing success Testing PASS
ci/iol-unit-arm64-testing success Testing PASS
ci/iol-abi-testing success Testing PASS
ci/iol-unit-amd64-testing success Testing PASS
ci/iol-sample-apps-testing success Testing PASS
ci/iol-compile-arm64-testing success Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS

Commit Message

Jingjing Wu March 22, 2024, 3:46 p.m. UTC
  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@intel.com>
---
 lib/graph/rte_graph_model_mcore_dispatch.h | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
  

Comments

Yan, Zhirun March 28, 2024, 8:32 a.m. UTC | #1
> -----Original Message-----
> From: Wu, Jingjing <jingjing.wu@intel.com>
> Sent: Friday, March 22, 2024 11:47 PM
> To: dev@dpdk.org
> Cc: Wu, Jingjing <jingjing.wu@intel.com>; jerinj@marvell.com;
> pbhagavatula@marvell.com; Yan, Zhirun <zhirun.yan@intel.com>
> Subject: [PATCH v2] graph: fix head move when graph walk in mcore dispatch
> 
> 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@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;
> -
No need for this line.

>  		/* 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

With small change,

Acked-by: Zhirun Yan <zhirun.yan@intel.com>
  

Patch

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 &&