DPDK patches and discussions
 help / color / mirror / Atom feed
From: Pablo de Lara <pablo.de.lara.guarch@intel.com>
To: dev@dpdk.org
Subject: [dpdk-dev] [PATCH] testpmd: force user to stop forwarding when changing port/core list
Date: Tue, 10 Feb 2015 14:53:17 +0000	[thread overview]
Message-ID: <1423579997-22014-1-git-send-email-pablo.de.lara.guarch@intel.com> (raw)

Testpmd has the capability of changing the forwarding cores and ports in runtime.
If these are changed when forwarding, two issues may be encountered:

- If "show config fwd" is used, changes made in the core list are applied.
  Therefore, trying to stop forwarding may hang testpmd,
  since it could be waiting for cores to stop that are not actually running anything

- If the port list is changed, when stopping forwarding,
  it may miss the stats of some of the ports that were actually being used.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
---
 app/test-pmd/cmdline.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index 590e427..46d4bf9 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -2316,6 +2316,11 @@ static void cmd_set_list_parsed(void *parsed_result,
 	} parsed_items;
 	unsigned int nb_item;
 
+	if (test_done == 0) {
+		printf("Please stop forwarding first\n");
+		return;
+	}
+
 	res = parsed_result;
 	if (!strcmp(res->list_name, "corelist")) {
 		nb_item = parse_item_list(res->list_of_items, "core",
@@ -2370,6 +2375,10 @@ static void cmd_set_mask_parsed(void *parsed_result,
 {
 	struct cmd_setmask_result *res = parsed_result;
 
+	if (test_done == 0) {
+		printf("Please stop forwarding first\n");
+		return;
+	}
 	if (!strcmp(res->mask, "coremask"))
 		set_fwd_lcores_mask(res->hexavalue);
 	else if (!strcmp(res->mask, "portmask"))
-- 
1.7.4.1

             reply	other threads:[~2015-02-10 14:53 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-10 14:53 Pablo de Lara [this message]
2015-02-11  6:56 ` Zhang, Helin
2015-02-15 15:57   ` Thomas Monjalon

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=1423579997-22014-1-git-send-email-pablo.de.lara.guarch@intel.com \
    --to=pablo.de.lara.guarch@intel.com \
    --cc=dev@dpdk.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).