public inbox for dev@dpdk.org
 help / color / mirror / Atom feed
From: Chengwen Feng <fengchengwen@huawei.com>
To: <thomas@monjalon.net>, <stephen@networkplumber.org>
Cc: <dev@dpdk.org>, <aman.deep.singh@intel.com>
Subject: [PATCH 1/2] app/testpmd: check whether start for DCB fwd-tc command
Date: Tue, 24 Feb 2026 15:26:46 +0800	[thread overview]
Message-ID: <20260224072647.607-2-fengchengwen@huawei.com> (raw)
In-Reply-To: <20260224072647.607-1-fengchengwen@huawei.com>

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


  reply	other threads:[~2026-02-24  7:27 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-24  7:26 [PATCH 0/2] enhance for DCB fwd-tc command Chengwen Feng
2026-02-24  7:26 ` Chengwen Feng [this message]
2026-02-24  7:41   ` [PATCH 1/2] app/testpmd: check whether start " yangxingui
2026-02-24  7:26 ` [PATCH 2/2] app/testpmd: add show " Chengwen Feng
2026-02-24  7:42   ` yangxingui
2026-02-25 22:43 ` [PATCH 0/2] enhance for " Stephen Hemminger

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=20260224072647.607-2-fengchengwen@huawei.com \
    --to=fengchengwen@huawei.com \
    --cc=aman.deep.singh@intel.com \
    --cc=dev@dpdk.org \
    --cc=stephen@networkplumber.org \
    --cc=thomas@monjalon.net \
    /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