From: Yong Liu Date: Wed, 11 Mar 2015 07:23:10 +0000 (+0800) Subject: app/testpmd: fix incorrect port number check X-Git-Tag: spdx-start~9440 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=0a530f0d58b0304d3f7515bb14f81fd2b6e6931e;p=dpdk.git app/testpmd: fix incorrect port number check 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. Fixes: edab33b1c01d ("app/testpmd: support port hotplug") Signed-off-by: Yong Liu Acked-by: Thomas Monjalon --- diff --git a/app/test-pmd/parameters.c b/app/test-pmd/parameters.c index 11d9af09b6..f1daa6eca3 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,