[v2] graph: fix graph model check in core binding
Checks
Commit Message
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(-)
Comments
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.
> +
> -----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.
> > +
@@ -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");
@@ -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
-------------
@@ -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;