From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 9487442C40; Tue, 6 Jun 2023 16:55:56 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5630542D74; Tue, 6 Jun 2023 16:55:27 +0200 (CEST) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by mails.dpdk.org (Postfix) with ESMTP id B0B7C42D1D for ; Tue, 6 Jun 2023 16:55:25 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1686063325; x=1717599325; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=JXh/wlQFw8fp6N8uGAnSg/s9CS3hV2TY2lIg7fI74Is=; b=QpwcHE4XmUHfEPrWxvoZiGs5BMok3skO4CQU4I9W6ST781koQit7uPSj Ws3jDSxuGXwVCcYAv8HWF7vexLvoVGSp7pq+/lDFLdEsaxVN8/PR3gW6f MMJq0YpQ0i35bfFf3vlpBQKwDkt6oxdP5rxTp2D7X8182hhNHYd3meAhh bYrNaWtrT0mcLl85KN1t7Bt3a0kS7D3i5tH7uw2ciCPaCOmdYd04vqfTp f1UTIbKk4io7vHnLzn1jGCbvuqYYKLAbnHCte9PFIku1Ou78g8rhkjrrC j8PjJrIEWsuEISRv3+2dpy5lQA9jgIzghR+W1PNMitqSkvTdtqTKfaUf1 A==; X-IronPort-AV: E=McAfee;i="6600,9927,10733"; a="356705445" X-IronPort-AV: E=Sophos;i="6.00,221,1681196400"; d="scan'208";a="356705445" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Jun 2023 07:55:16 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10733"; a="1039222809" X-IronPort-AV: E=Sophos;i="6.00,221,1681196400"; d="scan'208";a="1039222809" Received: from dpdk-zhirun-lmm.sh.intel.com ([10.67.119.94]) by fmsmga005.fm.intel.com with ESMTP; 06 Jun 2023 07:55:13 -0700 From: Zhirun Yan To: dev@dpdk.org, jerinj@marvell.com, kirankumark@marvell.com, ndabilpuram@marvell.com, stephen@networkplumber.org, pbhagavatula@marvell.com, jerinjacobk@gmail.com Cc: cunming.liang@intel.com, haiyue.wang@intel.com, mattias.ronnblom@ericsson.com, Zhirun Yan Subject: [PATCH v8 11/17] graph: enable create and destroy graph scheduling workqueue Date: Tue, 6 Jun 2023 22:47:40 +0800 Message-Id: <20230606144746.708388-12-zhirun.yan@intel.com> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20230606144746.708388-1-zhirun.yan@intel.com> References: <20230605111923.3772260-1-zhirun.yan@intel.com> <20230606144746.708388-1-zhirun.yan@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org This patch enables to create and destroy scheduling workqueue into common graph operations. Signed-off-by: Haiyue Wang Signed-off-by: Cunming Liang Signed-off-by: Zhirun Yan --- lib/graph/graph.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lib/graph/graph.c b/lib/graph/graph.c index 8307ff079c..18318b5745 100644 --- a/lib/graph/graph.c +++ b/lib/graph/graph.c @@ -449,6 +449,11 @@ 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(graph->graph) == + 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 */ @@ -522,6 +527,11 @@ graph_clone(struct graph *parent_graph, const char *name, struct rte_graph_param /* Clone the graph model */ graph->graph->model = parent_graph->graph->model; + /* Create the graph schedule work queue */ + if (rte_graph_worker_model_get(graph->graph) == 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