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 59F4042BCF; Mon, 5 Jun 2023 13:27:32 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B645A42D88; Mon, 5 Jun 2023 13:26:52 +0200 (CEST) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by mails.dpdk.org (Postfix) with ESMTP id 459DC42D6D for ; Mon, 5 Jun 2023 13:26:51 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1685964411; x=1717500411; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=wXdrsmXesegWBY2GCCD8NAmWEFgUIfAeAO/kQvI6oCc=; b=Kvz7csam7Bw8fm7ohpt4jupTHgOJ7SV0K9dobKwp3TUxwgDdf2QeQAny g9ZtEKupFo/ArKtJGPyqKvuTyuZJD/fFqfclw30oL8+ayEVBFK5ru/IhX XKQeT9ViI4c5zwaXFy3xzBduvDE+QA3JbY8DyG2pEQzwuSv0lxD5aSNhx 7VxCEH5Q8lg4ETUHFA+3xt08P/RhkOW13IgKXgCuZ9jtgMOb/LDHwEe5x 0SRg40LRlq9ZDrHvWV3JPdeRloCe0MndSIs5PNMzwjE0EE25tDIaTClfQ YB0/PlO4tGYUtg4woAgfHVUm2+SY8r9M7y9HTA+2B+TziOVkY1cfYg8Re g==; X-IronPort-AV: E=McAfee;i="6600,9927,10731"; a="422168598" X-IronPort-AV: E=Sophos;i="6.00,217,1681196400"; d="scan'208";a="422168598" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Jun 2023 04:26:50 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10731"; a="832778944" X-IronPort-AV: E=Sophos;i="6.00,217,1681196400"; d="scan'208";a="832778944" Received: from dpdk-zhirun-lmm.sh.intel.com ([10.67.119.94]) by orsmga004.jf.intel.com with ESMTP; 05 Jun 2023 04:26:48 -0700 From: Zhirun Yan To: dev@dpdk.org, jerinj@marvell.com, kirankumark@marvell.com, ndabilpuram@marvell.com, stephen@networkplumber.org, pbhagavatula@marvell.com, jerinjacobk@gmail.com Cc: cunming.liang@intel.com, haiyue.wang@intel.com, mattias.ronnblom@ericsson.com, Zhirun Yan Subject: [PATCH v7 11/17] graph: enable create and destroy graph scheduling workqueue Date: Mon, 5 Jun 2023 20:19:17 +0900 Message-Id: <20230605111923.3772260-12-zhirun.yan@intel.com> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20230605111923.3772260-1-zhirun.yan@intel.com> References: <20230509060347.1237884-1-zhirun.yan@intel.com> <20230605111923.3772260-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 2eb2455f77..e32455f76f 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 */ @@ -519,6 +523,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