From: Michael Qiu <michael.qiu@intel.com>
To: dev@dpdk.org
Subject: [PATCH] testpmd: Fix wrong message in testpmd
Date: Wed, 24 Jun 2015 15:56:25 +0800 [thread overview]
Message-ID: <1435132585-10192-1-git-send-email-michael.qiu@intel.com> (raw)
When close one port twice, testpmd will give out wrong messagse.
testpmd> port stop 0
Stopping ports...
Checking link statuses...
Port 0 Link Up - speed 0 Mbps - full-duplex
Port 1 Link Up - speed 0 Mbps - full-duplex
Done
testpmd> port close 0
Closing ports...
Done
testpmd> port close 0
Closing ports...
Port 0 is now not stopped
Done
testpmd>
Signed-off-by: Michael Qiu <michael.qiu@intel.com>
---
app/test-pmd/testpmd.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
index 3057791..907cda3 100644
--- a/app/test-pmd/testpmd.c
+++ b/app/test-pmd/testpmd.c
@@ -1534,6 +1534,12 @@ close_port(portid_t pid)
port = &ports[pi];
if (rte_atomic16_cmpset(&(port->port_status),
+ RTE_PORT_CLOSED, RTE_PORT_CLOSED) == 1) {
+ printf("Port %d is already closed\n", pi);
+ continue;
+ }
+
+ if (rte_atomic16_cmpset(&(port->port_status),
RTE_PORT_STOPPED, RTE_PORT_HANDLING) == 0) {
printf("Port %d is now not stopped\n", pi);
continue;
--
2.1.0
next reply other threads:[~2015-06-24 7:56 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-24 7:56 Michael Qiu [this message]
2015-07-08 7:16 ` [PATCH] testpmd: Fix wrong message in testpmd Qiu, Michael
2015-07-08 9:04 ` Bruce Richardson
2015-07-28 18:44 ` Qiu, Michael
2015-07-29 22:20 ` 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=1435132585-10192-1-git-send-email-michael.qiu@intel.com \
--to=michael.qiu@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).