Checking the number of rxq/txq in the middle of option parsing is confusing. Besides, a check on nb_rxq / nb_txq check already exists after option parsing. Only keep this latter check and make testpmd quit in this case.
Signed-off-by: David Marchand <david.march...@redhat.com> --- Changes since v1: - moved the check and termination out of argument parsing, --- app/test-pmd/parameters.c | 4 ---- app/test-pmd/testpmd.c | 3 +-- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/app/test-pmd/parameters.c b/app/test-pmd/parameters.c index a4c09e2a2b..fc5cf3a195 100644 --- a/app/test-pmd/parameters.c +++ b/app/test-pmd/parameters.c @@ -1098,10 +1098,6 @@ launch_args_parse(int argc, char** argv) n + nb_rxq, get_allowed_max_nb_rxq(&pid)); } - if (!nb_rxq && !nb_txq) { - rte_exit(EXIT_FAILURE, "Either rx or tx queues should " - "be non-zero\n"); - } if (!strcmp(lgopts[opt_idx].name, "hairpin-mode")) { char *end = NULL; unsigned int n; diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c index 9e4e99e53b..81d905d759 100644 --- a/app/test-pmd/testpmd.c +++ b/app/test-pmd/testpmd.c @@ -4619,8 +4619,7 @@ main(int argc, char** argv) } if (!nb_rxq && !nb_txq) - fprintf(stderr, - "Warning: Either rx or tx queues should be non-zero\n"); + rte_exit(EXIT_FAILURE, "Either rx or tx queues should be non-zero\n"); if (nb_rxq > 1 && nb_rxq > nb_txq) fprintf(stderr, -- 2.44.0