* [PATCH] app/test-pmd: fix incorrect port number check
@ 2015-03-11 7:23 Yong Liu
[not found] ` <1426058590-15180-1-git-send-email-yong.liu-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
0 siblings, 1 reply; 4+ messages in thread
From: Yong Liu @ 2015-03-11 7:23 UTC (permalink / raw)
To: dev-VfR2kkLFssw
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-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
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 related [flat|nested] 4+ messages in thread
* Re: [PATCH] app/test-pmd: fix incorrect port number check
[not found] ` <1426058590-15180-1-git-send-email-yong.liu-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
@ 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-VfR2kkLFssw
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-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Acked-by: Thomas Monjalon <thomas.monjalon-pdR9zngts4EAvxtiuMwx3w@public.gmane.org>
Fixes: edab33b1c01d ("app/testpmd: support port hotplug")
Applied, thanks
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH] app/test-pmd: fix incorrect port number check
[not found] ` <1426735018-19411-1-git-send-email-yong.liu-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
@ 2015-03-19 3:16 ` Yong Liu
[not found] ` <1426735018-19411-2-git-send-email-yong.liu-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
0 siblings, 1 reply; 4+ messages in thread
From: Yong Liu @ 2015-03-19 3:16 UTC (permalink / raw)
To: dev-VfR2kkLFssw
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-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
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 related [flat|nested] 4+ messages in thread
* Re: [PATCH] app/test-pmd: fix incorrect port number check
[not found] ` <1426735018-19411-2-git-send-email-yong.liu-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
@ 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-VfR2kkLFssw
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-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
>
> 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
end of thread, other threads:[~2015-03-19 8:40 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 [PATCH] app/test-pmd: fix incorrect port number check Yong Liu
[not found] ` <1426058590-15180-1-git-send-email-yong.liu-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2015-03-11 15:03 ` Thomas Monjalon
-- strict thread matches above, loose matches on Subject: below --
2015-03-19 3:16 [PATCH 0/6] fix build warnings and errors in SUSE11 SP3 Yong Liu
[not found] ` <1426735018-19411-1-git-send-email-yong.liu-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2015-03-19 3:16 ` [PATCH] app/test-pmd: fix incorrect port number check Yong Liu
[not found] ` <1426735018-19411-2-git-send-email-yong.liu-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
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).