* [PATCH 1/2] app/testpmd: check whether start for DCB fwd-tc command
2026-02-24 7:26 [PATCH 0/2] enhance for DCB fwd-tc command Chengwen Feng
@ 2026-02-24 7:26 ` Chengwen Feng
2026-02-24 7:41 ` yangxingui
2026-02-24 7:26 ` [PATCH 2/2] app/testpmd: add show " Chengwen Feng
2026-02-25 22:43 ` [PATCH 0/2] enhance for " Stephen Hemminger
2 siblings, 1 reply; 6+ messages in thread
From: Chengwen Feng @ 2026-02-24 7:26 UTC (permalink / raw)
To: thomas, stephen; +Cc: dev, aman.deep.singh
The 'set dcb fwd_tc xxx' and 'set dcb fwd_tc_cores xxx' commands should
check whether started forwarding, this patch add it.
Fixes: c58bdc7a589c ("app/testpmd: set DCB forwarding TCs")
Fixes: 945e9be0a803 ("app/testpmd: support multi-cores process one TC")
Cc: stable@dpdk.org
Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
---
app/test-pmd/cmdline.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index c33c66f327..012a3ad32f 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -6241,6 +6241,10 @@ static void cmd_set_dcb_fwd_tc_parsed(void *parsed_result,
{
struct cmd_set_dcb_fwd_tc_result *res = parsed_result;
int i;
+ if (test_done == 0) {
+ fprintf(stderr, "Please stop forwarding first\n");
+ return;
+ }
if (res->tc_mask == 0) {
fprintf(stderr, "TC mask should not be zero!\n");
return;
@@ -6293,6 +6297,10 @@ static void cmd_set_dcb_fwd_tc_cores_parsed(void *parsed_result,
__rte_unused void *data)
{
struct cmd_set_dcb_fwd_tc_cores_result *res = parsed_result;
+ if (test_done == 0) {
+ fprintf(stderr, "Please stop forwarding first\n");
+ return;
+ }
if (res->tc_cores == 0) {
fprintf(stderr, "Cores per-TC should not be zero!\n");
return;
--
2.17.1
^ permalink raw reply related [flat|nested] 6+ messages in thread* [PATCH 2/2] app/testpmd: add show DCB fwd-tc command
2026-02-24 7:26 [PATCH 0/2] enhance for DCB fwd-tc command Chengwen Feng
2026-02-24 7:26 ` [PATCH 1/2] app/testpmd: check whether start " Chengwen Feng
@ 2026-02-24 7:26 ` Chengwen Feng
2026-02-24 7:42 ` yangxingui
2026-02-25 22:43 ` [PATCH 0/2] enhance for " Stephen Hemminger
2 siblings, 1 reply; 6+ messages in thread
From: Chengwen Feng @ 2026-02-24 7:26 UTC (permalink / raw)
To: thomas, stephen; +Cc: dev, aman.deep.singh
This commit adds "show config dcbfwdtc" command which show DCB
forwarding TC list and cores per-TC.
Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
---
app/test-pmd/cmdline.c | 20 +++++++++++++++++---
doc/guides/testpmd_app_ug/testpmd_funcs.rst | 4 +++-
2 files changed, 20 insertions(+), 4 deletions(-)
diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index 012a3ad32f..e9a1331071 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -195,7 +195,7 @@ static void cmd_help_long_parsed(void *parsed_result,
"show (rxq|txq) info (port_id) (queue_id)\n"
" Display information for configured RX/TX queue.\n\n"
- "show config (rxtx|cores|fwd|rxoffs|rxpkts|rxhdrs|txpkts)\n"
+ "show config (rxtx|cores|fwd|rxoffs|rxpkts|rxhdrs|txpkts|txtimes|dcbfwdtc)\n"
" Display the given configuration.\n\n"
"read rxd (port_id) (queue_id) (rxd_id)\n"
@@ -6227,6 +6227,18 @@ static void cmd_set_fwd_retry_mode_init(void)
token_struct->string_data.str = token;
}
+static void show_dcb_fwd_tc_config(void)
+{
+ int i;
+ printf("DCB forwarding TC list:");
+ for (i = 0; i < RTE_ETH_8_TCS; i++) {
+ if (dcb_fwd_tc_mask & (1u << i))
+ printf(" %d", i);
+ }
+ printf("\n");
+ printf("DCB forwarding cores per-TC: %u\n", dcb_fwd_tc_cores);
+}
+
/* *** set DCB forward TCs *** */
struct cmd_set_dcb_fwd_tc_result {
cmdline_fixed_string_t set;
@@ -7390,6 +7402,8 @@ static void cmd_showcfg_parsed(void *parsed_result,
show_tx_pkt_segments();
else if (!strcmp(res->what, "txtimes"))
show_tx_pkt_times();
+ else if (!strcmp(res->what, "dcbfwdtc"))
+ show_dcb_fwd_tc_config();
}
static cmdline_parse_token_string_t cmd_showcfg_show =
@@ -7398,12 +7412,12 @@ static cmdline_parse_token_string_t cmd_showcfg_port =
TOKEN_STRING_INITIALIZER(struct cmd_showcfg_result, cfg, "config");
static cmdline_parse_token_string_t cmd_showcfg_what =
TOKEN_STRING_INITIALIZER(struct cmd_showcfg_result, what,
- "rxtx#cores#fwd#rxoffs#rxpkts#rxhdrs#txpkts#txtimes");
+ "rxtx#cores#fwd#rxoffs#rxpkts#rxhdrs#txpkts#txtimes#dcbfwdtc");
static cmdline_parse_inst_t cmd_showcfg = {
.f = cmd_showcfg_parsed,
.data = NULL,
- .help_str = "show config rxtx|cores|fwd|rxoffs|rxpkts|rxhdrs|txpkts|txtimes",
+ .help_str = "show config rxtx|cores|fwd|rxoffs|rxpkts|rxhdrs|txpkts|txtimes|dcbfwdtc",
.tokens = {
(void *)&cmd_showcfg_show,
(void *)&cmd_showcfg_port,
diff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
index 62bb167d56..3c078578d8 100644
--- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst
+++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
@@ -297,7 +297,7 @@ show config
Displays the configuration of the application.
The configuration comes from the command-line, the runtime or the application defaults::
- testpmd> show config (rxtx|cores|fwd|rxoffs|rxpkts|rxhdrs|txpkts|txtimes)
+ testpmd> show config (rxtx|cores|fwd|rxoffs|rxpkts|rxhdrs|txpkts|txtimes|dcbfwdtc)
The available information categories are:
@@ -317,6 +317,8 @@ The available information categories are:
* ``txtimes``: Burst time pattern for Tx only mode.
+* ``dcbfwdtc``: DCB forwarding TC-related configuration.
+
For example:
.. code-block:: console
--
2.17.1
^ permalink raw reply related [flat|nested] 6+ messages in thread