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 6919A42CA8; Tue, 13 Jun 2023 12:25:25 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id DB18D42D3C; Tue, 13 Jun 2023 12:25:22 +0200 (CEST) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by mails.dpdk.org (Postfix) with ESMTP id ECAE642D3C for ; Tue, 13 Jun 2023 12:25:21 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1686651922; x=1718187922; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=zKZLeIHr9FeSeOY0Lc9P3dlFxlXVbvZx6tLL2HmUpgQ=; b=ff9bOmLLhhpfY1HpXehu29zcVm0cPZ06fYeTfiKxJoA97fm+2C0rK/Dm dHQdgu//duZFqioEnvoblbpVgFJJ3s6FynrahsvjVMXO2NDz8E+6L+En8 nt6gml4xcJn0zXM9iIKP5BovUeX95nDp1uY+FBJeAJH6W9AXZrRn3K5e/ 9sXG8xVREc3gT7kaapYGZrCOMvOvkNJYn3degR/uUVb8mmVXoRSGO/ysX hTaM2GIT/PbKL1pYg/aMTp9ZO2kk6oTj4zxHp56udv8EwZrcd9MZrBI1D erjCZrXYWfB44lvZ3D7ADjiAmGtu2cjUU86oFNRlBdyKX1HRNDZ7/3b+P w==; X-IronPort-AV: E=McAfee;i="6600,9927,10739"; a="358289849" X-IronPort-AV: E=Sophos;i="6.00,239,1681196400"; d="scan'208";a="358289849" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Jun 2023 03:21:49 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10739"; a="741375592" X-IronPort-AV: E=Sophos;i="6.00,239,1681196400"; d="scan'208";a="741375592" Received: from dpdk-zhirun-lmm.sh.intel.com ([10.67.119.94]) by orsmga008.jf.intel.com with ESMTP; 13 Jun 2023 03:21:45 -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, david.marchand@redhat.com Cc: cunming.liang@intel.com, haiyue.wang@intel.com, mattias.ronnblom@ericsson.com, Zhirun Yan Subject: [PATCH v13 11/16] graph: enable create and destroy graph scheduling workqueue Date: Tue, 13 Jun 2023 18:13:59 +0800 Message-Id: <20230613101404.1787790-12-zhirun.yan@intel.com> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20230613101404.1787790-1-zhirun.yan@intel.com> References: <20230609191245.252521-1-zhirun.yan@intel.com> <20230613101404.1787790-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 Acked-by: Pavan Nikhilesh --- lib/graph/graph.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lib/graph/graph.c b/lib/graph/graph.c index 41251e3435..0c28d925bc 100644 --- a/lib/graph/graph.c +++ b/lib/graph/graph.c @@ -451,6 +451,11 @@ 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(graph->graph) == + 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 */ @@ -524,6 +529,11 @@ graph_clone(struct graph *parent_graph, const char *name, struct rte_graph_param /* Clone the graph model */ graph->graph->model = parent_graph->graph->model; + /* Create the graph schedule work queue */ + if (rte_graph_worker_model_get(graph->graph) == 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