patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Raslan Darawsheh <rasland@nvidia.com>
To: <dev@dpdk.org>
Cc: <wisamm@nvidia.com>, <stable@dpdk.org>
Subject: [PATCH] app/flow-perf: report invalid parameters
Date: Thu, 11 Nov 2021 14:50:30 +0200	[thread overview]
Message-ID: <20211111125032.29087-1-rasland@nvidia.com> (raw)

Currently, there is no check if an invalid parameter is passed
to the application.
for example:
	./dpdk-test-flow-perf -a 01:00.0 -- --invalid

This validate that all strings are part of the known options.

Fixes: 3344cf2e3001 ("app/flow-perf: add flow performance skeleton")
Cc: wisamm@nvidia.com
Cc: stable@dpdk.org

Signed-off-by: Raslan Darawsheh <rasland@nvidia.com>
---
 app/test-flow-perf/main.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/app/test-flow-perf/main.c b/app/test-flow-perf/main.c
index c1477b14a1..7453cf2b78 100644
--- a/app/test-flow-perf/main.c
+++ b/app/test-flow-perf/main.c
@@ -885,6 +885,13 @@ args_parse(int argc, char **argv)
 			break;
 		}
 	}
+
+	if (opt_idx != argc) {
+		usage(argv[0]);
+		rte_exit(EXIT_FAILURE,
+			 "Incorrect command line %s\n", argv[opt_idx]);
+	}
+
 	if (rules_count % rules_batch != 0) {
 		rte_exit(EXIT_FAILURE,
 			 "rules_count %% rules_batch should be 0\n");
-- 
2.25.1


             reply	other threads:[~2021-11-11 12:50 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-11 12:50 Raslan Darawsheh [this message]
2021-11-16 14:12 ` [PATCH v2] app/flow-perf: add missing default option Raslan Darawsheh
2021-11-16 14:18   ` Wisam Monther
2021-11-17  9:49     ` Thomas Monjalon

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=20211111125032.29087-1-rasland@nvidia.com \
    --to=rasland@nvidia.com \
    --cc=dev@dpdk.org \
    --cc=stable@dpdk.org \
    --cc=wisamm@nvidia.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).