* [dpdk-dev] [PATCH] testpmd: Fix action of operationg invalid port
@ 2015-03-09 6:05 Michael Qiu
2015-03-09 6:11 ` Tetsuya Mukawa
0 siblings, 1 reply; 3+ messages in thread
From: Michael Qiu @ 2015-03-09 6:05 UTC (permalink / raw)
To: dev
Currently, if try to start/stop/close one invalid prot,
no error shows in testpmd.
This is a bug, need check the port number.
Signed-off-by: Michael Qiu <michael.qiu@intel.com>
---
app/test-pmd/config.c | 3 +++
app/test-pmd/testpmd.c | 14 ++++++++++++--
2 files changed, 15 insertions(+), 2 deletions(-)
diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
index 49be819..ec53923 100644
--- a/app/test-pmd/config.c
+++ b/app/test-pmd/config.c
@@ -384,6 +384,9 @@ port_infos_display(portid_t port_id)
int
port_id_is_invalid(portid_t port_id, enum print_warning warning)
{
+ if (port_id == (portid_t)RTE_PORT_ALL)
+ return 0;
+
if (ports[port_id].enabled)
return 0;
diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
index e556b4c..1c4c651 100644
--- a/app/test-pmd/testpmd.c
+++ b/app/test-pmd/testpmd.c
@@ -1326,6 +1326,9 @@ start_port(portid_t pid)
return -1;
}
+ if (port_id_is_invalid(pid, ENABLED_WARN))
+ return 0;
+
if (init_fwd_streams() < 0) {
printf("Fail from init_fwd_streams()\n");
return -1;
@@ -1482,10 +1485,14 @@ stop_port(portid_t pid)
dcb_test = 0;
dcb_config = 0;
}
+
+ if (port_id_is_invalid(pid, ENABLED_WARN))
+ return;
+
printf("Stopping ports...\n");
FOREACH_PORT(pi, ports) {
- if (!port_id_is_invalid(pid, DISABLED_WARN) && pid != pi)
+ if (pid != pi && pid != (portid_t)RTE_PORT_ALL)
continue;
port = &ports[pi];
@@ -1517,10 +1524,13 @@ close_port(portid_t pid)
return;
}
+ if (port_id_is_invalid(pid, ENABLED_WARN))
+ return;
+
printf("Closing ports...\n");
FOREACH_PORT(pi, ports) {
- if (!port_id_is_invalid(pid, DISABLED_WARN) && pid != pi)
+ if (pid != pi && pid != (portid_t)RTE_PORT_ALL)
continue;
port = &ports[pi];
--
1.9.3
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [dpdk-dev] [PATCH] testpmd: Fix action of operationg invalid port
2015-03-09 6:05 [dpdk-dev] [PATCH] testpmd: Fix action of operationg invalid port Michael Qiu
@ 2015-03-09 6:11 ` Tetsuya Mukawa
2015-03-09 11:30 ` Thomas Monjalon
0 siblings, 1 reply; 3+ messages in thread
From: Tetsuya Mukawa @ 2015-03-09 6:11 UTC (permalink / raw)
To: Michael Qiu, dev
On 2015/03/09 15:05, Michael Qiu wrote:
> Currently, if try to start/stop/close one invalid prot,
> no error shows in testpmd.
> This is a bug, need check the port number.
>
> Signed-off-by: Michael Qiu <michael.qiu@intel.com>
> ---
> app/test-pmd/config.c | 3 +++
> app/test-pmd/testpmd.c | 14 ++++++++++++--
> 2 files changed, 15 insertions(+), 2 deletions(-)
>
> diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
> index 49be819..ec53923 100644
> --- a/app/test-pmd/config.c
> +++ b/app/test-pmd/config.c
> @@ -384,6 +384,9 @@ port_infos_display(portid_t port_id)
> int
> port_id_is_invalid(portid_t port_id, enum print_warning warning)
> {
> + if (port_id == (portid_t)RTE_PORT_ALL)
> + return 0;
> +
> if (ports[port_id].enabled)
> return 0;
>
> diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
> index e556b4c..1c4c651 100644
> --- a/app/test-pmd/testpmd.c
> +++ b/app/test-pmd/testpmd.c
> @@ -1326,6 +1326,9 @@ start_port(portid_t pid)
> return -1;
> }
>
> + if (port_id_is_invalid(pid, ENABLED_WARN))
> + return 0;
> +
> if (init_fwd_streams() < 0) {
> printf("Fail from init_fwd_streams()\n");
> return -1;
> @@ -1482,10 +1485,14 @@ stop_port(portid_t pid)
> dcb_test = 0;
> dcb_config = 0;
> }
> +
> + if (port_id_is_invalid(pid, ENABLED_WARN))
> + return;
> +
> printf("Stopping ports...\n");
>
> FOREACH_PORT(pi, ports) {
> - if (!port_id_is_invalid(pid, DISABLED_WARN) && pid != pi)
> + if (pid != pi && pid != (portid_t)RTE_PORT_ALL)
> continue;
>
> port = &ports[pi];
> @@ -1517,10 +1524,13 @@ close_port(portid_t pid)
> return;
> }
>
> + if (port_id_is_invalid(pid, ENABLED_WARN))
> + return;
> +
> printf("Closing ports...\n");
>
> FOREACH_PORT(pi, ports) {
> - if (!port_id_is_invalid(pid, DISABLED_WARN) && pid != pi)
> + if (pid != pi && pid != (portid_t)RTE_PORT_ALL)
> continue;
>
> port = &ports[pi];
Acked-by: Tetsuya Mukawa <mukawa@igel.co.jp>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [dpdk-dev] [PATCH] testpmd: Fix action of operationg invalid port
2015-03-09 6:11 ` Tetsuya Mukawa
@ 2015-03-09 11:30 ` Thomas Monjalon
0 siblings, 0 replies; 3+ messages in thread
From: Thomas Monjalon @ 2015-03-09 11:30 UTC (permalink / raw)
To: Michael Qiu; +Cc: dev
> > Currently, if try to start/stop/close one invalid prot,
> > no error shows in testpmd.
> > This is a bug, need check the port number.
> >
> > Signed-off-by: Michael Qiu <michael.qiu@intel.com>
>
> Acked-by: Tetsuya Mukawa <mukawa@igel.co.jp>
Applied, thanks
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-03-09 11:50 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-09 6:05 [dpdk-dev] [PATCH] testpmd: Fix action of operationg invalid port Michael Qiu
2015-03-09 6:11 ` Tetsuya Mukawa
2015-03-09 11:30 ` 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).