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 893DC42C61; Thu, 8 Jun 2023 17:27:02 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B55AF427E9; Thu, 8 Jun 2023 17:26:45 +0200 (CEST) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by mails.dpdk.org (Postfix) with ESMTP id DC350410FA for ; Thu, 8 Jun 2023 17:26:43 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1686238004; x=1717774004; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=zKZLeIHr9FeSeOY0Lc9P3dlFxlXVbvZx6tLL2HmUpgQ=; b=PMFbavlT/6iqocpxHwyfrO99GNtkDtEckylePqOUFE14Bdc7FIYrs3xV V8SGW7qLk+ZvzDJ1RsaMlR3cSlBdhHvK1OLnrWPO8f28Z9mQBbkHWzf1Y sQu5Vg0YrryamcCpmAManFLVXMAdAjEBRd2d6wPhuVsZH1CYOSzKZpP9o +oa8MWPNXQeTbyUEUkv0Av/Ik1Rhnhyd3jl8cUItUYx6zo1OSa/lB43gD GQaHGsKPHgBeVDJ22CSWrIZGoQOtANxcDEOfhrMjDD+qOpxYw39NF+JeO 3miQYnEC+LO+fw/4V0rLl3raDsJSvMIrgC0if4DwY/8paO07PijIZd+Xy A==; X-IronPort-AV: E=McAfee;i="6600,9927,10735"; a="385681522" X-IronPort-AV: E=Sophos;i="6.00,227,1681196400"; d="scan'208";a="385681522" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Jun 2023 08:26:20 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10735"; a="834233074" X-IronPort-AV: E=Sophos;i="6.00,227,1681196400"; d="scan'208";a="834233074" Received: from dpdk-zhirun-lmm.sh.intel.com ([10.67.119.94]) by orsmga004.jf.intel.com with ESMTP; 08 Jun 2023 08:26:17 -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 v11 11/16] graph: enable create and destroy graph scheduling workqueue Date: Thu, 8 Jun 2023 23:18:39 +0800 Message-Id: <20230608151844.1823783-12-zhirun.yan@intel.com> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20230608151844.1823783-1-zhirun.yan@intel.com> References: <20230608095759.1800617-1-zhirun.yan@intel.com> <20230608151844.1823783-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