All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Marchand <david.marchand@redhat.com>
To: dev@dpdk.org
Cc: Aman Singh <aman.deep.singh@intel.com>,
	Yuying Zhang <yuying.zhang@intel.com>
Subject: [PATCH v2 4/6] app/testpmd: enhance queue count check
Date: Thu, 14 Mar 2024 10:17:05 +0100	[thread overview]
Message-ID: <20240314091708.1542769-5-david.marchand@redhat.com> (raw)
In-Reply-To: <20240314091708.1542769-1-david.marchand@redhat.com>

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.marchand@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


  parent reply	other threads:[~2024-03-14  9:17 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-08 14:48 [PATCH 0/4] testpmd options parsing cleanup David Marchand
2024-03-08 14:48 ` [PATCH 1/4] app/testpmd: fix stats-period option check David Marchand
2024-03-12 16:43   ` Ferruh Yigit
2024-03-08 14:48 ` [PATCH 2/4] app/testpmd: fix burst option parsing David Marchand
2024-03-12 16:47   ` Ferruh Yigit
2024-03-13  7:24     ` David Marchand
2024-03-13 10:37       ` Ferruh Yigit
2024-03-13 11:13         ` David Marchand
2024-03-13 12:09           ` Ferruh Yigit
2024-03-13 16:32             ` Stephen Hemminger
2024-03-08 14:48 ` [PATCH 3/4] app/testpmd: check queue count for related options David Marchand
2024-03-12 16:59   ` Ferruh Yigit
2024-03-13  7:37     ` David Marchand
2024-03-13 10:42       ` Ferruh Yigit
2024-03-13 11:10         ` David Marchand
2024-03-13 12:18           ` Ferruh Yigit
2024-03-08 14:48 ` [PATCH 4/4] app/testpmd: enhance getopt_long usage David Marchand
2024-03-12 17:03   ` Ferruh Yigit
2024-03-13 16:51     ` David Marchand
2024-03-13 17:20       ` David Marchand
2024-03-13 23:28         ` Ferruh Yigit
2024-03-13 23:28       ` Ferruh Yigit
2024-03-14  9:17 ` [PATCH v2 0/6] testpmd options parsing cleanup David Marchand
2024-03-14  9:17   ` [PATCH v2 1/6] app/testpmd: fix stats-period option check David Marchand
2024-03-14  9:17   ` [PATCH v2 2/6] app/testpmd: fix burst option parsing David Marchand
2024-03-14  9:22     ` Ferruh Yigit
2024-03-14  9:17   ` [PATCH v2 3/6] app/testpmd: fix error message for invalid option David Marchand
2024-03-14  9:23     ` Ferruh Yigit
2024-03-14  9:17   ` David Marchand [this message]
2024-03-14  9:23     ` [PATCH v2 4/6] app/testpmd: enhance queue count check Ferruh Yigit
2024-03-14  9:17   ` [PATCH v2 5/6] app/testpmd: remove dead code for disabling cmdline library David Marchand
2024-03-14 11:33     ` Ferruh Yigit
2024-03-14  9:17   ` [PATCH v2 6/6] app/testpmd: enhance getopt_long usage David Marchand
2024-03-14 11:43     ` Ferruh Yigit
2024-03-14 12:43   ` [PATCH v2 0/6] testpmd options parsing cleanup Ferruh Yigit

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240314091708.1542769-5-david.marchand@redhat.com \
    --to=david.marchand@redhat.com \
    --cc=aman.deep.singh@intel.com \
    --cc=dev@dpdk.org \
    --cc=yuying.zhang@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.