Message ID | 1435132585-10192-1-git-send-email-michael.qiu@intel.com (mailing list archive) |
---|---|
State | Accepted, archived |
Headers |
Return-Path: <dev-bounces@dpdk.org> X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id B9B31C39A; Wed, 24 Jun 2015 09:56:53 +0200 (CEST) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id D0C745FEB for <dev@dpdk.org>; Wed, 24 Jun 2015 09:56:51 +0200 (CEST) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga101.jf.intel.com with ESMTP; 24 Jun 2015 00:56:34 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.13,671,1427785200"; d="scan'208";a="513396391" Received: from shvmail01.sh.intel.com ([10.239.29.42]) by FMSMGA003.fm.intel.com with ESMTP; 24 Jun 2015 00:56:33 -0700 Received: from shecgisg004.sh.intel.com (shecgisg004.sh.intel.com [10.239.29.89]) by shvmail01.sh.intel.com with ESMTP id t5O7uVQp018943; Wed, 24 Jun 2015 15:56:31 +0800 Received: from shecgisg004.sh.intel.com (localhost [127.0.0.1]) by shecgisg004.sh.intel.com (8.13.6/8.13.6/SuSE Linux 0.8) with ESMTP id t5O7uRUk010227; Wed, 24 Jun 2015 15:56:29 +0800 Received: (from dayuqiu@localhost) by shecgisg004.sh.intel.com (8.13.6/8.13.6/Submit) id t5O7uR8m010223; Wed, 24 Jun 2015 15:56:27 +0800 From: Michael Qiu <michael.qiu@intel.com> To: dev@dpdk.org Date: Wed, 24 Jun 2015 15:56:25 +0800 Message-Id: <1435132585-10192-1-git-send-email-michael.qiu@intel.com> X-Mailer: git-send-email 1.7.4.1 Subject: [dpdk-dev] [PATCH] testpmd: Fix wrong message in testpmd X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK <dev.dpdk.org> List-Unsubscribe: <http://dpdk.org/ml/options/dev>, <mailto:dev-request@dpdk.org?subject=unsubscribe> List-Archive: <http://dpdk.org/ml/archives/dev/> List-Post: <mailto:dev@dpdk.org> List-Help: <mailto:dev-request@dpdk.org?subject=help> List-Subscribe: <http://dpdk.org/ml/listinfo/dev>, <mailto:dev-request@dpdk.org?subject=subscribe> Errors-To: dev-bounces@dpdk.org Sender: "dev" <dev-bounces@dpdk.org> |
Commit Message
Michael Qiu
June 24, 2015, 7:56 a.m. UTC
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(+)
Comments
Any comments? This is a bug fix, not a feature. Thanks, Michael On 6/24/2015 3:56 PM, Qiu, Michael wrote: > 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;
On Wed, Jul 08, 2015 at 07:16:21AM +0000, Qiu, Michael wrote: > Any comments? This is a bug fix, not a feature. > > Thanks, > Michael > > On 6/24/2015 3:56 PM, Qiu, Michael wrote: > > 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; I know it's not part of your change, but "Now not stopped" doesn't really seem right to me. What is the message actually trying to report? /Bruce >
On 2015/7/8 2:04, Richardson, Bruce wrote: > On Wed, Jul 08, 2015 at 07:16:21AM +0000, Qiu, Michael wrote: [.../...] >>> 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; > I know it's not part of your change, but "Now not stopped" doesn't really seem > right to me. What is the message actually trying to report? It is just make sure the port is in stopped state. So it will check if it is not in RTE_PORT_STOPPED stat or fail to set to RTE_PORT_HANDLING, it will report as "now not stopped" Thanks, Michael > > /Bruce
2015-06-24 15:56, Michael Qiu: > 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> Applied, thanks
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;