From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <dev-bounces@dpdk.org>
Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124])
	by inbox.dpdk.org (Postfix) with ESMTP id 23B814287E;
	Fri, 31 Mar 2023 06:04:27 +0200 (CEST)
Received: from mails.dpdk.org (localhost [127.0.0.1])
	by mails.dpdk.org (Postfix) with ESMTP id 91D1942D5A;
	Fri, 31 Mar 2023 06:03:39 +0200 (CEST)
Received: from mga11.intel.com (mga11.intel.com [192.55.52.93])
 by mails.dpdk.org (Postfix) with ESMTP id A2E6242D3D
 for <dev@dpdk.org>; Fri, 31 Mar 2023 06:03:36 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple;
 d=intel.com; i=@intel.com; q=dns/txt; s=Intel;
 t=1680235416; x=1711771416;
 h=from:to:cc:subject:date:message-id:in-reply-to:
 references:mime-version:content-transfer-encoding;
 bh=0LebO7SGoi0DYaksMvOP4ILIt7ts9I6sVp4INv89Ees=;
 b=HATRVL4lsFfD43L1Wx+DhdPtOdH6Q+eLEI+EgwCFRuN/kqYo0gKEmPWL
 CwGbDCejg1hD1IhBsVR85OFDu2jXHE7233ciRVsmXQfXhmVUz+UzAhlgq
 z+Y0QETzEi76067A0wywmqhDSSoIFgTsqvbvciDExTKmU1serKGt9RFIn
 QtA4iTqQOYnvwoSn0kgafGdWNiNQjIezTRcDmDErjCDGlWuK6leOOqeMp
 c0scgdSk7eJAXZog1A9DWFeDhhplym7ZURRVz2BqrhK7/Yj+TsDoTxLTz
 nWLBNOEjnge4U+FF3l53HBlQwH2cAgPuBkO4PHl+OA/xmV6eVJ73iAfEy A==;
X-IronPort-AV: E=McAfee;i="6600,9927,10665"; a="338849116"
X-IronPort-AV: E=Sophos;i="5.98,306,1673942400"; d="scan'208";a="338849116"
Received: from fmsmga007.fm.intel.com ([10.253.24.52])
 by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;
 30 Mar 2023 21:03:36 -0700
X-ExtLoop1: 1
X-IronPort-AV: E=McAfee;i="6600,9927,10665"; a="687502302"
X-IronPort-AV: E=Sophos;i="5.98,306,1673942400"; d="scan'208";a="687502302"
Received: from dpdk-zhirun-lmm.sh.intel.com ([10.67.119.68])
 by fmsmga007.fm.intel.com with ESMTP; 30 Mar 2023 21:03:34 -0700
From: Zhirun Yan <zhirun.yan@intel.com>
To: dev@dpdk.org, jerinj@marvell.com, kirankumark@marvell.com,
 ndabilpuram@marvell.com, stephen@networkplumber.org
Cc: cunming.liang@intel.com, haiyue.wang@intel.com,
 Zhirun Yan <zhirun.yan@intel.com>
Subject: [PATCH v5 10/15] graph: enable create and destroy graph scheduling
 workqueue
Date: Fri, 31 Mar 2023 13:03:01 +0900
Message-Id: <20230331040306.3143693-11-zhirun.yan@intel.com>
X-Mailer: git-send-email 2.37.2
In-Reply-To: <20230331040306.3143693-1-zhirun.yan@intel.com>
References: <20230330061834.3118201-1-zhirun.yan@intel.com>
 <20230331040306.3143693-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 <dev.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=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 <haiyue.wang@intel.com>
Signed-off-by: Cunming Liang <cunming.liang@intel.com>
Signed-off-by: Zhirun Yan <zhirun.yan@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 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