DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] app/test-pmd: Fix log issue without nic binded
@ 2015-03-02  8:31 Michael Qiu
  2015-03-05  1:57 ` Qiu, Michael
  2015-03-06 15:03 ` De Lara Guarch, Pablo
  0 siblings, 2 replies; 4+ messages in thread
From: Michael Qiu @ 2015-03-02  8:31 UTC (permalink / raw)
  To: dev

As hotplug has been enabled, start the testpmd with no nic binded
will show one error log "Please stop the ports first":

Interactive-mode selected
Please stop the ports first
Done
testpmd>

This issue is cause by the logic of check link status.

Signed-off-by: Michael Qiu <michael.qiu@intel.com>
---
 app/test-pmd/testpmd.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
index 61291be..e556b4c 100644
--- a/app/test-pmd/testpmd.c
+++ b/app/test-pmd/testpmd.c
@@ -1315,7 +1315,7 @@ port_is_closed(portid_t port_id)
 int
 start_port(portid_t pid)
 {
-	int diag, need_check_link_status = 0;
+	int diag, need_check_link_status = -1;
 	portid_t pi;
 	queueid_t qi;
 	struct rte_port *port;
@@ -1337,6 +1337,7 @@ start_port(portid_t pid)
 		if (pid != pi && pid != (portid_t)RTE_PORT_ALL)
 			continue;
 
+		need_check_link_status = 0;
 		port = &ports[pi];
 		if (rte_atomic16_cmpset(&(port->port_status), RTE_PORT_STOPPED,
 						 RTE_PORT_HANDLING) == 0) {
@@ -1457,9 +1458,9 @@ start_port(portid_t pid)
 		need_check_link_status = 1;
 	}
 
-	if (need_check_link_status && !no_link_check)
+	if (need_check_link_status == 1 && !no_link_check)
 		check_all_ports_link_status(RTE_PORT_ALL);
-	else
+	else if (need_check_link_status == 0)
 		printf("Please stop the ports first\n");
 
 	printf("Done\n");
-- 
1.9.3

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

* Re: [dpdk-dev] [PATCH] app/test-pmd: Fix log issue without nic binded
  2015-03-02  8:31 [dpdk-dev] [PATCH] app/test-pmd: Fix log issue without nic binded Michael Qiu
@ 2015-03-05  1:57 ` Qiu, Michael
  2015-03-06 15:03 ` De Lara Guarch, Pablo
  1 sibling, 0 replies; 4+ messages in thread
From: Qiu, Michael @ 2015-03-05  1:57 UTC (permalink / raw)
  To: dev

Hi, all

What about this patch?

Thanks,
Michael


On 3/2/2015 4:31 PM, Qiu, Michael wrote:
> As hotplug has been enabled, start the testpmd with no nic binded
> will show one error log "Please stop the ports first":
>
> Interactive-mode selected
> Please stop the ports first
> Done
> testpmd>
>
> This issue is cause by the logic of check link status.
>
> Signed-off-by: Michael Qiu <michael.qiu@intel.com>
> ---
>  app/test-pmd/testpmd.c | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
> index 61291be..e556b4c 100644
> --- a/app/test-pmd/testpmd.c
> +++ b/app/test-pmd/testpmd.c
> @@ -1315,7 +1315,7 @@ port_is_closed(portid_t port_id)
>  int
>  start_port(portid_t pid)
>  {
> -	int diag, need_check_link_status = 0;
> +	int diag, need_check_link_status = -1;
>  	portid_t pi;
>  	queueid_t qi;
>  	struct rte_port *port;
> @@ -1337,6 +1337,7 @@ start_port(portid_t pid)
>  		if (pid != pi && pid != (portid_t)RTE_PORT_ALL)
>  			continue;
>  
> +		need_check_link_status = 0;
>  		port = &ports[pi];
>  		if (rte_atomic16_cmpset(&(port->port_status), RTE_PORT_STOPPED,
>  						 RTE_PORT_HANDLING) == 0) {
> @@ -1457,9 +1458,9 @@ start_port(portid_t pid)
>  		need_check_link_status = 1;
>  	}
>  
> -	if (need_check_link_status && !no_link_check)
> +	if (need_check_link_status == 1 && !no_link_check)
>  		check_all_ports_link_status(RTE_PORT_ALL);
> -	else
> +	else if (need_check_link_status == 0)
>  		printf("Please stop the ports first\n");
>  
>  	printf("Done\n");


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

* Re: [dpdk-dev] [PATCH] app/test-pmd: Fix log issue without nic binded
  2015-03-02  8:31 [dpdk-dev] [PATCH] app/test-pmd: Fix log issue without nic binded Michael Qiu
  2015-03-05  1:57 ` Qiu, Michael
@ 2015-03-06 15:03 ` De Lara Guarch, Pablo
  2015-03-09  8:22   ` Thomas Monjalon
  1 sibling, 1 reply; 4+ messages in thread
From: De Lara Guarch, Pablo @ 2015-03-06 15:03 UTC (permalink / raw)
  To: Qiu, Michael, dev



> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Michael Qiu
> Sent: Monday, March 02, 2015 8:32 AM
> To: dev@dpdk.org
> Subject: [dpdk-dev] [PATCH] app/test-pmd: Fix log issue without nic binded
> 
> As hotplug has been enabled, start the testpmd with no nic binded
> will show one error log "Please stop the ports first":
> 
> Interactive-mode selected
> Please stop the ports first
> Done
> testpmd>
> 
> This issue is cause by the logic of check link status.
> 
> Signed-off-by: Michael Qiu <michael.qiu@intel.com>

Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>

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

* Re: [dpdk-dev] [PATCH] app/test-pmd: Fix log issue without nic binded
  2015-03-06 15:03 ` De Lara Guarch, Pablo
@ 2015-03-09  8:22   ` Thomas Monjalon
  0 siblings, 0 replies; 4+ messages in thread
From: Thomas Monjalon @ 2015-03-09  8:22 UTC (permalink / raw)
  To: Qiu, Michael; +Cc: dev

> > As hotplug has been enabled, start the testpmd with no nic binded
> > will show one error log "Please stop the ports first":
> > 
> > Interactive-mode selected
> > Please stop the ports first
> > Done
> > testpmd>
> > 
> > This issue is cause by the logic of check link status.
> > 
> > Signed-off-by: Michael Qiu <michael.qiu@intel.com>
> 
> Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>

Applied, thanks

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

end of thread, other threads:[~2015-03-09 11:50 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-02  8:31 [dpdk-dev] [PATCH] app/test-pmd: Fix log issue without nic binded Michael Qiu
2015-03-05  1:57 ` Qiu, Michael
2015-03-06 15:03 ` De Lara Guarch, Pablo
2015-03-09  8:22   ` Thomas Monjalon

DPDK patches and discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://inbox.dpdk.org/dev/0 dev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dev dev/ https://inbox.dpdk.org/dev \
		dev@dpdk.org
	public-inbox-index dev

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.dev


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git