DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH v1] graph: fix graph model check in core binding
@ 2023-07-03  7:29 Zhirun Yan
  2023-07-03  9:55 ` [PATCH v2] " Zhirun Yan
  0 siblings, 1 reply; 13+ messages in thread
From: Zhirun Yan @ 2023-07-03  7:29 UTC (permalink / raw)
  To: dev, jerinj, kirankumark, ndabilpuram; +Cc: qi.fu, Zhirun Yan

Fix graph model check in core binding with graph.
Update release notes for new mcore dispatch model.

Signed-off-by: Zhirun Yan <zhirun.yan@intel.com>
---
 doc/guides/rel_notes/release_23_07.rst | 12 ++++++++++++
 lib/graph/graph.c                      |  2 +-
 2 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/doc/guides/rel_notes/release_23_07.rst b/doc/guides/rel_notes/release_23_07.rst
index 4459144140..adaecb3e7c 100644
--- a/doc/guides/rel_notes/release_23_07.rst
+++ b/doc/guides/rel_notes/release_23_07.rst
@@ -185,6 +185,13 @@ 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 clone graph, bind graph with lcore and affinity node with
+    lcore APIs to support mcore dispatch model.
+
 * **Added PDCP Library.**
 
   Added an experimental library to provide PDCP UL and DL processing of packets.
@@ -200,6 +207,11 @@ New Features
 
   Enhanced the GRO library to support TCP packets over IPv6 network.
 
+* **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;
-- 
2.37.2


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [PATCH v2] graph: fix graph model check in core binding
  2023-07-03  7:29 [PATCH v1] graph: fix graph model check in core binding Zhirun Yan
@ 2023-07-03  9:55 ` Zhirun Yan
  2023-07-04  9:10   ` Jerin Jacob
  2023-07-05  1:56   ` [PATCH v3] " Zhirun Yan
  0 siblings, 2 replies; 13+ messages in thread
From: Zhirun Yan @ 2023-07-03  9:55 UTC (permalink / raw)
  To: dev, jerinj, kirankumark, ndabilpuram; +Cc: qi.fu, Zhirun Yan

Fix graph model check in core binding with graph. And rte_graph_clone()
need to use valid params rather than NULL pointer.
Update release notes for new mcore dispatch model.

Signed-off-by: Zhirun Yan <zhirun.yan@intel.com>
---
 app/test/test_graph.c                  | 15 ++++++++++++---
 doc/guides/rel_notes/release_23_07.rst | 12 ++++++++++++
 lib/graph/graph.c                      |  2 +-
 3 files changed, 25 insertions(+), 4 deletions(-)

diff --git a/app/test/test_graph.c b/app/test/test_graph.c
index 8609c0b3a4..8983363c8e 100644
--- a/app/test/test_graph.c
+++ b/app/test/test_graph.c
@@ -702,6 +702,7 @@ test_graph_model_mcore_dispatch_node_lcore_affinity_set(void)
 	unsigned int worker_lcore = RTE_MAX_LCORE;
 	rte_node_t nid = RTE_NODE_ID_INVALID;
 	char node_name[64] = "test_node00";
+	struct rte_graph_param graph_conf;
 	struct rte_node *node;
 	int ret = 0;
 
@@ -711,7 +712,7 @@ test_graph_model_mcore_dispatch_node_lcore_affinity_set(void)
 		printf("Set node %s affinity to lcore %u\n", node_name, worker_lcore);
 
 	nid = rte_node_from_name(node_name);
