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: [email protected]
Signed-off-by: Chengwen Feng <[email protected]>
---
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