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 ECB704286D; Thu, 30 Mar 2023 08:19:48 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id AF87142D3A; Thu, 30 Mar 2023 08:19:04 +0200 (CEST) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by mails.dpdk.org (Postfix) with ESMTP id 8117C42D41 for ; Thu, 30 Mar 2023 08:19:01 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1680157141; x=1711693141; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=0LebO7SGoi0DYaksMvOP4ILIt7ts9I6sVp4INv89Ees=; b=W3zU8oKvGjCLYTIiE3McCSHtqj2S98CTmuqSxDVdO/mM8BdwKCbSnk9A dwDdPeF9S+a2pE+l11CAB5W38uLP7Fxs0F+Vmqv7/xguIF/gEcLmlI+4G lKEEZx0kPzAJX4pI0Xl6PLAQ+dwhf8AWXodB4igls0TUnK1Xh+45gGhPT tX2QhDOgFIB6e7dwJOtdudMV71ve7Hc4dTx+2eGkTG3twsda8LcFsB+Jw X8dEUlYAx3Ht2VEzUj7tBMJmv3OTOtkC24HnJ9KpxegGBONtnEd1QWfbq TUcDifW0eRIXyO+alPvTN0KkcL5/EvIMAAy/6UZB54uL6Goiqo6Epp90J g==; X-IronPort-AV: E=McAfee;i="6600,9927,10664"; a="343530621" X-IronPort-AV: E=Sophos;i="5.98,303,1673942400"; d="scan'208";a="343530621" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Mar 2023 23:19:01 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10664"; a="828176225" X-IronPort-AV: E=Sophos;i="5.98,303,1673942400"; d="scan'208";a="828176225" Received: from dpdk-zhirun-lmm.sh.intel.com ([10.67.119.68]) by fmsmga001.fm.intel.com with ESMTP; 29 Mar 2023 23:18:59 -0700 From: Zhirun Yan To: dev@dpdk.org, jerinj@marvell.com, kirankumark@marvell.com, ndabilpuram@marvell.com Cc: cunming.liang@intel.com, haiyue.wang@intel.com, Zhirun Yan Subject: [PATCH v4 10/15] graph: enable create and destroy graph scheduling workqueue Date: Thu, 30 Mar 2023 15:18:29 +0900 Message-Id: <20230330061834.3118201-11-zhirun.yan@intel.com> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20230330061834.3118201-1-zhirun.yan@intel.com> References: <20230329064340.2550530-1-zhirun.yan@intel.com> <20230330061834.3118201-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 | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lib/graph/graph.c b/lib/graph/graph.c index dd3d69dbf7..1f1ee9b622 100644 --- a/lib/graph/graph.c +++ b/lib/graph/graph.c @@ -443,6 +443,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 */ @@ -537,6 +541,11 @@ graph_clone(struct graph *parent_graph, const char *name) 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)) + 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