From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: Re: [PATCH] app/test-pmd: fix incorrect port number check Date: Thu, 19 Mar 2015 09:40:28 +0100 Message-ID: <6456552.u7TssYRrzX@xps13> References: <1426735018-19411-1-git-send-email-yong.liu@intel.com> <1426735018-19411-2-git-send-email-yong.liu@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Cc: dev-VfR2kkLFssw@public.gmane.org To: Yong Liu Return-path: In-Reply-To: <1426735018-19411-2-git-send-email-yong.liu-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces-VfR2kkLFssw@public.gmane.org Sender: "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 > > 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, >