-	cloned_graph_id = rte_graph_clone(graph_id, "cloned-test1", NULL);
+	cloned_graph_id = rte_graph_clone(graph_id, "cloned-test1", &graph_conf);
 	node = rte_graph_node_get(cloned_graph_id, nid);
 
 	if (node->dispatch.lcore_id != worker_lcore) {
@@ -729,11 +730,18 @@ test_graph_model_mcore_dispatch_core_bind_unbind(void)
 {
 	rte_graph_t cloned_graph_id = RTE_GRAPH_ID_INVALID;
 	unsigned int worker_lcore = RTE_MAX_LCORE;
+	struct rte_graph_param graph_conf;
 	struct rte_graph *graph;
 	int ret = 0;
 
 	worker_lcore = rte_get_next_lcore(worker_lcore, true, 1);
-	cloned_graph_id = rte_graph_clone(graph_id, "cloned-test2", NULL);
+	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) {
@@ -765,10 +773,11 @@ static int
 test_graph_worker_model_set_get(void)
 {
 	rte_graph_t cloned_graph_id = RTE_GRAPH_ID_INVALID;
+	struct rte_graph_param graph_conf;
 	struct rte_graph *graph;
 	int ret = 0;
 
-	cloned_graph_id = rte_graph_clone(graph_id, "cloned-test3", NULL);
+	cloned_graph_id = rte_graph_clone(graph_id, "cloned-test3", &graph_conf);
 	ret = rte_graph_worker_model_set(RTE_GRAPH_MODEL_MCORE_DISPATCH);
 	if (ret != 0) {
 		printf("Set graph mcore dispatch model failed\n");
diff --git a/doc/guides/rel_notes/release_23_07.rst b/doc/guides/rel_notes/release_23_07.rst
index 4459144140..adaecb3e7c 100644
--- a/doc/guides/rel_notes/release_23_07.rst
+++ b/doc/guides/rel_notes/release_23_07.rst
@@ -185,6 +185,13 @@ 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 clone graph, bind graph with lcore and affinity node with
+    lcore APIs to support mcore dispatch model.
+
 * **Added PDCP Library.**
 
   Added an experimental library to provide PDCP UL and DL processing of packets.
@@ -200,6 +207,11 @@ New Features
 
   Enhanced the GRO library to support TCP packets over IPv6 network.
 
+* **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;
-- 
2.37.2


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH v2] graph: fix graph model check in core binding
  2023-07-03  9:55 ` [PATCH v2] " Zhirun Yan
@ 2023-07-04  9:10   ` Jerin Jacob
  2023-07-05  0:50     ` Yan, Zhirun
  2023-07-05  1:56   ` [PATCH v3] " Zhirun Yan
  1 sibling, 1 reply; 13+ messages in thread
From: Jerin Jacob @ 2023-07-04  9:10 UTC (permalink / raw)
  To: Zhirun Yan; +Cc: dev, jerinj, kirankumark, ndabilpuram, qi.fu

On Mon, Jul 3, 2023 at 3:35 PM Zhirun Yan <zhirun.yan@intel.com> wrote:
>
> Fix graph model check in core binding with graph. And rte_graph_clone()
> need to use valid params rather than NULL pointer.
> Update release notes for new mcore dispatch model.


Please add Fixes:

> Signed-off-by: Zhirun Yan <zhirun.yan@intel.com>
> ---
>  app/test/test_graph.c                  | 15 ++++++++++++---
>  doc/guides/rel_notes/release_23_07.rst | 12 ++++++++++++
>  lib/graph/graph.c                      |  2 +-
>  3 files changed, 25 insertions(+), 4 deletions(-)

> +* **Added mcore dispatch model in rte_graph library.**
> +
> +  * Added set, get and validate model APIs to enhance graph framework
> +    to chose different walk models.

Adding one line for what is "mcore dispatch model" will be good.

> +  * Added clone graph, bind graph with lcore and affinity node with
> +    lcore APIs to support mcore dispatch model.

I think, Above, statement,  you can remove.

> +
>  * **Added PDCP Library.**
>
>    Added an experimental library to provide PDCP UL and DL processing of packets.
> @@ -200,6 +207,11 @@ New Features
>
>    Enhanced the GRO library to support TCP packets over IPv6 network.
>
> +* **Update l3fwd-graph sample application.**
> +
> +  Added a new cmdline option ``--model`` which can be used to chose
> +  RTC or mcore dispatch model.
> +

^ permalink raw reply	[flat|nested] 13+ messages in thread

* RE: [PATCH v2] graph: fix graph model check in core binding
  2023-07-04  9:10   ` Jerin Jacob
@ 2023-07-05  0:50     ` Yan, Zhirun
  0 siblings, 0 replies; 13+ messages in thread
From: Yan, Zhirun @ 2023-07-05  0:50 UTC (permalink / raw)
  To: Jerin Jacob; +Cc: dev, jerinj, kirankumark, ndabilpuram, Fu, Qi



> -----Original Message-----
> From: Jerin Jacob <jerinjacobk@gmail.com>
> Sent: Tuesday, July 4, 2023 5:10 PM
> To: Yan, Zhirun <zhirun.yan@intel.com>
> Cc: dev@dpdk.org; jerinj@marvell.com; kirankumark@marvell.com;
> ndabilpuram@marvell.com; Fu, Qi <qi.fu@intel.com>
> Subject: Re: [PATCH v2] graph: fix graph model check in core binding
> 
> On Mon, Jul 3, 2023 at 3:35 PM Zhirun Yan <zhirun.yan@intel.com> wrote:
> >
> > Fix graph model check in core binding with graph. And
> > rte_graph_clone() need to use valid params rather than NULL pointer.
> > Update release notes for new mcore dispatch model.
> 
> 
> Please add Fixes:
Ok.
> 
> > Signed-off-by: Zhirun Yan <zhirun.yan@intel.com>
> > ---
> >  app/test/test_graph.c                  | 15 ++++++++++++---
> >  doc/guides/rel_notes/release_23_07.rst | 12 ++++++++++++
> >  lib/graph/graph.c                      |  2 +-
> >  3 files changed, 25 insertions(+), 4 deletions(-)
> 
> > +* **Added mcore dispatch model in rte_graph library.**
> > +
> > +  * Added set, get and validate model APIs to enhance graph framework
> > +    to chose different walk models.
> 
> Adding one line for what is "mcore dispatch model" will be good.
> 
Got it. Will add in next version.

> > +  * Added clone graph, bind graph with lcore and affinity node with
> > +    lcore APIs to support mcore dispatch model.
> 
> I think, Above, statement,  you can remove.
Yes. Thanks.

> 
> > +
> >  * **Added PDCP Library.**
> >
> >    Added an experimental library to provide PDCP UL and DL processing of
> packets.
> > @@ -200,6 +207,11 @@ New Features
> >
> >    Enhanced the GRO library to support TCP packets over IPv6 network.
> >
> > +* **Update l3fwd-graph sample application.**
> > +
> > +  Added a new cmdline option ``--model`` which can be used to chose
> > + RTC or mcore dispatch model.
> > +

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [PATCH v3] graph: fix graph model check in core binding
  2023-07-03  9:55 ` [PATCH v2] " Zhirun Yan
  2023-07-04  9:10   ` Jerin Jacob
@ 2023-07-05  1:56   ` Zhirun Yan
  2023-07-07 10:16     ` Jerin Jacob
  2023-07-10  7:15     ` [PATCH v4 0/2] fix graph issues Zhirun Yan
  1 sibling, 2 replies; 13+ messages in thread
From: Zhirun Yan @ 2023-07-05  1:56 UTC (permalink / raw)
  To: dev, jerinj, kirankumark, ndabilpuram; +Cc: qi.fu, Zhirun Yan

Fix graph model check in core binding with graph. And rte_graph_clone()
need to use valid params rather than NULL pointer. Update release notes
for new mcore dispatch model.

Fixes: ecb22a294980 ("graph: introduce graph bind unbind API")
Fixes: 67e2303cd823 ("test/graph: add functional tests for mcore dispatch model")

Signed-off-by: Zhirun Yan <zhirun.yan@intel.com>
---
 app/test/test_graph.c                  | 15 ++++++++++++---
 doc/guides/rel_notes/release_23_07.rst | 11 +++++++++++
 lib/graph/graph.c                      |  2 +-
 3 files changed, 24 insertions(+), 4 deletions(-)

diff --git a/app/test/test_graph.c b/app/test/test_graph.c
index 8609c0b3a4..8983363c8e 100644
--- a/app/test/test_graph.c
+++ b/app/test/test_graph.c
@@ -702,6 +702,7 @@ test_graph_model_mcore_dispatch_node_lcore_affinity_set(void)
 	unsigned int worker_lcore = RTE_MAX_LCORE;
 	rte_node_t nid = RTE_NODE_ID_INVALID;
 	char node_name[64] = "test_node00";
+	struct rte_graph_param graph_conf;
 	struct rte_node *node;
 	int ret = 0;
 
@@ -711,7 +712,7 @@ test_graph_model_mcore_dispatch_node_lcore_affinity_set(void)
 		printf("Set node %s affinity to lcore %u\n", node_name, worker_lcore);
 
 	nid = rte_node_from_name(node_name);
-	cloned_graph_id = rte_graph_clone(graph_id, "cloned-test1", NULL);
+	cloned_graph_id = rte_graph_clone(graph_id, "cloned-test1", &graph_conf);
 	node = rte_graph_node_get(cloned_graph_id, nid);
 
 	if (node->dispatch.lcore_id != worker_lcore) {
@@ -729,11 +730,18 @@ test_graph_model_mcore_dispatch_core_bind_unbind(void)
 {
 	rte_graph_t cloned_graph_id = RTE_GRAPH_ID_INVALID;
 	unsigned int worker_lcore = RTE_MAX_LCORE;
+	struct rte_graph_param graph_conf;
 	struct rte_graph *graph;
 	int ret = 0;
 
 	worker_lcore = rte_get_next_lcore(worker_lcore, true, 1);
-	cloned_graph_id = rte_graph_clone(graph_id, "cloned-test2", NULL);
+	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) {
@@ -765,10 +773,11 @@ static int
 test_graph_worker_model_set_get(void)
 {
 	rte_graph_t cloned_graph_id = RTE_GRAPH_ID_INVALID;
+	struct rte_graph_param graph_conf;
 	struct rte_graph *graph;
 	int ret = 0;
 
-	cloned_graph_id = rte_graph_clone(graph_id, "cloned-test3", NULL);
+	cloned_graph_id = rte_graph_clone(graph_id, "cloned-test3", &graph_conf);
 	ret = rte_graph_worker_model_set(RTE_GRAPH_MODEL_MCORE_DISPATCH);
 	if (ret != 0) {
 		printf("Set graph mcore dispatch model failed\n");
diff --git a/doc/guides/rel_notes/release_23_07.rst b/doc/guides/rel_notes/release_23_07.rst
index 4459144140..8c62ebf690 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.
@@ -200,6 +206,11 @@ New Features
 
   Enhanced the GRO library to support TCP packets over IPv6 network.
 
+* **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;
-- 
2.37.2


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH v3] graph: fix graph model check in core binding
  2023-07-05  1:56   ` [PATCH v3] " Zhirun Yan
@ 2023-07-07 10:16     ` Jerin Jacob
  2023-07-10  5:08       ` Yan, Zhirun
  2023-07-10  7:15     ` [PATCH v4 0/2] fix graph issues Zhirun Yan
  1 sibling, 1 reply; 13+ messages in thread
From: Jerin Jacob @ 2023-07-07 10:16 UTC (permalink / raw)
  To: Zhirun Yan; +Cc: dev, jerinj, kirankumark, ndabilpuram, qi.fu

On Wed, Jul 5, 2023 at 7:38 AM Zhirun Yan <zhirun.yan@intel.com> wrote:
>
> Fix graph model check in core binding with graph. And rte_graph_clone()

Two fixes, Lets have two patches. Also tell what is fixed and how it is fixed.


> need to use valid params rather than NULL pointer. Update release notes
> for new mcore dispatch model.
>
> Fixes: ecb22a294980 ("graph: introduce graph bind unbind API")
> Fixes: 67e2303cd823 ("test/graph: add functional tests for mcore dispatch model")
>
> Signed-off-by: Zhirun Yan <zhirun.yan@intel.com>
> ---
>  app/test/test_graph.c                  | 15 ++++++++++++---
>  doc/guides/rel_notes/release_23_07.rst | 11 +++++++++++
>  lib/graph/graph.c                      |  2 +-
>  3 files changed, 24 insertions(+), 4 deletions(-)
>
> diff --git a/app/test/test_graph.c b/app/test/test_graph.c
> index 8609c0b3a4..8983363c8e 100644
> --- a/app/test/test_graph.c
> +++ b/app/test/test_graph.c
> @@ -702,6 +702,7 @@ test_graph_model_mcore_dispatch_node_lcore_affinity_set(void)
>         unsigned int worker_lcore = RTE_MAX_LCORE;
>         rte_node_t nid = RTE_NODE_ID_INVALID;
>         char node_name[64] = "test_node00";
> +       struct rte_graph_param graph_conf;

Initialize with zero or defaults, aka add =  { 0 }

^ permalink raw reply	[flat|nested] 13+ messages in thread

* RE: [PATCH v3] graph: fix graph model check in core binding
  2023-07-07 10:16     ` Jerin Jacob
@ 2023-07-10  5:08       ` Yan, Zhirun
  0 siblings, 0 replies; 13+ messages in thread
From: Yan, Zhirun @ 2023-07-10  5:08 UTC (permalink / raw)
  To: Jerin Jacob; +Cc: dev, jerinj, kirankumark, ndabilpuram, Fu, Qi



> -----Original Message-----
> From: Jerin Jacob <jerinjacobk@gmail.com>
> Sent: Friday, July 7, 2023 6:17 PM
> To: Yan, Zhirun <zhirun.yan@intel.com>
> Cc: dev@dpdk.org; jerinj@marvell.com; kirankumark@marvell.com;
> ndabilpuram@marvell.com; Fu, Qi <qi.fu@intel.com>
> Subject: Re: [PATCH v3] graph: fix graph model check in core binding
> 
> On Wed, Jul 5, 2023 at 7:38 AM Zhirun Yan <zhirun.yan@intel.com> wrote:
> >
> > Fix graph model check in core binding with graph. And
> > rte_graph_clone()
> 
> Two fixes, Lets have two patches. Also tell what is fixed and how it is fixed.
Ok, will do in next version.

> 
> 
> > need to use valid params rather than NULL pointer. Update release
> > notes for new mcore dispatch model.
> >
> > Fixes: ecb22a294980 ("graph: introduce graph bind unbind API")
> > Fixes: 67e2303cd823 ("test/graph: add functional tests for mcore
> > dispatch model")
> >
> > Signed-off-by: Zhirun Yan <zhirun.yan@intel.com>
> > ---
> >  app/test/test_graph.c                  | 15 ++++++++++++---
> >  doc/guides/rel_notes/release_23_07.rst | 11 +++++++++++
> >  lib/graph/graph.c                      |  2 +-
> >  3 files changed, 24 insertions(+), 4 deletions(-)
> >
> > diff --git a/app/test/test_graph.c b/app/test/test_graph.c index
> > 8609c0b3a4..8983363c8e 100644
> > --- a/app/test/test_graph.c
> > +++ b/app/test/test_graph.c
> > @@ -702,6 +702,7 @@
> test_graph_model_mcore_dispatch_node_lcore_affinity_set(void)
> >         unsigned int worker_lcore = RTE_MAX_LCORE;
> >         rte_node_t nid = RTE_NODE_ID_INVALID;
> >         char node_name[64] = "test_node00";
> > +       struct rte_graph_param graph_conf;
> 
> Initialize with zero or defaults, aka add =  { 0 }
Got it, thanks.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* [PATCH v4 0/2] fix graph issues
  2023-07-05  1:56   ` [PATCH v3] " Zhirun Yan
  2023-07-07 10:16     ` Jerin Jacob
@ 2023-07-10  7:15     ` Zhirun Yan
  2023-07-10  7:15       ` [PATCH v4 1/2] graph: fix graph functional tests with valid params Zhirun Yan
                         ` (2 more replies)
  1 sibling, 3 replies; 13+ messages in thread
From: Zhirun Yan @ 2023-07-10  7:15 UTC (permalink / raw)
  To: dev, jerinj, kirankumark, ndabilpuram; +Cc: qi.fu, Zhirun Yan

Fix graph clone issue in functional test.
Correct graph model check in graph core binding.
Update release note for mcore dispatch model.


Zhirun Yan (2):
  graph: fix graph functional tests with valid params
  graph: fix graph model check in core binding

 app/test/test_graph.c                  | 17 +++++++++++++----
 doc/guides/rel_notes/release_23_07.rst | 10 ++++++++++
 lib/graph/graph.c                      |  2 +-
 3 files changed, 24 insertions(+), 5 deletions(-)

-- 
2.37.2


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [PATCH v4 1/2] graph: fix graph functional tests with valid params
  2023-07-10  7:15     ` [PATCH v4 0/2] fix graph issues Zhirun Yan
@ 2023-07-10  7:15       ` Zhirun Yan
  2023-07-10  9:21         ` Jerin Jacob
  2023-07-10  7:15       ` [PATCH v4 2/2] graph: fix graph model check in core binding Zhirun Yan
  2023-07-12 14:01       ` [PATCH v4 0/2] fix graph issues Thomas Monjalon
  2 siblings, 1 reply; 13+ messages in thread
From: Zhirun Yan @ 2023-07-10  7:15 UTC (permalink / raw)
  To: dev, jerinj, kirankumark, ndabilpuram; +Cc: qi.fu, Zhirun Yan

rte_graph_clone() should use valid param rather than NULL pointer, cause it
needs the param for alloc work queue memory for mcore dispatch model in
graph_sched_wq_create().

Fixes: 67e2303cd823 ("test/graph: add functional tests for mcore dispatch model")

Signed-off-by: Zhirun Yan <zhirun.yan@intel.com>
---
 app/test/test_graph.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/app/test/test_graph.c b/app/test/test_graph.c
index 8609c0b3a4..47f5ab8395 100644
--- a/app/test/test_graph.c
+++ b/app/test/test_graph.c
@@ -665,7 +665,7 @@ test_graph_clone(void)
 {
 	rte_graph_t cloned_graph_id = RTE_GRAPH_ID_INVALID;
 	rte_graph_t main_graph_id = RTE_GRAPH_ID_INVALID;
-	struct rte_graph_param graph_conf;
+	struct rte_graph_param graph_conf = {0};
 	int ret = 0;
 
 	main_graph_id = rte_graph_from_name("worker0");
@@ -700,6 +700,7 @@ test_graph_model_mcore_dispatch_node_lcore_affinity_set(void)
 {
 	rte_graph_t cloned_graph_id = RTE_GRAPH_ID_INVALID;
 	unsigned int worker_lcore = RTE_MAX_LCORE;
+	struct rte_graph_param graph_conf = {0};
 	rte_node_t nid = RTE_NODE_ID_INVALID;
 	char node_name[64] = "test_node00";
 	struct rte_node *node;
@@ -711,7 +712,7 @@ test_graph_model_mcore_dispatch_node_lcore_affinity_set(void)
 		printf("Set node %s affinity to lcore %u\n", node_name, worker_lcore);
 
 	nid = rte_node_from_name(node_name);
-	cloned_graph_id = rte_graph_clone(graph_id, "cloned-test1", NULL);
+	cloned_graph_id = rte_graph_clone(graph_id, "cloned-test1", &graph_conf);
 	node = rte_graph_node_get(cloned_graph_id, nid);
 
 	if (node->dispatch.lcore_id != worker_lcore) {
@@ -729,11 +730,12 @@ test_graph_model_mcore_dispatch_core_bind_unbind(void)
 {
 	rte_graph_t cloned_graph_id = RTE_GRAPH_ID_INVALID;
 	unsigned int worker_lcore = RTE_MAX_LCORE;
+	struct rte_graph_param graph_conf = {0};
 	struct rte_graph *graph;
 	int ret = 0;
 
 	worker_lcore = rte_get_next_lcore(worker_lcore, true, 1);
-	cloned_graph_id = rte_graph_clone(graph_id, "cloned-test2", NULL);
+	cloned_graph_id = rte_graph_clone(graph_id, "cloned-test2", &graph_conf);
 
 	ret = rte_graph_model_mcore_dispatch_core_bind(cloned_graph_id, worker_lcore);
 	if (ret != 0) {
@@ -765,10 +767,11 @@ static int
 test_graph_worker_model_set_get(void)
 {
 	rte_graph_t cloned_graph_id = RTE_GRAPH_ID_INVALID;
+	struct rte_graph_param graph_conf = {0};
 	struct rte_graph *graph;
 	int ret = 0;
 
-	cloned_graph_id = rte_graph_clone(graph_id, "cloned-test3", NULL);
+	cloned_graph_id = rte_graph_clone(graph_id, "cloned-test3", &graph_conf);
 	ret = rte_graph_worker_model_set(RTE_GRAPH_MODEL_MCORE_DISPATCH);
 	if (ret != 0) {
 		printf("Set graph mcore dispatch model failed\n");
-- 
2.37.2


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [PATCH v4 2/2] graph: fix graph model check in core binding
  2023-07-10  7:15     ` [PATCH v4 0/2] fix graph issues Zhirun Yan
  2023-07-10  7:15       ` [PATCH v4 1/2] graph: fix graph functional tests with valid params Zhirun Yan
@ 2023-07-10  7:15       ` Zhirun Yan
  2023-07-10  9:29         ` Jerin Jacob
  2023-07-12 14:01       ` [PATCH v4 0/2] fix graph issues Thomas Monjalon
  2 siblings, 1 reply; 13+ messages in thread
From: Zhirun Yan @ 2023-07-10  7:15 UTC (permalink / raw)
  To: dev, jerinj, kirankumark, ndabilpuram; +Cc: qi.fu, Zhirun Yan

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(-)

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;
-- 
2.37.2


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH v4 1/2] graph: fix graph functional tests with valid params
  2023-07-10  7:15       ` [PATCH v4 1/2] graph: fix graph functional tests with valid params Zhirun Yan
@ 2023-07-10  9:21         ` Jerin Jacob
  0 siblings, 0 replies; 13+ messages in thread
From: Jerin Jacob @ 2023-07-10  9:21 UTC (permalink / raw)
  To: Zhirun Yan; +Cc: dev, jerinj, kirankumark, ndabilpuram, qi.fu

On Mon, Jul 10, 2023 at 1:09 PM Zhirun Yan <zhirun.yan@intel.com> wrote:
>
> rte_graph_clone() should use valid param rather than NULL pointer, cause it

rte_graph_clone() should use a valid param rather than NULL pointer as

> needs the param for alloc work queue memory for mcore dispatch model in
> graph_sched_wq_create().
>
> Fixes: 67e2303cd823 ("test/graph: add functional tests for mcore dispatch model")
>
> Signed-off-by: Zhirun Yan <zhirun.yan@intel.com>

With above change:

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

> ---
>  app/test/test_graph.c | 11 +++++++----
>  1 file changed, 7 insertions(+), 4 deletions(-)
>
> diff --git a/app/test/test_graph.c b/app/test/test_graph.c
> index 8609c0b3a4..47f5ab8395 100644
> --- a/app/test/test_graph.c
> +++ b/app/test/test_graph.c
> @@ -665,7 +665,7 @@ test_graph_clone(void)
>  {
>         rte_graph_t cloned_graph_id = RTE_GRAPH_ID_INVALID;
>         rte_graph_t main_graph_id = RTE_GRAPH_ID_INVALID;
> -       struct rte_graph_param graph_conf;
> +       struct rte_graph_param graph_conf = {0};
>         int ret = 0;
>
>         main_graph_id = rte_graph_from_name("worker0");
> @@ -700,6 +700,7 @@ test_graph_model_mcore_dispatch_node_lcore_affinity_set(void)
>  {
>         rte_graph_t cloned_graph_id = RTE_GRAPH_ID_INVALID;
>         unsigned int worker_lcore = RTE_MAX_LCORE;
> +       struct rte_graph_param graph_conf = {0};
>         rte_node_t nid = RTE_NODE_ID_INVALID;
>         char node_name[64] = "test_node00";
>         struct rte_node *node;
> @@ -711,7 +712,7 @@ test_graph_model_mcore_dispatch_node_lcore_affinity_set(void)
>                 printf("Set node %s affinity to lcore %u\n", node_name, worker_lcore);
>
>         nid = rte_node_from_name(node_name);
> -       cloned_graph_id = rte_graph_clone(graph_id, "cloned-test1", NULL);
> +       cloned_graph_id = rte_graph_clone(graph_id, "cloned-test1", &graph_conf);
>         node = rte_graph_node_get(cloned_graph_id, nid);
>
>         if (node->dispatch.lcore_id != worker_lcore) {
> @@ -729,11 +730,12 @@ test_graph_model_mcore_dispatch_core_bind_unbind(void)
>  {
>         rte_graph_t cloned_graph_id = RTE_GRAPH_ID_INVALID;
>         unsigned int worker_lcore = RTE_MAX_LCORE;
> +       struct rte_graph_param graph_conf = {0};
>         struct rte_graph *graph;
>         int ret = 0;
>
>         worker_lcore = rte_get_next_lcore(worker_lcore, true, 1);
> -       cloned_graph_id = rte_graph_clone(graph_id, "cloned-test2", NULL);
> +       cloned_graph_id = rte_graph_clone(graph_id, "cloned-test2", &graph_conf);
>
>         ret = rte_graph_model_mcore_dispatch_core_bind(cloned_graph_id, worker_lcore);
>         if (ret != 0) {
> @@ -765,10 +767,11 @@ static int
>  test_graph_worker_model_set_get(void)
>  {
>         rte_graph_t cloned_graph_id = RTE_GRAPH_ID_INVALID;
> +       struct rte_graph_param graph_conf = {0};
>         struct rte_graph *graph;
>         int ret = 0;
>
> -       cloned_graph_id = rte_graph_clone(graph_id, "cloned-test3", NULL);
> +       cloned_graph_id = rte_graph_clone(graph_id, "cloned-test3", &graph_conf);
>         ret = rte_graph_worker_model_set(RTE_GRAPH_MODEL_MCORE_DISPATCH);
>         if (ret != 0) {
>                 printf("Set graph mcore dispatch model failed\n");
> --
> 2.37.2
>

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH v4 2/2] graph: fix graph model check in core binding
  2023-07-10  7:15       ` [PATCH v4 2/2] graph: fix graph model check in core binding Zhirun Yan
@ 2023-07-10  9:29         ` Jerin Jacob
  0 siblings, 0 replies; 13+ messages in thread
From: Jerin Jacob @ 2023-07-10  9:29 UTC (permalink / raw)
  To: Zhirun Yan; +Cc: dev, jerinj, kirankumark, ndabilpuram, qi.fu

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>

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH v4 0/2] fix graph issues
  2023-07-10  7:15     ` [PATCH v4 0/2] fix graph issues Zhirun Yan
  2023-07-10  7:15       ` [PATCH v4 1/2] graph: fix graph functional tests with valid params Zhirun Yan
  2023-07-10  7:15       ` [PATCH v4 2/2] graph: fix graph model check in core binding Zhirun Yan
@ 2023-07-12 14:01       ` Thomas Monjalon
  2 siblings, 0 replies; 13+ messages in thread
From: Thomas Monjalon @ 2023-07-12 14:01 UTC (permalink / raw)
  To: jerinj, kirankumark, ndabilpuram, Zhirun Yan; +Cc: dev, qi.fu

10/07/2023 09:15, Zhirun Yan:
> Fix graph clone issue in functional test.
> Correct graph model check in graph core binding.
> Update release note for mcore dispatch model.
> 
> 
> Zhirun Yan (2):
>   graph: fix graph functional tests with valid params
>   graph: fix graph model check in core binding

Applied with Jerin suggestions and few more minor fixes.



^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2023-07-12 14:01 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-03  7:29 [PATCH v1] graph: fix graph model check in core binding Zhirun Yan
2023-07-03  9:55 ` [PATCH v2] " Zhirun Yan
2023-07-04  9:10   ` Jerin Jacob
2023-07-05  0:50     ` Yan, Zhirun
2023-07-05  1:56   ` [PATCH v3] " Zhirun Yan
2023-07-07 10:16     ` Jerin Jacob
2023-07-10  5:08       ` Yan, Zhirun
2023-07-10  7:15     ` [PATCH v4 0/2] fix graph issues Zhirun Yan
2023-07-10  7:15       ` [PATCH v4 1/2] graph: fix graph functional tests with valid params Zhirun Yan
2023-07-10  9:21         ` Jerin Jacob
2023-07-10  7:15       ` [PATCH v4 2/2] graph: fix graph model check in core binding Zhirun Yan
2023-07-10  9:29         ` Jerin Jacob
2023-07-12 14:01       ` [PATCH v4 0/2] fix graph issues Thomas Monjalon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).