DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] testpmd: Fix wrong message in testpmd
@ 2015-06-24  7:56 Michael Qiu
  2015-07-08  7:16 ` Qiu, Michael
  2015-07-29 22:20 ` Thomas Monjalon
  0 siblings, 2 replies; 5+ messages in thread
From: Michael Qiu @ 2015-06-24  7:56 UTC (permalink / raw)
  To: dev

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-07-29 22:21 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-06-24  7:56 [dpdk-dev] [PATCH] testpmd: Fix wrong message in testpmd Michael Qiu
2015-07-08  7:16 ` Qiu, Michael
2015-07-08  9:04   ` Bruce Richardson
2015-07-28 18:44     ` Qiu, Michael
2015-07-29 22:20 ` Thomas Monjalon

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).