[v4,2/2] graph: fix graph model check in core binding

Message ID 20230710071515.3143533-3-zhirun.yan@intel.com (mailing list archive)
State Accepted, archived
Delegated to: Thomas Monjalon
Headers
Series fix graph issues |

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/iol-mellanox-Performance success Performance Testing PASS
ci/iol-x86_64-compile-testing success Testing PASS
ci/iol-abi-testing success Testing PASS
ci/iol-aarch-unit-testing success Testing PASS
ci/github-robot: build success github build: passed
ci/iol-unit-testing success Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/intel-Functional success Functional PASS
ci/iol-testing success Testing PASS
ci/iol-x86_64-unit-testing success Testing PASS
ci/iol-aarch64-compile-testing success Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-intel-Functional success Functional Testing PASS

Commit Message

Yan, Zhirun July 10, 2023, 7:15 a.m. UTC
  This function is used for mcore dispatch model only, correct the check to
make sure it is the expected model. And specific the model by
rte_graph_worker_model_set() before call it in test. Update release notes
for new mcore dispatch model.

Fixes: ecb22a294980 ("graph: introduce graph bind unbind API")

Signed-off-by: Zhirun Yan <zhirun.yan@intel.com>
---
 app/test/test_graph.c                  |  6 ++++++
 doc/guides/rel_notes/release_23_07.rst | 10 ++++++++++
 lib/graph/graph.c                      |  2 +-
 3 files changed, 17 insertions(+), 1 deletion(-)
  

Comments

Jerin Jacob July 10, 2023, 9:29 a.m. UTC | #1
On Mon, Jul 10, 2023 at 1:09 PM Zhirun Yan <zhirun.yan@intel.com> wrote:
>
> This function is used for mcore dispatch model only, correct the check to
> make sure it is the expected model. And specific the model by
> rte_graph_worker_model_set() before call it in test. Update release notes
> for new mcore dispatch model.


Fix missing worker model section by invoking
rte_graph_worker_model_set(RTE_GRAPH_MODEL_MCORE_DISPATCH)
in test_graph_model_mcore_dispatch_core_bind_unbind() routine.

Also, Updated missing release notes for new mcore dispatch model addition
and sample l3fwd-graph update.

With above change,

Acked-by: Jerin Jacob <jerinj@marvell.com>
  

Patch

diff --git a/app/test/test_graph.c b/app/test/test_graph.c
index 47f5ab8395..af90ac07ec 100644
--- a/app/test/test_graph.c
+++ b/app/test/test_graph.c
@@ -737,6 +737,12 @@  test_graph_model_mcore_dispatch_core_bind_unbind(void)
 	worker_lcore = rte_get_next_lcore(worker_lcore, true, 1);
 	cloned_graph_id = rte_graph_clone(graph_id, "cloned-test2", &graph_conf);
 
+	ret = rte_graph_worker_model_set(RTE_GRAPH_MODEL_MCORE_DISPATCH);
+	if (ret != 0) {
+		printf("Set graph mcore dispatch model failed\n");
+		ret = -1;
+	}
+
 	ret = rte_graph_model_mcore_dispatch_core_bind(cloned_graph_id, worker_lcore);
 	if (ret != 0) {
 		printf("bind graph %d to lcore %u failed\n", graph_id, worker_lcore);
diff --git a/doc/guides/rel_notes/release_23_07.rst b/doc/guides/rel_notes/release_23_07.rst
index dcfd692425..7f1c2e66d5 100644
--- a/doc/guides/rel_notes/release_23_07.rst
+++ b/doc/guides/rel_notes/release_23_07.rst
@@ -185,6 +185,12 @@  New Features
 
   * Added SM2 algorithm support in asymmetric crypto operations.
 
+* **Added mcore dispatch model in rte_graph library.**
+
+  * Added set, get and validate model APIs to enhance graph framework
+    to chose different walk models.
+  * Added mcore dispatch model to support cross-core dispatching mechanism.
+
 * **Added PDCP Library.**
 
   Added an experimental library to provide PDCP UL and DL processing of packets.
@@ -206,6 +212,10 @@  New Features
 
   See the :doc:`../tools/dmaperf` for more details.
 
+* **Update l3fwd-graph sample application.**
+
+  Added a new cmdline option ``--model`` which can be used to chose
+  RTC or mcore dispatch model.
 
 Removed Items
 -------------
diff --git a/lib/graph/graph.c b/lib/graph/graph.c
index 0c28d925bc..26f0968a97 100644
--- a/lib/graph/graph.c
+++ b/lib/graph/graph.c
@@ -287,7 +287,7 @@  rte_graph_model_mcore_dispatch_core_bind(rte_graph_t id, int lcore)
 		if (graph->id == id)
 			break;
 
-	if (graph->graph->model == RTE_GRAPH_MODEL_MCORE_DISPATCH)
+	if (graph->graph->model != RTE_GRAPH_MODEL_MCORE_DISPATCH)
 		goto fail;
 
 	graph->lcore_id = lcore;