DPDK patches and discussions
 help / color / mirror / Atom feed
From: Pablo de Lara <pablo.de.lara.guarch@intel.com>
To: declan.doherty@intel.com
Cc: dev@dpdk.org, Pablo de Lara <pablo.de.lara.guarch@intel.com>
Subject: [dpdk-dev] [PATCH] app/crypto-perf: add help option
Date: Wed, 11 Oct 2017 01:29:11 +0100	[thread overview]
Message-ID: <20171011002911.4676-1-pablo.de.lara.guarch@intel.com> (raw)

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
---
 app/test-crypto-perf/cperf_options_parsing.c | 49 ++++++++++++++++++++++++++--
 1 file changed, 47 insertions(+), 2 deletions(-)

diff --git a/app/test-crypto-perf/cperf_options_parsing.c b/app/test-crypto-perf/cperf_options_parsing.c
index 72c515a..ad43e84 100644
--- a/app/test-crypto-perf/cperf_options_parsing.c
+++ b/app/test-crypto-perf/cperf_options_parsing.c
@@ -46,6 +46,47 @@ struct name_id_map {
 	uint32_t id;
 };
 
+static void
+usage(char *progname)
+{
+	printf("%s [EAL options] --\n"
+		" --silent: disable options dump\n"
+		" --ptest throughput / latency / verify / pmd-cycleount :"
+		" set test type\n"
+		" --pool_sz N: set the number of crypto ops/mbufs allocated\n"
+		" --total-ops N: set the number of total operations performed\n"
+		" --burst-sz N: set the number of packets per burst\n"
+		" --buffer-sz N: set the size of a single packet\n"
+		" --segment-sz N: set the size of the segment to use\n"
+		" --desc-nb N: set number of descriptors for each crypto device\n"
+		" --devtype TYPE: set crypto device type to use\n"
+		" --optype cipher-only / auth-only / cipher-then-auth /\n"
+		"           auth-then-cipher / aead : set operation type\n"
+		" --sessionless: enable session-less crypto operations\n"
+		" --out-of-place: enable out-of-place crypto operations\n"
+		" --test-file NAME: set the test vector file path\n"
+		" --test-name NAME: set specific test name section in test file\n"
+		" --cipher-algo ALGO: set cipher algorithm\n"
+		" --cipher-op encrypt / decrypt: set the cipher operation\n"
+		" --cipher-key-sz N: set the cipher key size\n"
+		" --cipher-iv-sz N: set the cipher IV size\n"
+		" --auth-algo ALGO: set auth algorithm\n"
+		" --auth-op generate / verify: set the auth operation\n"
+		" --auth-key-sz N: set the auth key size\n"
+		" --auth-iv-sz N: set the auth IV size\n"
+		" --aead-algo ALGO: set AEAD algorithm\n"
+		" --aead-op encrypt / decrypt: set the AEAD operation\n"
+		" --aead-key-sz N: set the AEAD key size\n"
+		" --aead-iv-sz N: set the AEAD IV size\n"
+		" --aead-aad-sz N: set the AEAD AAD size\n"
+		" --digest-sz N: set the digest size\n"
+		" --pmd-cyclecount-delay-ms N: set delay between enqueue\n"
+		"           and dequeue in pmd-cyclecount benchmarking mode\n"
+		" --csv-friendly: enable test result output CSV friendly\n"
+		" -h: prints this help\n",
+		progname);
+}
+
 static int
 get_str_key_id_mapping(struct name_id_map *map, unsigned int map_len,
 		const char *str_key)
@@ -829,11 +870,14 @@ cperf_options_parse(struct cperf_options *options, int argc, char **argv)
 {
 	int opt, retval, opt_idx;
 
-	while ((opt = getopt_long(argc, argv, "", lgopts, &opt_idx)) != EOF) {
+	while ((opt = getopt_long(argc, argv, "h", lgopts, &opt_idx)) != EOF) {
 		switch (opt) {
+		case 'h':
+			usage(argv[0]);
+			rte_exit(EXIT_SUCCESS, "Displayed help\n");
+			break;
 		/* long options */
 		case 0:
-
 			retval = cperf_opts_parse_long(opt_idx, options);
 			if (retval != 0)
 				return retval;
@@ -841,6 +885,7 @@ cperf_options_parse(struct cperf_options *options, int argc, char **argv)
 			break;
 
 		default:
+			usage(argv[0]);
 			return -EINVAL;
 		}
 	}
-- 
2.9.4

             reply	other threads:[~2017-10-11  8:28 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-11  0:29 Pablo de Lara [this message]
2017-11-06 11:56 ` Zhang, Roy Fan
2017-11-07 16:59   ` 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=20171011002911.4676-1-pablo.de.lara.guarch@intel.com \
    --to=pablo.de.lara.guarch@intel.com \
    --cc=declan.doherty@intel.com \
    --cc=dev@dpdk.org \
    /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).