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 6AE69A00C2; Thu, 17 Nov 2022 06:10:35 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D647342D50; Thu, 17 Nov 2022 06:10:05 +0100 (CET) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by mails.dpdk.org (Postfix) with ESMTP id 0423C42D48 for ; Thu, 17 Nov 2022 06:10:03 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1668661804; x=1700197804; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=E8fduuVY9G4uCJTlg2rIy8Yn1O0fV1q/34jdaxB/DWo=; b=EvrGCK85DDi1QAeowqipWW+wfZhZE9a4118kRotpiBpSFW7+aX0sxcZf 9LPrX1Injr0q06CmjGg3JQ1BfVwn4QcTuSeziMerw3vRJFghRylBBQxOF tvN6aTg7OgVnZiJx7X4ksCmmxaBlCxxGTtECNwYkZtL+GC/ddMXegmU7L tyJ3ZnI9p2QihbcH4+cg3ng33RnKupxQszKCDa0Qg2J+6lYOAM/fTqWfr blMg4jEIRMOF/BY5XrrFsAmdK1B9qCogouEF/HaeBBViHdgTCQFeBdDjN TPGA1YX496ptKs+4nZ+7m4TFFkB+x29SQ+TvaAhDO6fEGopIw4bGFGfHK A==; X-IronPort-AV: E=McAfee;i="6500,9779,10533"; a="377026701" X-IronPort-AV: E=Sophos;i="5.96,169,1665471600"; d="scan'208";a="377026701" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Nov 2022 21:10:03 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10533"; a="617466156" X-IronPort-AV: E=Sophos;i="5.96,169,1665471600"; d="scan'208";a="617466156" Received: from dpdk-zhirun-lmm.sh.intel.com ([10.67.118.230]) by orsmga006.jf.intel.com with ESMTP; 16 Nov 2022 21:10:01 -0800 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 v1 09/13] graph: enable create and destroy graph scheduling workqueue Date: Thu, 17 Nov 2022 13:09:22 +0800 Message-Id: <20221117050926.136974-10-zhirun.yan@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221117050926.136974-1-zhirun.yan@intel.com> References: <20221117050926.136974-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 8ea0daaa35..63d9bcffd2 100644 --- a/lib/graph/graph.c +++ b/lib/graph/graph.c @@ -428,6 +428,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_GENERIC) + 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 +526,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_GENERIC && + 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.25.1