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 333184285E; Wed, 29 Mar 2023 08:45:03 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C363642D3E; Wed, 29 Mar 2023 08:44:13 +0200 (CEST) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by mails.dpdk.org (Postfix) with ESMTP id 0DD0F42D3C for ; Wed, 29 Mar 2023 08:44:10 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1680072251; x=1711608251; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=0LebO7SGoi0DYaksMvOP4ILIt7ts9I6sVp4INv89Ees=; b=Xgf8y3Y/omZ4POM05q7LtxvfX/TIFU2wdTMn0fEUfcLLoenkWP33O2uL FPkRZk2DDXQ8a1K+bDnw7fOhVaTyc7UZX7pN5QeA7ZbrN+t2/VeFGSf6d pmAZIwos2Kvc97umqXQNvm4fMOz9HT5/KTL8xibIqVz4+m9YaeIO0Dqio YBPCIwIys6AkOHf/q31ZP2X+5X70nZcXIpyojQVVU7cSvXGGaQmHJy0sq yaYEGqMVS6BdCvB/my9GTIOL9wr+vtRhczrXpCctQUnyRtnZdC089UnEL whusnMFIUGdhAAFQMDGNf4OYe5r92ros8TrFe6onLWe3cXTwQvIcE9DED g==; X-IronPort-AV: E=McAfee;i="6600,9927,10663"; a="329260488" X-IronPort-AV: E=Sophos;i="5.98,300,1673942400"; d="scan'208";a="329260488" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Mar 2023 23:44:10 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10663"; a="795105025" X-IronPort-AV: E=Sophos;i="5.98,300,1673942400"; d="scan'208";a="795105025" Received: from dpdk-zhirun-lmm.sh.intel.com ([10.67.119.68]) by fmsmga002.fm.intel.com with ESMTP; 28 Mar 2023 23:44:08 -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 v3 10/15] graph: enable create and destroy graph scheduling workqueue Date: Wed, 29 Mar 2023 15:43:35 +0900 Message-Id: <20230329064340.2550530-11-zhirun.yan@intel.com> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20230329064340.2550530-1-zhirun.yan@intel.com> References: <20230324021622.1369006-1-zhirun.yan@intel.com> <20230329064340.2550530-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