[PATCH v7 11/17] graph: enable create and destroy graph scheduling workqueue
Zhirun Yan
zhirun.yan at intel.com
Mon Jun 5 13:19:17 CEST 2023
This patch enables to create and destroy scheduling workqueue into
common graph operations.
Signed-off-by: Haiyue Wang <haiyue.wang at intel.com>
Signed-off-by: Cunming Liang <cunming.liang at intel.com>
Signed-off-by: Zhirun Yan <zhirun.yan at intel.com>
---
lib/graph/graph.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/lib/graph/graph.c b/lib/graph/graph.c
index 2eb2455f77..e32455f76f 100644
--- a/lib/graph/graph.c
+++ b/lib/graph/graph.c
@@ -449,6 +449,10 @@ rte_graph_destroy(rte_graph_t id)
while (graph != NULL) {
tmp = STAILQ_NEXT(graph, next);
if (graph->id == id) {
+ /* Destroy the schedule work queue if has */
+ if (rte_graph_worker_model_get() == RTE_GRAPH_MODEL_MCORE_DISPATCH)
+ graph_sched_wq_destroy(graph);
+
/* Call fini() of the all the nodes in the graph */
graph_node_fini(graph);
/* Destroy graph fast path memory */
@@ -519,6 +523,11 @@ graph_clone(struct graph *parent_graph, const char *name, struct rte_graph_param
if (graph_fp_mem_create(graph))
goto graph_cleanup;
+ /* Create the graph schedule work queue */
+ if (rte_graph_worker_model_get() == RTE_GRAPH_MODEL_MCORE_DISPATCH &&
+ graph_sched_wq_create(graph, parent_graph, prm))
+ goto graph_mem_destroy;
+
/* Call init() of the all the nodes in the graph */
if (graph_node_init(graph))
goto graph_mem_destroy;
--
2.37.2
More information about the dev
mailing list