* [PATCH] app/testpmd: fix set cores list string size
@ 2025-07-08 12:51 Dengdui Huang
0 siblings, 0 replies; only message in thread
From: Dengdui Huang @ 2025-07-08 12:51 UTC (permalink / raw)
To: dev; +Cc: stephen, aman.deep.singh, lihuisong, fengchengwen, liuyonglong
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@dpdk.org
Signed-off-by: Dengdui Huang <huangdengdui@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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2025-07-08 12:52 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-07-08 12:51 [PATCH] app/testpmd: fix set cores list string size Dengdui Huang
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).