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 7533B45EB3; Mon, 16 Dec 2024 02:44:02 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0954540261; Mon, 16 Dec 2024 02:44:02 +0100 (CET) Received: from m16.mail.163.com (m16.mail.163.com [117.135.210.4]) by mails.dpdk.org (Postfix) with ESMTP id A91FE4025A for ; Mon, 16 Dec 2024 02:43:59 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-Id:MIME-Version; bh=neFWJ bVsT6Rvu54G7pwPxn/C2KKskO9ADF+nquhoOeE=; b=gHm6h3ljtnN/QFYKCr6rq rWPcxEHNX2vissgIAZK/6gYEhXey/pQuMFsyVVz7ew8rEVV0AU6ghZzozNrCtb5k vGUHtquji9beKAGJdzDcOFB9haofECXruuYIusWm/b8RS6ripl5dhhtnzeEz5BF0 iGq6XmFLZW79UZQDU0mV2g= Received: from localhost.localdomain.localdomain (unknown []) by gzga-smtp-mtada-g0-0 (Coremail) with SMTP id _____wD3_6zbhV9nTahiAw--.42043S2; Mon, 16 Dec 2024 09:43:55 +0800 (CST) From: Huichao Cai To: Cc: dev@dpdk.org, jerinj@marvell.com, kirankumark@marvell.com, ndabilpuram@marvell.com, yanzhirun_163@163.com Subject: [PATCH v6] graph: mcore: optimize graph search Date: Mon, 16 Dec 2024 09:43:53 +0800 Message-Id: <20241216014353.2036-1-chcchc88@163.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20241213022158.2644-1-chcchc88@163.com> References: <20241213022158.2644-1-chcchc88@163.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID: _____wD3_6zbhV9nTahiAw--.42043S2 X-Coremail-Antispam: 1Uf129KBjvJXoWxZF1rJFyrWr4UJF1UXr17trb_yoW5CF45p3 WrKFWrGrZ8tF1rKrn2gF48XFW8J3Wqq3y2gryxW3WfJrs8Jr1xury8AFy3KF47XrW3Ca17 uw4jqryUGr1DWa7anT9S1TB71UUUUU7qnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x07UE38OUUUUU= X-Originating-IP: [1.202.233.203] X-CM-SenderInfo: pfkfuxrfyyqiywtou0bp/1tbiUh23F2dfgaGNsgAAsI 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 In the function __rte_graph_mcore_dispatch_sched_node_enqueue, use a slower loop to search for the graph, modify the search logic to record the result of the first search, and use this record for subsequent searches to improve search speed. Signed-off-by: Huichao Cai --- devtools/libabigail.abignore | 5 +++++ doc/guides/rel_notes/release_25_03.rst | 2 ++ lib/graph/rte_graph_model_mcore_dispatch.c | 11 +++++++---- lib/graph/rte_graph_worker_common.h | 1 + 4 files changed, 15 insertions(+), 4 deletions(-) diff --git a/devtools/libabigail.abignore b/devtools/libabigail.abignore index 21b8cd6113..a92ee29512 100644 --- a/devtools/libabigail.abignore +++ b/devtools/libabigail.abignore @@ -33,3 +33,8 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; Temporary exceptions till next major ABI version ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +[suppress_type] + name = rte_node + has_size_change = no + has_data_member_inserted_between = +{offset_of(total_sched_fail), offset_of(xstat_off)} diff --git a/doc/guides/rel_notes/release_25_03.rst b/doc/guides/rel_notes/release_25_03.rst index 426dfcd982..55ffe8170d 100644 --- a/doc/guides/rel_notes/release_25_03.rst +++ b/doc/guides/rel_notes/release_25_03.rst @@ -102,6 +102,8 @@ ABI Changes * No ABI change that would break compatibility with 24.11. +* graph: Added ``graph`` field to the ``dispatch`` structure in the ``rte_node`` structure. + Known Issues ------------ diff --git a/lib/graph/rte_graph_model_mcore_dispatch.c b/lib/graph/rte_graph_model_mcore_dispatch.c index a590fc9497..a81d338227 100644 --- a/lib/graph/rte_graph_model_mcore_dispatch.c +++ b/lib/graph/rte_graph_model_mcore_dispatch.c @@ -118,11 +118,14 @@ __rte_graph_mcore_dispatch_sched_node_enqueue(struct rte_node *node, struct rte_graph_rq_head *rq) { const unsigned int lcore_id = node->dispatch.lcore_id; - struct rte_graph *graph; + struct rte_graph *graph = node->dispatch.graph; - SLIST_FOREACH(graph, rq, next) - if (graph->dispatch.lcore_id == lcore_id) - break; + if (unlikely((!graph) || (graph->dispatch.lcore_id != lcore_id))) { + SLIST_FOREACH(graph, rq, next) + if (graph->dispatch.lcore_id == lcore_id) + break; + node->dispatch.graph = graph; + } return graph != NULL ? __graph_sched_node_enqueue(node, graph) : false; } diff --git a/lib/graph/rte_graph_worker_common.h b/lib/graph/rte_graph_worker_common.h index d3ec88519d..aef0f65673 100644 --- a/lib/graph/rte_graph_worker_common.h +++ b/lib/graph/rte_graph_worker_common.h @@ -110,6 +110,7 @@ struct __rte_cache_aligned rte_node { unsigned int lcore_id; /**< Node running lcore. */ uint64_t total_sched_objs; /**< Number of objects scheduled. */ uint64_t total_sched_fail; /**< Number of scheduled failure. */ + struct rte_graph *graph; /**< Graph corresponding to lcore_id. */ } dispatch; }; -- 2.27.0