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

* Re: [dpdk-dev] [PATCH] testpmd: Fix wrong message in testpmd
  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-29 22:20 ` Thomas Monjalon
  1 sibling, 1 reply; 5+ messages in thread
From: Qiu, Michael @ 2015-07-08  7:16 UTC (permalink / raw)
  To: dev

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;


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

* Re: [dpdk-dev] [PATCH] testpmd: Fix wrong message in testpmd
  2015-07-08  7:16 ` Qiu, Michael
@ 2015-07-08  9:04   ` Bruce Richardson
  2015-07-28 18:44     ` Qiu, Michael
  0 siblings, 1 reply; 5+ messages in thread
From: Bruce Richardson @ 2015-07-08  9:04 UTC (permalink / raw)
  To: Qiu, Michael; +Cc: dev

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
> 

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

* Re: [dpdk-dev] [PATCH] testpmd: Fix wrong message in testpmd
  2015-07-08  9:04   ` Bruce Richardson
@ 2015-07-28 18:44     ` Qiu, Michael
  0 siblings, 0 replies; 5+ messages in thread
From: Qiu, Michael @ 2015-07-28 18:44 UTC (permalink / raw)
  To: Richardson, Bruce; +Cc: dev

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


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

* Re: [dpdk-dev] [PATCH] testpmd: Fix wrong message in testpmd
  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-29 22:20 ` Thomas Monjalon
  1 sibling, 0 replies; 5+ messages in thread
From: Thomas Monjalon @ 2015-07-29 22:20 UTC (permalink / raw)
  To: Michael Qiu; +Cc: dev

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

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