4 * Copyright(c) 2016-2017 Intel Corporation. All rights reserved.
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
10 * * Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 * * Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in
14 * the documentation and/or other materials provided with the
16 * * Neither the name of Intel Corporation nor the names of its
17 * contributors may be used to endorse or promote products derived
18 * from this software without specific prior written permission.
20 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
23 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
24 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
25 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
26 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36 #include <rte_malloc.h>
38 #include "cperf_options.h"
46 get_str_key_id_mapping(struct name_id_map *map, unsigned int map_len,
51 for (i = 0; i < map_len; i++) {
53 if (strcmp(str_key, map[i].name) == 0)
61 parse_cperf_test_type(struct cperf_options *opts, const char *arg)
63 struct name_id_map cperftest_namemap[] = {
65 cperf_test_type_strs[CPERF_TEST_TYPE_THROUGHPUT],
66 CPERF_TEST_TYPE_THROUGHPUT
69 cperf_test_type_strs[CPERF_TEST_TYPE_CYCLECOUNT],
70 CPERF_TEST_TYPE_CYCLECOUNT
73 cperf_test_type_strs[CPERF_TEST_TYPE_LATENCY],
74 CPERF_TEST_TYPE_LATENCY
78 int id = get_str_key_id_mapping(
79 (struct name_id_map *)cperftest_namemap,
80 RTE_DIM(cperftest_namemap), arg);
82 RTE_LOG(ERR, USER1, "failed to parse test type");
86 opts->test = (enum cperf_perf_test_type)id;
92 parse_uint32_t(uint32_t *value, const char *arg)
95 unsigned long n = strtoul(arg, &end, 10);
97 if ((optarg[0] == '\0') || (end == NULL) || (*end != '\0'))
103 *value = (uint32_t) n;
109 parse_uint16_t(uint16_t *value, const char *arg)
112 int ret = parse_uint32_t(&val, arg);
117 if (val > UINT16_MAX)
120 *value = (uint16_t) val;
126 parse_total_ops(struct cperf_options *opts, const char *arg)
128 int ret = parse_uint32_t(&opts->total_ops, arg);
131 RTE_LOG(ERR, USER1, "failed to parse total operations count");
137 parse_pool_sz(struct cperf_options *opts, const char *arg)
139 int ret = parse_uint32_t(&opts->pool_sz, arg);
142 RTE_LOG(ERR, USER1, "failed to parse pool size");
147 parse_burst_sz(struct cperf_options *opts, const char *arg)
149 int ret = parse_uint32_t(&opts->burst_sz, arg);
152 RTE_LOG(ERR, USER1, "failed to parse burst size");
157 parse_buffer_sz(struct cperf_options *opts, const char *arg)
159 uint32_t i, valid_buf_sz[] = {
160 32, 64, 128, 256, 384, 512, 768, 1024, 1280, 1536, 1792,
164 if (parse_uint32_t(&opts->buffer_sz, arg)) {
165 RTE_LOG(ERR, USER1, "failed to parse buffer size");
169 for (i = 0; i < RTE_DIM(valid_buf_sz); i++)
170 if (valid_buf_sz[i] == opts->buffer_sz)
173 RTE_LOG(ERR, USER1, "invalid buffer size specified");
178 parse_segments_nb(struct cperf_options *opts, const char *arg)
180 int ret = parse_uint32_t(&opts->segments_nb, arg);
183 RTE_LOG(ERR, USER1, "failed to parse segments number\n");
187 if ((opts->segments_nb == 0) || (opts->segments_nb > 255)) {
188 RTE_LOG(ERR, USER1, "invalid segments number specified\n");
196 parse_device_type(struct cperf_options *opts, const char *arg)
198 if (strlen(arg) > (sizeof(opts->device_type) - 1))
201 strncpy(opts->device_type, arg, sizeof(opts->device_type) - 1);
202 *(opts->device_type + sizeof(opts->device_type) - 1) = '\0';
208 parse_op_type(struct cperf_options *opts, const char *arg)
210 struct name_id_map optype_namemap[] = {
212 cperf_op_type_strs[CPERF_CIPHER_ONLY],
216 cperf_op_type_strs[CPERF_AUTH_ONLY],
220 cperf_op_type_strs[CPERF_CIPHER_THEN_AUTH],
221 CPERF_CIPHER_THEN_AUTH
224 cperf_op_type_strs[CPERF_AUTH_THEN_CIPHER],
225 CPERF_AUTH_THEN_CIPHER
228 cperf_op_type_strs[CPERF_AEAD],
233 int id = get_str_key_id_mapping(optype_namemap,
234 RTE_DIM(optype_namemap), arg);
236 RTE_LOG(ERR, USER1, "invalid opt type specified\n");
240 opts->op_type = (enum cperf_op_type)id;
246 parse_sessionless(struct cperf_options *opts,
247 const char *arg __rte_unused)
249 opts->sessionless = 1;
254 parse_out_of_place(struct cperf_options *opts,
255 const char *arg __rte_unused)
257 opts->out_of_place = 1;
262 parse_verify(struct cperf_options *opts,
263 const char *arg __rte_unused)
271 parse_test_file(struct cperf_options *opts,
274 opts->test_file = strdup(arg);
275 if (access(opts->test_file, F_OK) != -1)
277 RTE_LOG(ERR, USER1, "Test vector file doesn't exist\n");
283 parse_test_name(struct cperf_options *opts,
286 char *test_name = (char *) rte_zmalloc(NULL,
287 sizeof(char) * (strlen(arg) + 3), 0);
288 snprintf(test_name, strlen(arg) + 3, "[%s]", arg);
289 opts->test_name = test_name;
295 parse_silent(struct cperf_options *opts,
296 const char *arg __rte_unused)
304 parse_cipher_algo(struct cperf_options *opts, const char *arg)
306 struct name_id_map cipher_algo_namemap[] = {
308 rte_crypto_cipher_algorithm_strings
309 [RTE_CRYPTO_CIPHER_3DES_CBC],
310 RTE_CRYPTO_CIPHER_3DES_CBC
313 rte_crypto_cipher_algorithm_strings
314 [RTE_CRYPTO_CIPHER_3DES_ECB],
315 RTE_CRYPTO_CIPHER_3DES_ECB
318 rte_crypto_cipher_algorithm_strings
319 [RTE_CRYPTO_CIPHER_3DES_CTR],
320 RTE_CRYPTO_CIPHER_3DES_CTR
323 rte_crypto_cipher_algorithm_strings
324 [RTE_CRYPTO_CIPHER_AES_CBC],
325 RTE_CRYPTO_CIPHER_AES_CBC
328 rte_crypto_cipher_algorithm_strings
329 [RTE_CRYPTO_CIPHER_AES_CCM],
330 RTE_CRYPTO_CIPHER_AES_CCM
333 rte_crypto_cipher_algorithm_strings
334 [RTE_CRYPTO_CIPHER_AES_CTR],
335 RTE_CRYPTO_CIPHER_AES_CTR
338 rte_crypto_cipher_algorithm_strings
339 [RTE_CRYPTO_CIPHER_AES_ECB],
340 RTE_CRYPTO_CIPHER_AES_ECB
343 rte_crypto_cipher_algorithm_strings
344 [RTE_CRYPTO_CIPHER_AES_GCM],
345 RTE_CRYPTO_CIPHER_AES_GCM
348 rte_crypto_cipher_algorithm_strings
349 [RTE_CRYPTO_CIPHER_AES_F8],
350 RTE_CRYPTO_CIPHER_AES_F8
353 rte_crypto_cipher_algorithm_strings
354 [RTE_CRYPTO_CIPHER_AES_XTS],
355 RTE_CRYPTO_CIPHER_AES_XTS
358 rte_crypto_cipher_algorithm_strings
359 [RTE_CRYPTO_CIPHER_ARC4],
360 RTE_CRYPTO_CIPHER_ARC4
363 rte_crypto_cipher_algorithm_strings
364 [RTE_CRYPTO_CIPHER_NULL],
365 RTE_CRYPTO_CIPHER_NULL
368 rte_crypto_cipher_algorithm_strings
369 [RTE_CRYPTO_CIPHER_KASUMI_F8],
370 RTE_CRYPTO_CIPHER_KASUMI_F8
373 rte_crypto_cipher_algorithm_strings
374 [RTE_CRYPTO_CIPHER_SNOW3G_UEA2],
375 RTE_CRYPTO_CIPHER_SNOW3G_UEA2
378 rte_crypto_cipher_algorithm_strings
379 [RTE_CRYPTO_CIPHER_ZUC_EEA3],
380 RTE_CRYPTO_CIPHER_ZUC_EEA3
385 int id = get_str_key_id_mapping(cipher_algo_namemap,
386 RTE_DIM(cipher_algo_namemap), arg);
388 RTE_LOG(ERR, USER1, "Invalid cipher algorithm specified\n");
392 opts->cipher_algo = (enum rte_crypto_cipher_algorithm)id;
398 parse_cipher_op(struct cperf_options *opts, const char *arg)
400 struct name_id_map cipher_op_namemap[] = {
402 rte_crypto_cipher_operation_strings
403 [RTE_CRYPTO_CIPHER_OP_ENCRYPT],
404 RTE_CRYPTO_CIPHER_OP_ENCRYPT },
406 rte_crypto_cipher_operation_strings
407 [RTE_CRYPTO_CIPHER_OP_DECRYPT],
408 RTE_CRYPTO_CIPHER_OP_DECRYPT
412 int id = get_str_key_id_mapping(cipher_op_namemap,
413 RTE_DIM(cipher_op_namemap), arg);
415 RTE_LOG(ERR, USER1, "Invalid cipher operation specified\n");
419 opts->cipher_op = (enum rte_crypto_cipher_operation)id;
425 parse_cipher_key_sz(struct cperf_options *opts, const char *arg)
427 return parse_uint16_t(&opts->cipher_key_sz, arg);
431 parse_cipher_iv_sz(struct cperf_options *opts, const char *arg)
433 return parse_uint16_t(&opts->cipher_iv_sz, arg);
437 parse_auth_algo(struct cperf_options *opts, const char *arg) {
438 struct name_id_map cipher_auth_namemap[] = {
440 rte_crypto_auth_algorithm_strings
441 [RTE_CRYPTO_AUTH_AES_CBC_MAC],
442 RTE_CRYPTO_AUTH_AES_CBC_MAC
445 rte_crypto_auth_algorithm_strings
446 [RTE_CRYPTO_AUTH_AES_CCM],
447 RTE_CRYPTO_AUTH_AES_CCM
450 rte_crypto_auth_algorithm_strings
451 [RTE_CRYPTO_AUTH_AES_CMAC],
452 RTE_CRYPTO_AUTH_AES_CMAC
455 rte_crypto_auth_algorithm_strings
456 [RTE_CRYPTO_AUTH_AES_GCM],
457 RTE_CRYPTO_AUTH_AES_GCM
460 rte_crypto_auth_algorithm_strings
461 [RTE_CRYPTO_AUTH_AES_GMAC],
462 RTE_CRYPTO_AUTH_AES_GMAC
465 rte_crypto_auth_algorithm_strings
466 [RTE_CRYPTO_AUTH_AES_XCBC_MAC],
467 RTE_CRYPTO_AUTH_AES_XCBC_MAC
470 rte_crypto_auth_algorithm_strings
471 [RTE_CRYPTO_AUTH_MD5],
475 rte_crypto_auth_algorithm_strings
476 [RTE_CRYPTO_AUTH_MD5_HMAC],
477 RTE_CRYPTO_AUTH_MD5_HMAC
480 rte_crypto_auth_algorithm_strings
481 [RTE_CRYPTO_AUTH_SHA1],
485 rte_crypto_auth_algorithm_strings
486 [RTE_CRYPTO_AUTH_SHA1_HMAC],
487 RTE_CRYPTO_AUTH_SHA1_HMAC
490 rte_crypto_auth_algorithm_strings
491 [RTE_CRYPTO_AUTH_SHA224],
492 RTE_CRYPTO_AUTH_SHA224
495 rte_crypto_auth_algorithm_strings
496 [RTE_CRYPTO_AUTH_SHA224_HMAC],
497 RTE_CRYPTO_AUTH_SHA224_HMAC
500 rte_crypto_auth_algorithm_strings
501 [RTE_CRYPTO_AUTH_SHA256],
502 RTE_CRYPTO_AUTH_SHA256
505 rte_crypto_auth_algorithm_strings
506 [RTE_CRYPTO_AUTH_SHA256_HMAC],
507 RTE_CRYPTO_AUTH_SHA256_HMAC
510 rte_crypto_auth_algorithm_strings
511 [RTE_CRYPTO_AUTH_SHA384],
512 RTE_CRYPTO_AUTH_SHA384
515 rte_crypto_auth_algorithm_strings
516 [RTE_CRYPTO_AUTH_SHA384_HMAC],
517 RTE_CRYPTO_AUTH_SHA384_HMAC
520 rte_crypto_auth_algorithm_strings
521 [RTE_CRYPTO_AUTH_SHA512],
522 RTE_CRYPTO_AUTH_SHA512
525 rte_crypto_auth_algorithm_strings
526 [RTE_CRYPTO_AUTH_SHA512_HMAC],
527 RTE_CRYPTO_AUTH_SHA512_HMAC
530 rte_crypto_auth_algorithm_strings
531 [RTE_CRYPTO_AUTH_KASUMI_F9],
532 RTE_CRYPTO_AUTH_KASUMI_F9
535 rte_crypto_auth_algorithm_strings
536 [RTE_CRYPTO_AUTH_SNOW3G_UIA2],
537 RTE_CRYPTO_AUTH_SNOW3G_UIA2
540 rte_crypto_auth_algorithm_strings
541 [RTE_CRYPTO_AUTH_ZUC_EIA3],
542 RTE_CRYPTO_AUTH_ZUC_EIA3
547 int id = get_str_key_id_mapping(cipher_auth_namemap,
548 RTE_DIM(cipher_auth_namemap), arg);
550 RTE_LOG(ERR, USER1, "invalid authentication algorithm specified"
555 opts->auth_algo = (enum rte_crypto_auth_algorithm)id;
561 parse_auth_op(struct cperf_options *opts, const char *arg)
563 struct name_id_map auth_op_namemap[] = {
565 rte_crypto_auth_operation_strings
566 [RTE_CRYPTO_AUTH_OP_GENERATE],
567 RTE_CRYPTO_AUTH_OP_GENERATE },
569 rte_crypto_auth_operation_strings
570 [RTE_CRYPTO_AUTH_OP_VERIFY],
571 RTE_CRYPTO_AUTH_OP_VERIFY
575 int id = get_str_key_id_mapping(auth_op_namemap,
576 RTE_DIM(auth_op_namemap), arg);
578 RTE_LOG(ERR, USER1, "invalid authentication operation specified"
583 opts->auth_op = (enum rte_crypto_auth_operation)id;
589 parse_auth_key_sz(struct cperf_options *opts, const char *arg)
591 return parse_uint16_t(&opts->auth_key_sz, arg);
595 parse_auth_digest_sz(struct cperf_options *opts, const char *arg)
597 return parse_uint16_t(&opts->auth_digest_sz, arg);
601 parse_auth_aad_sz(struct cperf_options *opts, const char *arg)
603 return parse_uint16_t(&opts->auth_aad_sz, arg);
607 parse_csv_friendly(struct cperf_options *opts, const char *arg __rte_unused)
614 typedef int (*option_parser_t)(struct cperf_options *opts,
617 struct long_opt_parser {
618 const char *lgopt_name;
619 option_parser_t parser_fn;
623 static struct option lgopts[] = {
625 { CPERF_PTEST_TYPE, required_argument, 0, 0 },
627 { CPERF_POOL_SIZE, required_argument, 0, 0 },
628 { CPERF_TOTAL_OPS, required_argument, 0, 0 },
629 { CPERF_BURST_SIZE, required_argument, 0, 0 },
630 { CPERF_BUFFER_SIZE, required_argument, 0, 0 },
631 { CPERF_SEGMENTS_NB, required_argument, 0, 0 },
633 { CPERF_DEVTYPE, required_argument, 0, 0 },
634 { CPERF_OPTYPE, required_argument, 0, 0 },
636 { CPERF_SILENT, no_argument, 0, 0 },
637 { CPERF_SESSIONLESS, no_argument, 0, 0 },
638 { CPERF_OUT_OF_PLACE, no_argument, 0, 0 },
639 { CPERF_VERIFY, no_argument, 0, 0 },
640 { CPERF_TEST_FILE, required_argument, 0, 0 },
641 { CPERF_TEST_NAME, required_argument, 0, 0 },
643 { CPERF_CIPHER_ALGO, required_argument, 0, 0 },
644 { CPERF_CIPHER_OP, required_argument, 0, 0 },
646 { CPERF_CIPHER_KEY_SZ, required_argument, 0, 0 },
647 { CPERF_CIPHER_IV_SZ, required_argument, 0, 0 },
649 { CPERF_AUTH_ALGO, required_argument, 0, 0 },
650 { CPERF_AUTH_OP, required_argument, 0, 0 },
652 { CPERF_AUTH_KEY_SZ, required_argument, 0, 0 },
653 { CPERF_AUTH_DIGEST_SZ, required_argument, 0, 0 },
654 { CPERF_AUTH_AAD_SZ, required_argument, 0, 0 },
655 { CPERF_CSV, no_argument, 0, 0},
661 cperf_options_default(struct cperf_options *opts)
663 opts->test = CPERF_TEST_TYPE_THROUGHPUT;
665 opts->pool_sz = 8192;
666 opts->total_ops = 10000000;
668 opts->buffer_sz = 64;
669 opts->segments_nb = 1;
671 strncpy(opts->device_type, "crypto_aesni_mb",
672 sizeof(opts->device_type));
674 opts->op_type = CPERF_CIPHER_THEN_AUTH;
678 opts->test_file = NULL;
679 opts->test_name = NULL;
680 opts->sessionless = 0;
681 opts->out_of_place = 0;
684 opts->cipher_algo = RTE_CRYPTO_CIPHER_AES_CBC;
685 opts->cipher_op = RTE_CRYPTO_CIPHER_OP_ENCRYPT;
686 opts->cipher_key_sz = 16;
687 opts->cipher_iv_sz = 16;
689 opts->auth_algo = RTE_CRYPTO_AUTH_SHA1_HMAC;
690 opts->auth_op = RTE_CRYPTO_AUTH_OP_GENERATE;
692 opts->auth_key_sz = 64;
693 opts->auth_digest_sz = 12;
694 opts->auth_aad_sz = 0;
698 cperf_opts_parse_long(int opt_idx, struct cperf_options *opts)
700 struct long_opt_parser parsermap[] = {
701 { CPERF_PTEST_TYPE, parse_cperf_test_type },
702 { CPERF_SILENT, parse_silent },
703 { CPERF_POOL_SIZE, parse_pool_sz },
704 { CPERF_TOTAL_OPS, parse_total_ops },
705 { CPERF_BURST_SIZE, parse_burst_sz },
706 { CPERF_BUFFER_SIZE, parse_buffer_sz },
707 { CPERF_SEGMENTS_NB, parse_segments_nb },
708 { CPERF_DEVTYPE, parse_device_type },
709 { CPERF_OPTYPE, parse_op_type },
710 { CPERF_SESSIONLESS, parse_sessionless },
711 { CPERF_OUT_OF_PLACE, parse_out_of_place },
712 { CPERF_VERIFY, parse_verify },
713 { CPERF_TEST_FILE, parse_test_file },
714 { CPERF_TEST_NAME, parse_test_name },
715 { CPERF_CIPHER_ALGO, parse_cipher_algo },
716 { CPERF_CIPHER_OP, parse_cipher_op },
717 { CPERF_CIPHER_KEY_SZ, parse_cipher_key_sz },
718 { CPERF_CIPHER_IV_SZ, parse_cipher_iv_sz },
719 { CPERF_AUTH_ALGO, parse_auth_algo },
720 { CPERF_AUTH_OP, parse_auth_op },
721 { CPERF_AUTH_KEY_SZ, parse_auth_key_sz },
722 { CPERF_AUTH_DIGEST_SZ, parse_auth_digest_sz },
723 { CPERF_AUTH_AAD_SZ, parse_auth_aad_sz },
724 { CPERF_CSV, parse_csv_friendly},
728 for (i = 0; i < RTE_DIM(parsermap); i++) {
729 if (strncmp(lgopts[opt_idx].name, parsermap[i].lgopt_name,
730 strlen(lgopts[opt_idx].name)) == 0)
731 return parsermap[i].parser_fn(opts, optarg);
738 cperf_options_parse(struct cperf_options *options, int argc, char **argv)
740 int opt, retval, opt_idx;
742 while ((opt = getopt_long(argc, argv, "", lgopts, &opt_idx)) != EOF) {
747 retval = cperf_opts_parse_long(opt_idx, options);
762 cperf_options_check(struct cperf_options *options)
764 if (options->segments_nb > options->buffer_sz) {
766 "Segments number greater than buffer size.\n");
770 if (options->verify && options->test_file == NULL) {
771 RTE_LOG(ERR, USER1, "Define path to the file with test"
776 if (options->test_name != NULL && options->test_file == NULL) {
777 RTE_LOG(ERR, USER1, "Define path to the file with test"
782 if (options->auth_op == RTE_CRYPTO_AUTH_OP_VERIFY &&
783 options->test_file == NULL) {
784 RTE_LOG(ERR, USER1, "Define path to the file with test"
789 if (options->verify &&
790 options->total_ops > options->pool_sz) {
791 RTE_LOG(ERR, USER1, "Total number of ops must be less than or"
792 " equal to the pool size.\n");
796 if (options->op_type == CPERF_CIPHER_THEN_AUTH) {
797 if (options->cipher_op != RTE_CRYPTO_CIPHER_OP_ENCRYPT &&
799 RTE_CRYPTO_AUTH_OP_GENERATE) {
800 RTE_LOG(ERR, USER1, "Option cipher then auth must use"
801 " options: encrypt and generate.\n");
804 } else if (options->op_type == CPERF_AUTH_THEN_CIPHER) {
805 if (options->cipher_op != RTE_CRYPTO_CIPHER_OP_DECRYPT &&
807 RTE_CRYPTO_AUTH_OP_VERIFY) {
808 RTE_LOG(ERR, USER1, "Option auth then cipher must use"
809 " options: decrypt and verify.\n");
812 } else if (options->op_type == CPERF_AEAD) {
813 if (!(options->cipher_op == RTE_CRYPTO_CIPHER_OP_ENCRYPT &&
815 RTE_CRYPTO_AUTH_OP_GENERATE) &&
816 !(options->cipher_op ==
817 RTE_CRYPTO_CIPHER_OP_DECRYPT &&
819 RTE_CRYPTO_AUTH_OP_VERIFY)) {
820 RTE_LOG(ERR, USER1, "Use together options: encrypt and"
821 " generate or decrypt and verify.\n");
830 cperf_options_dump(struct cperf_options *opts)
832 printf("# Crypto Performance Application Options:\n");
834 printf("# cperf test: %s\n", cperf_test_type_strs[opts->test]);
836 printf("# size of crypto op / mbuf pool: %u\n", opts->pool_sz);
837 printf("# total number of ops: %u\n", opts->total_ops);
838 printf("# burst size: %u\n", opts->burst_sz);
839 printf("# buffer size: %u\n", opts->buffer_sz);
840 printf("# segments per buffer: %u\n", opts->segments_nb);
842 printf("# cryptodev type: %s\n", opts->device_type);
844 printf("# crypto operation: %s\n", cperf_op_type_strs[opts->op_type]);
845 printf("# verify operation: %s\n", opts->verify ? "yes" : "no");
846 printf("# sessionless: %s\n", opts->sessionless ? "yes" : "no");
847 printf("# out of place: %s\n", opts->out_of_place ? "yes" : "no");
851 if (opts->op_type == CPERF_AUTH_ONLY ||
852 opts->op_type == CPERF_CIPHER_THEN_AUTH ||
853 opts->op_type == CPERF_AUTH_THEN_CIPHER ||
854 opts->op_type == CPERF_AEAD) {
855 printf("# auth algorithm: %s\n",
856 rte_crypto_auth_algorithm_strings[opts->auth_algo]);
857 printf("# auth operation: %s\n",
858 rte_crypto_auth_operation_strings[opts->auth_op]);
859 printf("# auth key size: %u\n", opts->auth_key_sz);
860 printf("# auth digest size: %u\n", opts->auth_digest_sz);
861 printf("# auth aad size: %u\n", opts->auth_aad_sz);
865 if (opts->op_type == CPERF_CIPHER_ONLY ||
866 opts->op_type == CPERF_CIPHER_THEN_AUTH ||
867 opts->op_type == CPERF_AUTH_THEN_CIPHER ||
868 opts->op_type == CPERF_AEAD) {
869 printf("# cipher algorithm: %s\n",
870 rte_crypto_cipher_algorithm_strings[opts->cipher_algo]);
871 printf("# cipher operation: %s\n",
872 rte_crypto_cipher_operation_strings[opts->cipher_op]);
873 printf("# cipher key size: %u\n", opts->cipher_key_sz);
874 printf("# cipher iv size: %u\n", opts->cipher_iv_sz);