X-Git-Url: http://git.droids-corp.org/?p=dpdk.git;a=blobdiff_plain;f=examples%2Ffips_validation%2Fmain.c;h=08a1b9c6dcc3bb2c5dbd809642a6a01d8bb448ff;hp=efd32a86a5b6e64f52412a87d83a0a248d2d25bc;hb=d659460a17afa28d4c7a37d492df47ab3ac542c7;hpb=9339a1ec6102e4e018abdc5bc844f617185c1baf diff --git a/examples/fips_validation/main.c b/examples/fips_validation/main.c index efd32a86a5..08a1b9c6dc 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);