From: Michael Qiu <michael.qiu@intel.com>
To: dev@dpdk.org
Subject: [dpdk-dev] [PATCH] app/test-pmd: Fix log issue without nic binded
Date: Mon, 2 Mar 2015 16:31:37 +0800 [thread overview]
Message-ID: <1425285097-14781-1-git-send-email-michael.qiu@intel.com> (raw)
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
next reply other threads:[~2015-03-02 8:31 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-02 8:31 Michael Qiu [this message]
2015-03-05 1:57 ` Qiu, Michael
2015-03-06 15:03 ` De Lara Guarch, Pablo
2015-03-09 8:22 ` 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=1425285097-14781-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).