[PATCH v2 6/6] examples/vm_power_manager: fix lcore ID restriction

Sivaprasad Tummala sivaprasad.tummala at amd.com
Tue Dec 19 03:56:07 CET 2023


Currently the config option allows lcore IDs up to 255,
irrespective of RTE_MAX_LCORES and needs to be fixed.

The patch allows config options based on DPDK config.

Fixes: 0e8f47491f09 ("examples/vm_power: add command to query CPU frequency")
Cc: marcinx.hajkowski at intel.com
Cc: stable at dpdk.org

Signed-off-by: Sivaprasad Tummala <sivaprasad.tummala at amd.com>
---
 examples/vm_power_manager/guest_cli/vm_power_cli_guest.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/examples/vm_power_manager/guest_cli/vm_power_cli_guest.c b/examples/vm_power_manager/guest_cli/vm_power_cli_guest.c
index 94bfbbaf78..a586853a76 100644
--- a/examples/vm_power_manager/guest_cli/vm_power_cli_guest.c
+++ b/examples/vm_power_manager/guest_cli/vm_power_cli_guest.c
@@ -401,7 +401,7 @@ check_response_cmd(unsigned int lcore_id, int *result)
 
 struct cmd_set_cpu_freq_result {
 	cmdline_fixed_string_t set_cpu_freq;
-	uint8_t lcore_id;
+	uint16_t lcore_id;
 	cmdline_fixed_string_t cmd;
 };
 
@@ -444,7 +444,7 @@ cmdline_parse_token_string_t cmd_set_cpu_freq =
 			set_cpu_freq, "set_cpu_freq");
 cmdline_parse_token_num_t cmd_set_cpu_freq_core_num =
 	TOKEN_NUM_INITIALIZER(struct cmd_set_cpu_freq_result,
-			lcore_id, RTE_UINT8);
+			lcore_id, RTE_UINT16);
 cmdline_parse_token_string_t cmd_set_cpu_freq_cmd_cmd =
 	TOKEN_STRING_INITIALIZER(struct cmd_set_cpu_freq_result,
 			cmd, "up#down#min#max#enable_turbo#disable_turbo");
-- 
2.25.1



More information about the stable mailing list