[PATCH] app/testpmd: fix set cores list string size

Dengdui Huang huangdengdui at huawei.com
Tue Jul 8 14:51:59 CEST 2025


The cmdline_fixed_string_t has a length of only 128, which will
become insufficient when there are many cores, so it should be
replaced with a cmdline_multi_string_t of larger capacity.

Fixes: af75078fece3 ("first public release")
Cc: stable at dpdk.org

Signed-off-by: Dengdui Huang <huangdengdui at huawei.com>
---
 app/test-pmd/cmdline.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index 7b4e27eddf..801dee4456 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -4063,7 +4063,7 @@ parse_item_list(const char *str, const char *item_name, unsigned int max_items,
 	value = 0;
 	nb_item = 0;
 	value_ok = 0;
-	for (i = 0; i < strnlen(str, STR_TOKEN_SIZE); i++) {
+	for (i = 0; i < strnlen(str, STR_MULTI_TOKEN_SIZE); i++) {
 		c = str[i];
 		if ((c >= '0') && (c <= '9')) {
 			value = (unsigned int) (value * 10 + (c - '0'));
@@ -4114,7 +4114,7 @@ parse_item_list(const char *str, const char *item_name, unsigned int max_items,
 struct cmd_set_list_result {
 	cmdline_fixed_string_t cmd_keyword;
 	cmdline_fixed_string_t list_name;
-	cmdline_fixed_string_t list_of_items;
+	cmdline_multi_string_t list_of_items;
 };
 
 static void cmd_set_list_parsed(void *parsed_result,
@@ -4163,7 +4163,7 @@ static cmdline_parse_token_string_t cmd_set_list_name =
 				 "corelist#portlist");
 static cmdline_parse_token_string_t cmd_set_list_of_items =
 	TOKEN_STRING_INITIALIZER(struct cmd_set_list_result, list_of_items,
-				 NULL);
+				 TOKEN_STRING_MULTI);
 
 static cmdline_parse_inst_t cmd_set_fwd_list = {
 	.f = cmd_set_list_parsed,
-- 
2.33.0



More information about the dev mailing list