* [dpdk-dev] [PATCH] app/test-pmd: fix incorrect port number check
@ 2015-03-11 7:23 Yong Liu
2015-03-11 15:03 ` Thomas Monjalon
0 siblings, 1 reply; 4+ messages in thread
From: Yong Liu @ 2015-03-11 7:23 UTC (permalink / raw)
To: dev
testpmd parameter "nb-port" mean the number of forwarding port.
It's incorrect to use function port_id_is_invalid to check number of ports.
Signed-off-by: Marvin Liu <yong.liu@intel.com>
diff --git a/app/test-pmd/parameters.c b/app/test-pmd/parameters.c
index 11d9af0..f1daa6e 100644
--- a/app/test-pmd/parameters.c
+++ b/app/test-pmd/parameters.c
@@ -628,8 +628,7 @@ launch_args_parse(int argc, char** argv)
#endif
if (!strcmp(lgopts[opt_idx].name, "nb-ports")) {
n = atoi(optarg);
- if (n > 0 &&
- !port_id_is_invalid(n, DISABLED_WARN))
+ if (n > 0 && n <= nb_ports)
nb_fwd_ports = (uint8_t) n;
else
rte_exit(EXIT_FAILURE,
--
1.9.3
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [dpdk-dev] [PATCH] app/test-pmd: fix incorrect port number check
2015-03-11 7:23 [dpdk-dev] [PATCH] app/test-pmd: fix incorrect port number check Yong Liu
@ 2015-03-11 15:03 ` Thomas Monjalon
0 siblings, 0 replies; 4+ messages in thread
From: Thomas Monjalon @ 2015-03-11 15:03 UTC (permalink / raw)
To: Yong Liu; +Cc: dev
2015-03-11 15:23, Yong Liu:
> testpmd parameter "nb-port" mean the number of forwarding port.
> It's incorrect to use function port_id_is_invalid to check number of ports.
>
> Signed-off-by: Marvin Liu <yong.liu@intel.com>
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Fixes: edab33b1c01d ("app/testpmd: support port hotplug")
Applied, thanks
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [dpdk-dev] [PATCH] app/test-pmd: fix incorrect port number check
2015-03-19 3:16 ` [dpdk-dev] [PATCH] app/test-pmd: fix incorrect port number check Yong Liu
@ 2015-03-19 8:40 ` Thomas Monjalon
0 siblings, 0 replies; 4+ messages in thread
From: Thomas Monjalon @ 2015-03-19 8:40 UTC (permalink / raw)
To: Yong Liu; +Cc: dev
This patch was already applied:
http://dpdk.org/browse/dpdk/commit/?id=0a530f0d58b030
2015-03-19 11:16, Yong Liu:
> testpmd parameter "nb-port" mean the number of forwarding port.
> It's incorrect to use function port_id_is_invalid to check number of ports.
>
> Signed-off-by: Marvin Liu <yong.liu@intel.com>
>
> diff --git a/app/test-pmd/parameters.c b/app/test-pmd/parameters.c
> index 11d9af0..f1daa6e 100644
> --- a/app/test-pmd/parameters.c
> +++ b/app/test-pmd/parameters.c
> @@ -628,8 +628,7 @@ launch_args_parse(int argc, char** argv)
> #endif
> if (!strcmp(lgopts[opt_idx].name, "nb-ports")) {
> n = atoi(optarg);
> - if (n > 0 &&
> - !port_id_is_invalid(n, DISABLED_WARN))
> + if (n > 0 && n <= nb_ports)
> nb_fwd_ports = (uint8_t) n;
> else
> rte_exit(EXIT_FAILURE,
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* [dpdk-dev] [PATCH] app/test-pmd: fix incorrect port number check
2015-03-19 3:16 [dpdk-dev] [PATCH 0/6] fix build warnings and errors in SUSE11 SP3 Yong Liu
@ 2015-03-19 3:16 ` Yong Liu
2015-03-19 8:40 ` Thomas Monjalon
0 siblings, 1 reply; 4+ messages in thread
From: Yong Liu @ 2015-03-19 3:16 UTC (permalink / raw)
To: dev
testpmd parameter "nb-port" mean the number of forwarding port.
It's incorrect to use function port_id_is_invalid to check number of ports.
Signed-off-by: Marvin Liu <yong.liu@intel.com>
diff --git a/app/test-pmd/parameters.c b/app/test-pmd/parameters.c
index 11d9af0..f1daa6e 100644
--- a/app/test-pmd/parameters.c
+++ b/app/test-pmd/parameters.c
@@ -628,8 +628,7 @@ launch_args_parse(int argc, char** argv)
#endif
if (!strcmp(lgopts[opt_idx].name, "nb-ports")) {
n = atoi(optarg);
- if (n > 0 &&
- !port_id_is_invalid(n, DISABLED_WARN))
+ if (n > 0 && n <= nb_ports)
nb_fwd_ports = (uint8_t) n;
else
rte_exit(EXIT_FAILURE,
--
1.9.3
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2015-03-19 8:41 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-11 7:23 [dpdk-dev] [PATCH] app/test-pmd: fix incorrect port number check Yong Liu
2015-03-11 15:03 ` Thomas Monjalon
2015-03-19 3:16 [dpdk-dev] [PATCH 0/6] fix build warnings and errors in SUSE11 SP3 Yong Liu
2015-03-19 3:16 ` [dpdk-dev] [PATCH] app/test-pmd: fix incorrect port number check Yong Liu
2015-03-19 8:40 ` 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).