Skip to contentSkip to conversation

eal: stop iteration after lcore info is processed

PATCH In review Ruifeng Wang 4 participants 4 messages Nov 1, 2023 – Nov 6, 2023

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 eal: stop iteration after lcore info is processed

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")
---
 lib/eal/common/eal_common_lcore.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
lib/eal/common/eal_common_lcore.c +2 -1
index ceda714ca5..0d6812ec75 100644
@@ -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
Signature · 1 line
2.25.1
Acked-by on v1 1/1
#1 lore raw
Quoted 11 lines · On Wed, 1 Nov 2023 15:20:53 +0800 Ruifeng Wang <[email protected]> wrote:

From: Ruifeng Wang <[email protected]>
To: Kevin Laatz <[email protected]>, Robin Jarry <[email protected]>, Morten Brørup <[email protected]>
Cc: [email protected], [email protected], [email protected], Ruifeng Wang <[email protected]>, [email protected]
Subject: [PATCH] eal: stop iteration after lcore info is processed
Date: Wed, 1 Nov 2023 15:20:53 +0800
X-Mailer: git-send-email 2.25.1

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.

Quoted 5 lines
Fixes f2b852d909f9 ("eal: add lcore info in telemetry")

Looks like a good optimization. Not sure it needs to go to stable.

#2 lore raw
Quoted 8 lines
Quoted 8 lines

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")
Quoted 5 lines
Quoted 1 line

Looks like a good optimization. Not sure it needs to go to stable.

Applied without "Cc:stable", thanks.

Reviewed-by on v1 1/1
#3 lore raw
In reply to Ruifeng Wang

Ruifeng Wang, Nov 01, 2023 at 08:20:

Quoted 18 lines

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")
---
 lib/eal/common/eal_common_lcore.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
lib/eal/common/eal_common_lcore.c +0 -0
index ceda714ca5..0d6812ec75 100644

lib/eal/common/eal_common_lcore.c lcore_telemetry_info_cb(unsigned int lcore_id, void *arg) · line 551

Quoted 7 lines
lib/eal/common/eal_common_lcore.c +2 -1
@@ -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;
 }

Hi Ruifeng, Nice catch.