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 <yong.liu@intel.com>
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
This commit is contained in:
Yong Liu 2015-03-11 15:23:10 +08:00 committed by Thomas Monjalon
parent efa2084a84
commit 0a530f0d58

View File

@ -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,