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 4C2C142AA0; Tue, 9 May 2023 08:05:18 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 56E6D42D5E; Tue, 9 May 2023 08:04:25 +0200 (CEST) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by mails.dpdk.org (Postfix) with ESMTP id 3CF2C42D5E for ; Tue, 9 May 2023 08:04:24 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1683612264; x=1715148264; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=81w4XGJx1ICflzEKI67i9TkocVnyC7+5QIl5WqA5g9A=; b=Rib+Y8ltiV1wZ1hEhVumM078AhzvUGQek3DjIZgOCBaYDDQEfFDjsZSH Gfl8GAHe+JdrqXzHikoMGtJnmZ2438OZd/gAV4MTPToC9L0aB8KyhDrOI LDdKBZAv2TFYdV6oWjI/VeP+5sbdIrdCQcy8golRKa3FFO3/ZRj+CRkmk sbhH3Z+7kdOGVf7gWx5X7JBKNphFOi5dTvJRsqi5gBaOVOIh44atKFxnM LKvgbQj5s5BY/TLgX+PJmbKvFG5YjnkuPyA8gzvrwxLvLQ3mJuxgmsDpD aJ/cryRAtNoUB7yEm/ej5crngTqfFs7id1Vfcog53xdzyCV5K9rMj9W+7 Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10704"; a="351983136" X-IronPort-AV: E=Sophos;i="5.99,261,1677571200"; d="scan'208";a="351983136" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 May 2023 23:04:23 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10704"; a="701700386" X-IronPort-AV: E=Sophos;i="5.99,261,1677571200"; d="scan'208";a="701700386" Received: from dpdk-zhirun-lmm.sh.intel.com ([10.67.119.94]) by fmsmga007.fm.intel.com with ESMTP; 08 May 2023 23:04:21 -0700 From: Zhirun Yan To: dev@dpdk.org, jerinj@marvell.com, kirankumark@marvell.com, ndabilpuram@marvell.com, stephen@networkplumber.org, pbhagavatula@marvell.com Cc: cunming.liang@intel.com, haiyue.wang@intel.com, Zhirun Yan Subject: [PATCH v6 10/15] graph: enable create and destroy graph scheduling workqueue Date: Tue, 9 May 2023 15:03:42 +0900 Message-Id: <20230509060347.1237884-11-zhirun.yan@intel.com> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20230509060347.1237884-1-zhirun.yan@intel.com> References: <20230331040306.3143693-1-zhirun.yan@intel.com> <20230509060347.1237884-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 f555844d8f..8b42d43193 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 */ @@ -543,6 +547,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