From: Dengdui Huang <huangdengdui@huawei.com>
To: <dev@dpdk.org>
Cc: <stephen@networkplumber.org>, <aman.deep.singh@intel.com>,
<lihuisong@huawei.com>, <fengchengwen@huawei.com>,
<liuyonglong@huawei.com>
Subject: [PATCH] app/testpmd: fix set cores list string size
Date: Tue, 8 Jul 2025 20:51:59 +0800 [thread overview]
Message-ID: <20250708125159.2457578-1-huangdengdui@huawei.com> (raw)
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
reply other threads:[~2025-07-08 12:52 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250708125159.2457578-1-huangdengdui@huawei.com \
--to=huangdengdui@huawei.com \
--cc=aman.deep.singh@intel.com \
--cc=dev@dpdk.org \
--cc=fengchengwen@huawei.com \
--cc=lihuisong@huawei.com \
--cc=liuyonglong@huawei.com \
--cc=stephen@networkplumber.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).