DPDK patches and discussions
 help / color / mirror / Atom feed
From: Olivier Matz <olivier.matz@6wind.com>
To: dev@dpdk.org
Cc: Marko Kovacevic <marko.kovacevic@intel.com>,
	Akhil Goyal <akhil.goyal@nxp.com>,
	Fan Zhang <roy.fan.zhang@intel.com>,
	Arek Kusztal <arkadiuszx.kusztal@intel.com>
Subject: [dpdk-dev] [PATCH 3/3] examples/fips_validation: support self-test only
Date: Tue,  6 Oct 2020 09:41:43 +0200
Message-ID: <20201006074143.31691-4-olivier.matz@6wind.com> (raw)
In-Reply-To: <20201006074143.31691-1-olivier.matz@6wind.com>

Make it possible to pass the self-tests when no req path is set.

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
---
 examples/fips_validation/main.c | 22 ++++++++++++++++++++--
 1 file changed, 20 insertions(+), 2 deletions(-)

diff --git a/examples/fips_validation/main.c b/examples/fips_validation/main.c
index 0a1c8b568c..ee3a890e9e 100644
--- a/examples/fips_validation/main.c
+++ b/examples/fips_validation/main.c
@@ -315,8 +315,21 @@ cryptodev_fips_validate_parse_args(int argc, char **argv)
 		}
 	}
 
-	if (env.req_path == NULL || env.rsp_path == NULL ||
-			env.dev_id == UINT32_MAX) {
+	if (env.dev_id == UINT32_MAX) {
+		RTE_LOG(ERR, USER1, "No device specified\n");
+		cryptodev_fips_validate_usage(prgname);
+		return -EINVAL;
+	}
+
+	if ((env.req_path == NULL && env.rsp_path != NULL) ||
+			(env.req_path != NULL && env.rsp_path == NULL)) {
+		RTE_LOG(ERR, USER1, "Missing req path or rsp path\n");
+		cryptodev_fips_validate_usage(prgname);
+		return -EINVAL;
+	}
+
+	if (env.req_path == NULL && env.self_test == 0) {
+		RTE_LOG(ERR, USER1, "--self-test must be set if req path is missing\n");
 		cryptodev_fips_validate_usage(prgname);
 		return -EINVAL;
 	}
@@ -348,6 +361,11 @@ main(int argc, char *argv[])
 		return -1;
 	}
 
+	if (env.req_path == NULL || env.rsp_path == NULL) {
+		printf("No request, exit.\n");
+		goto exit;
+	}
+
 	if (!env.is_path_folder) {
 		printf("Processing file %s... ", env.req_path);
 
-- 
2.25.1


  parent reply	other threads:[~2020-10-06  7:42 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-06  7:41 [dpdk-dev] [PATCH 0/3] examples/fips_validation: misc fixes Olivier Matz
2020-10-06  7:41 ` [dpdk-dev] [PATCH 1/3] examples/fips_validation: fix buffer overflow Olivier Matz
2020-10-06  8:48   ` Zhang, Roy Fan
2020-10-06  7:41 ` [dpdk-dev] [PATCH 2/3] examples/fips_validation: ignore \r in input files Olivier Matz
2020-10-06  8:47   ` Zhang, Roy Fan
2020-10-06 10:09     ` Olivier Matz
2020-10-08  8:50       ` Zhang, Roy Fan
2020-10-08  9:21         ` Olivier Matz
2020-10-08 10:24           ` Zhang, Roy Fan
2020-10-08 11:32             ` Olivier Matz
2020-10-08 12:41               ` Zhang, Roy Fan
2020-10-08 14:19                 ` Olivier Matz
2020-10-09  9:33                   ` Zhang, Roy Fan
2020-10-09 18:19                     ` Akhil Goyal
2020-10-06  7:41 ` Olivier Matz [this message]
2020-10-06  8:55   ` [dpdk-dev] [PATCH 3/3] examples/fips_validation: support self-test only Zhang, Roy Fan

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=20201006074143.31691-4-olivier.matz@6wind.com \
    --to=olivier.matz@6wind.com \
    --cc=akhil.goyal@nxp.com \
    --cc=arkadiuszx.kusztal@intel.com \
    --cc=dev@dpdk.org \
    --cc=marko.kovacevic@intel.com \
    --cc=roy.fan.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

DPDK patches and discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://inbox.dpdk.org/dev/0 dev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dev dev/ https://inbox.dpdk.org/dev \
		dev@dpdk.org
	public-inbox-index dev

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.dev


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git