From patchwork Wed Nov 1 07:20:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ruifeng Wang X-Patchwork-Id: 133711 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id D780A4325D; Wed, 1 Nov 2023 08:21:22 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5E92E4026F; Wed, 1 Nov 2023 08:21:22 +0100 (CET) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mails.dpdk.org (Postfix) with ESMTP id C6589400EF; Wed, 1 Nov 2023 08:21:20 +0100 (CET) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id E19831FB; Wed, 1 Nov 2023 00:22:01 -0700 (PDT) Received: from net-arm-n1amp-02.shanghai.arm.com (net-arm-n1amp-02.shanghai.arm.com [10.169.210.107]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 76F9D3F64C; Wed, 1 Nov 2023 00:21:17 -0700 (PDT) From: Ruifeng Wang To: Kevin Laatz , Robin Jarry , =?utf-8?q?Morten_Br=C3=B8rup?= Cc: dev@dpdk.org, honnappa.nagarahalli@arm.com, nd@arm.com, Ruifeng Wang , stable@dpdk.org Subject: [PATCH] eal: stop iteration after lcore info is processed Date: Wed, 1 Nov 2023 15:20:53 +0800 Message-Id: <20231101072053.1319697-1-ruifeng.wang@arm.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 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 Telemetry iterates on lcore ID to collect info of a specific lcore. Since only one lcore is processed at a time, the iteration can stop when a matching lcore is found. Fixes: f2b852d909f9 ("eal: add lcore info in telemetry") Cc: rjarry@redhat.com Cc: stable@dpdk.org Signed-off-by: Ruifeng Wang Acked-by: Stephen Hemminger Reviewed-by: Robin Jarry --- lib/eal/common/eal_common_lcore.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/eal/common/eal_common_lcore.c b/lib/eal/common/eal_common_lcore.c index ceda714ca5..0d6812ec75 100644 --- a/lib/eal/common/eal_common_lcore.c +++ b/lib/eal/common/eal_common_lcore.c @@ -546,7 +546,8 @@ lcore_telemetry_info_cb(unsigned int lcore_id, void *arg) rte_tel_data_add_dict_uint(info->d, "busy_cycles", usage.busy_cycles); } - return 0; + /* Return non-zero positive value to stop iterating over lcore_id. */ + return 1; } static int