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_cryptodev.h>
37 #include <rte_malloc.h>
39 #include "cperf_options.h"
41 #define AES_BLOCK_SIZE 16
42 #define DES_BLOCK_SIZE 8
50 get_str_key_id_mapping(struct name_id_map *map, unsigned int map_len,
55 for (i = 0; i < map_len; i++) {
57 if (strcmp(str_key, map[i].name) == 0)
65 parse_cperf_test_type(struct cperf_options *opts, const char *arg)
67 struct name_id_map cperftest_namemap[] = {
69 cperf_test_type_strs[CPERF_TEST_TYPE_THROUGHPUT],
70 CPERF_TEST_TYPE_THROUGHPUT
73 cperf_test_type_strs[CPERF_TEST_TYPE_VERIFY],
74 CPERF_TEST_TYPE_VERIFY
77 cperf_test_type_strs[CPERF_TEST_TYPE_LATENCY],
78 CPERF_TEST_TYPE_LATENCY
82 int id = get_str_key_id_mapping(
83 (struct name_id_map *)cperftest_namemap,
84 RTE_DIM(cperftest_namemap), arg);
86 RTE_LOG(ERR, USER1, "failed to parse test type");
90 opts->test = (enum cperf_perf_test_type)id;
96 parse_uint32_t(uint32_t *value, const char *arg)
99 unsigned long n = strtoul(arg, &end, 10);
101 if ((optarg[0] == '\0') || (end == NULL) || (*end != '\0'))
107 *value = (uint32_t) n;
113 parse_uint16_t(uint16_t *value, const char *arg)
116 int ret = parse_uint32_t(&val, arg);
121 if (val > UINT16_MAX)
124 *value = (uint16_t) val;
130 parse_range(const char *arg, uint32_t *min, uint32_t *max, uint32_t *inc)
135 char *copy_arg = strdup(arg);
137 if (copy_arg == NULL)
141 token = strtok(copy_arg, ":");
143 /* Parse minimum value */
145 number = strtoul(token, NULL, 10);
147 if (errno == EINVAL || errno == ERANGE ||
155 token = strtok(NULL, ":");
157 /* Parse increment value */
159 number = strtoul(token, NULL, 10);
161 if (errno == EINVAL || errno == ERANGE ||
169 token = strtok(NULL, ":");
171 /* Parse maximum value */
173 number = strtoul(token, NULL, 10);
175 if (errno == EINVAL || errno == ERANGE ||
184 if (strtok(NULL, ":") != NULL)
196 parse_list(const char *arg, uint32_t *list, uint32_t *min, uint32_t *max)
202 char *copy_arg = strdup(arg);
204 if (copy_arg == NULL)
208 token = strtok(copy_arg, ",");
210 /* Parse first value */
212 number = strtoul(token, NULL, 10);
214 if (errno == EINVAL || errno == ERANGE ||
218 list[count++] = number;
224 token = strtok(NULL, ",");
226 while (token != NULL) {
227 if (count == MAX_LIST) {
228 RTE_LOG(WARNING, USER1, "Using only the first %u sizes\n",
233 number = strtoul(token, NULL, 10);
235 if (errno == EINVAL || errno == ERANGE ||
239 list[count++] = number;
246 token = strtok(NULL, ",");
258 parse_total_ops(struct cperf_options *opts, const char *arg)
260 int ret = parse_uint32_t(&opts->total_ops, arg);
263 RTE_LOG(ERR, USER1, "failed to parse total operations count\n");
265 if (opts->total_ops == 0) {
267 "invalid total operations count number specified\n");
275 parse_pool_sz(struct cperf_options *opts, const char *arg)
277 int ret = parse_uint32_t(&opts->pool_sz, arg);
280 RTE_LOG(ERR, USER1, "failed to parse pool size");
285 parse_burst_sz(struct cperf_options *opts, const char *arg)
289 /* Try parsing the argument as a range, if it fails, parse it as a list */
290 if (parse_range(arg, &opts->min_burst_size, &opts->max_burst_size,
291 &opts->inc_burst_size) < 0) {
292 ret = parse_list(arg, opts->burst_size_list,
293 &opts->min_burst_size,
294 &opts->max_burst_size);
296 RTE_LOG(ERR, USER1, "failed to parse burst size/s\n");
299 opts->burst_size_count = ret;
306 parse_buffer_sz(struct cperf_options *opts, const char *arg)
310 /* Try parsing the argument as a range, if it fails, parse it as a list */
311 if (parse_range(arg, &opts->min_buffer_size, &opts->max_buffer_size,
312 &opts->inc_buffer_size) < 0) {
313 ret = parse_list(arg, opts->buffer_size_list,
314 &opts->min_buffer_size,
315 &opts->max_buffer_size);
317 RTE_LOG(ERR, USER1, "failed to parse buffer size/s\n");
320 opts->buffer_size_count = ret;
327 parse_segments_nb(struct cperf_options *opts, const char *arg)
329 int ret = parse_uint32_t(&opts->segments_nb, arg);
332 RTE_LOG(ERR, USER1, "failed to parse segments number\n");
336 if ((opts->segments_nb == 0) || (opts->segments_nb > 255)) {
337 RTE_LOG(ERR, USER1, "invalid segments number specified\n");
345 parse_device_type(struct cperf_options *opts, const char *arg)
347 if (strlen(arg) > (sizeof(opts->device_type) - 1))
350 strncpy(opts->device_type, arg, sizeof(opts->device_type) - 1);
351 *(opts->device_type + sizeof(opts->device_type) - 1) = '\0';
357 parse_op_type(struct cperf_options *opts, const char *arg)
359 struct name_id_map optype_namemap[] = {
361 cperf_op_type_strs[CPERF_CIPHER_ONLY],
365 cperf_op_type_strs[CPERF_AUTH_ONLY],
369 cperf_op_type_strs[CPERF_CIPHER_THEN_AUTH],
370 CPERF_CIPHER_THEN_AUTH
373 cperf_op_type_strs[CPERF_AUTH_THEN_CIPHER],
374 CPERF_AUTH_THEN_CIPHER
377 cperf_op_type_strs[CPERF_AEAD],
382 int id = get_str_key_id_mapping(optype_namemap,
383 RTE_DIM(optype_namemap), arg);
385 RTE_LOG(ERR, USER1, "invalid opt type specified\n");
389 opts->op_type = (enum cperf_op_type)id;
395 parse_sessionless(struct cperf_options *opts,
396 const char *arg __rte_unused)
398 opts->sessionless = 1;
403 parse_out_of_place(struct cperf_options *opts,
404 const char *arg __rte_unused)
406 opts->out_of_place = 1;
411 parse_test_file(struct cperf_options *opts,
414 opts->test_file = strdup(arg);
415 if (access(opts->test_file, F_OK) != -1)
417 RTE_LOG(ERR, USER1, "Test vector file doesn't exist\n");
423 parse_test_name(struct cperf_options *opts,
426 char *test_name = (char *) rte_zmalloc(NULL,
427 sizeof(char) * (strlen(arg) + 3), 0);
428 snprintf(test_name, strlen(arg) + 3, "[%s]", arg);
429 opts->test_name = test_name;
435 parse_silent(struct cperf_options *opts,
436 const char *arg __rte_unused)
444 parse_cipher_algo(struct cperf_options *opts, const char *arg)
447 enum rte_crypto_cipher_algorithm cipher_algo;
449 if (rte_cryptodev_get_cipher_algo_enum(&cipher_algo, arg) < 0) {
450 RTE_LOG(ERR, USER1, "Invalid cipher algorithm specified\n");
454 opts->cipher_algo = cipher_algo;
460 parse_cipher_op(struct cperf_options *opts, const char *arg)
462 struct name_id_map cipher_op_namemap[] = {
464 rte_crypto_cipher_operation_strings
465 [RTE_CRYPTO_CIPHER_OP_ENCRYPT],
466 RTE_CRYPTO_CIPHER_OP_ENCRYPT },
468 rte_crypto_cipher_operation_strings
469 [RTE_CRYPTO_CIPHER_OP_DECRYPT],
470 RTE_CRYPTO_CIPHER_OP_DECRYPT
474 int id = get_str_key_id_mapping(cipher_op_namemap,
475 RTE_DIM(cipher_op_namemap), arg);
477 RTE_LOG(ERR, USER1, "Invalid cipher operation specified\n");
481 opts->cipher_op = (enum rte_crypto_cipher_operation)id;
487 parse_cipher_key_sz(struct cperf_options *opts, const char *arg)
489 return parse_uint16_t(&opts->cipher_key_sz, arg);
493 parse_cipher_iv_sz(struct cperf_options *opts, const char *arg)
495 return parse_uint16_t(&opts->cipher_iv_sz, arg);
499 parse_auth_algo(struct cperf_options *opts, const char *arg)
501 enum rte_crypto_auth_algorithm auth_algo;
503 if (rte_cryptodev_get_auth_algo_enum(&auth_algo, arg) < 0) {
504 RTE_LOG(ERR, USER1, "Invalid authentication algorithm specified\n");
508 opts->auth_algo = auth_algo;
514 parse_auth_op(struct cperf_options *opts, const char *arg)
516 struct name_id_map auth_op_namemap[] = {
518 rte_crypto_auth_operation_strings
519 [RTE_CRYPTO_AUTH_OP_GENERATE],
520 RTE_CRYPTO_AUTH_OP_GENERATE },
522 rte_crypto_auth_operation_strings
523 [RTE_CRYPTO_AUTH_OP_VERIFY],
524 RTE_CRYPTO_AUTH_OP_VERIFY
528 int id = get_str_key_id_mapping(auth_op_namemap,
529 RTE_DIM(auth_op_namemap), arg);
531 RTE_LOG(ERR, USER1, "invalid authentication operation specified"
536 opts->auth_op = (enum rte_crypto_auth_operation)id;
542 parse_auth_key_sz(struct cperf_options *opts, const char *arg)
544 return parse_uint16_t(&opts->auth_key_sz, arg);
548 parse_digest_sz(struct cperf_options *opts, const char *arg)
550 return parse_uint16_t(&opts->digest_sz, arg);
554 parse_auth_iv_sz(struct cperf_options *opts, const char *arg)
556 return parse_uint16_t(&opts->auth_iv_sz, arg);
560 parse_aead_algo(struct cperf_options *opts, const char *arg)
562 enum rte_crypto_aead_algorithm aead_algo;
564 if (rte_cryptodev_get_aead_algo_enum(&aead_algo, arg) < 0) {
565 RTE_LOG(ERR, USER1, "Invalid AEAD algorithm specified\n");
569 opts->aead_algo = aead_algo;
575 parse_aead_op(struct cperf_options *opts, const char *arg)
577 struct name_id_map aead_op_namemap[] = {
579 rte_crypto_aead_operation_strings
580 [RTE_CRYPTO_AEAD_OP_ENCRYPT],
581 RTE_CRYPTO_AEAD_OP_ENCRYPT },
583 rte_crypto_aead_operation_strings
584 [RTE_CRYPTO_AEAD_OP_DECRYPT],
585 RTE_CRYPTO_AEAD_OP_DECRYPT
589 int id = get_str_key_id_mapping(aead_op_namemap,
590 RTE_DIM(aead_op_namemap), arg);
592 RTE_LOG(ERR, USER1, "invalid AEAD operation specified"
597 opts->aead_op = (enum rte_crypto_aead_operation)id;
603 parse_aead_key_sz(struct cperf_options *opts, const char *arg)
605 return parse_uint16_t(&opts->aead_key_sz, arg);
609 parse_aead_iv_sz(struct cperf_options *opts, const char *arg)
611 return parse_uint16_t(&opts->aead_iv_sz, arg);
615 parse_aead_aad_sz(struct cperf_options *opts, const char *arg)
617 return parse_uint16_t(&opts->aead_aad_sz, arg);
621 parse_csv_friendly(struct cperf_options *opts, const char *arg __rte_unused)
628 typedef int (*option_parser_t)(struct cperf_options *opts,
631 struct long_opt_parser {
632 const char *lgopt_name;
633 option_parser_t parser_fn;
637 static struct option lgopts[] = {
639 { CPERF_PTEST_TYPE, required_argument, 0, 0 },
641 { CPERF_POOL_SIZE, required_argument, 0, 0 },
642 { CPERF_TOTAL_OPS, required_argument, 0, 0 },
643 { CPERF_BURST_SIZE, required_argument, 0, 0 },
644 { CPERF_BUFFER_SIZE, required_argument, 0, 0 },
645 { CPERF_SEGMENTS_NB, required_argument, 0, 0 },
647 { CPERF_DEVTYPE, required_argument, 0, 0 },
648 { CPERF_OPTYPE, required_argument, 0, 0 },
650 { CPERF_SILENT, no_argument, 0, 0 },
651 { CPERF_SESSIONLESS, no_argument, 0, 0 },
652 { CPERF_OUT_OF_PLACE, no_argument, 0, 0 },
653 { CPERF_TEST_FILE, required_argument, 0, 0 },
654 { CPERF_TEST_NAME, required_argument, 0, 0 },
656 { CPERF_CIPHER_ALGO, required_argument, 0, 0 },
657 { CPERF_CIPHER_OP, required_argument, 0, 0 },
659 { CPERF_CIPHER_KEY_SZ, required_argument, 0, 0 },
660 { CPERF_CIPHER_IV_SZ, required_argument, 0, 0 },
662 { CPERF_AUTH_ALGO, required_argument, 0, 0 },
663 { CPERF_AUTH_OP, required_argument, 0, 0 },
665 { CPERF_AUTH_KEY_SZ, required_argument, 0, 0 },
666 { CPERF_AUTH_IV_SZ, required_argument, 0, 0 },
668 { CPERF_AEAD_ALGO, required_argument, 0, 0 },
669 { CPERF_AEAD_OP, required_argument, 0, 0 },
671 { CPERF_AEAD_KEY_SZ, required_argument, 0, 0 },
672 { CPERF_AEAD_AAD_SZ, required_argument, 0, 0 },
673 { CPERF_AEAD_IV_SZ, required_argument, 0, 0 },
675 { CPERF_DIGEST_SZ, required_argument, 0, 0 },
677 { CPERF_CSV, no_argument, 0, 0},
683 cperf_options_default(struct cperf_options *opts)
685 opts->test = CPERF_TEST_TYPE_THROUGHPUT;
687 opts->pool_sz = 8192;
688 opts->total_ops = 10000000;
690 opts->buffer_size_list[0] = 64;
691 opts->buffer_size_count = 1;
692 opts->max_buffer_size = 64;
693 opts->min_buffer_size = 64;
694 opts->inc_buffer_size = 0;
696 opts->burst_size_list[0] = 32;
697 opts->burst_size_count = 1;
698 opts->max_burst_size = 32;
699 opts->min_burst_size = 32;
700 opts->inc_burst_size = 0;
702 opts->segments_nb = 1;
704 strncpy(opts->device_type, "crypto_aesni_mb",
705 sizeof(opts->device_type));
707 opts->op_type = CPERF_CIPHER_THEN_AUTH;
710 opts->test_file = NULL;
711 opts->test_name = NULL;
712 opts->sessionless = 0;
713 opts->out_of_place = 0;
716 opts->cipher_algo = RTE_CRYPTO_CIPHER_AES_CBC;
717 opts->cipher_op = RTE_CRYPTO_CIPHER_OP_ENCRYPT;
718 opts->cipher_key_sz = 16;
719 opts->cipher_iv_sz = 16;
721 opts->auth_algo = RTE_CRYPTO_AUTH_SHA1_HMAC;
722 opts->auth_op = RTE_CRYPTO_AUTH_OP_GENERATE;
724 opts->auth_key_sz = 64;
725 opts->auth_iv_sz = 0;
727 opts->aead_key_sz = 0;
728 opts->aead_iv_sz = 0;
729 opts->aead_aad_sz = 0;
731 opts->digest_sz = 12;
735 cperf_opts_parse_long(int opt_idx, struct cperf_options *opts)
737 struct long_opt_parser parsermap[] = {
738 { CPERF_PTEST_TYPE, parse_cperf_test_type },
739 { CPERF_SILENT, parse_silent },
740 { CPERF_POOL_SIZE, parse_pool_sz },
741 { CPERF_TOTAL_OPS, parse_total_ops },
742 { CPERF_BURST_SIZE, parse_burst_sz },
743 { CPERF_BUFFER_SIZE, parse_buffer_sz },
744 { CPERF_SEGMENTS_NB, parse_segments_nb },
745 { CPERF_DEVTYPE, parse_device_type },
746 { CPERF_OPTYPE, parse_op_type },
747 { CPERF_SESSIONLESS, parse_sessionless },
748 { CPERF_OUT_OF_PLACE, parse_out_of_place },
749 { CPERF_TEST_FILE, parse_test_file },
750 { CPERF_TEST_NAME, parse_test_name },
751 { CPERF_CIPHER_ALGO, parse_cipher_algo },
752 { CPERF_CIPHER_OP, parse_cipher_op },
753 { CPERF_CIPHER_KEY_SZ, parse_cipher_key_sz },
754 { CPERF_CIPHER_IV_SZ, parse_cipher_iv_sz },
755 { CPERF_AUTH_ALGO, parse_auth_algo },
756 { CPERF_AUTH_OP, parse_auth_op },
757 { CPERF_AUTH_KEY_SZ, parse_auth_key_sz },
758 { CPERF_AUTH_IV_SZ, parse_auth_iv_sz },
759 { CPERF_AEAD_ALGO, parse_aead_algo },
760 { CPERF_AEAD_OP, parse_aead_op },
761 { CPERF_AEAD_KEY_SZ, parse_aead_key_sz },
762 { CPERF_AEAD_IV_SZ, parse_aead_iv_sz },
763 { CPERF_AEAD_AAD_SZ, parse_aead_aad_sz },
764 { CPERF_DIGEST_SZ, parse_digest_sz },
765 { CPERF_CSV, parse_csv_friendly},
769 for (i = 0; i < RTE_DIM(parsermap); i++) {
770 if (strncmp(lgopts[opt_idx].name, parsermap[i].lgopt_name,
771 strlen(lgopts[opt_idx].name)) == 0)
772 return parsermap[i].parser_fn(opts, optarg);
779 cperf_options_parse(struct cperf_options *options, int argc, char **argv)
781 int opt, retval, opt_idx;
783 while ((opt = getopt_long(argc, argv, "", lgopts, &opt_idx)) != EOF) {
788 retval = cperf_opts_parse_long(opt_idx, options);
803 check_cipher_buffer_length(struct cperf_options *options)
805 uint32_t buffer_size, buffer_size_idx = 0;
807 if (options->cipher_algo == RTE_CRYPTO_CIPHER_AES_CBC ||
808 options->cipher_algo == RTE_CRYPTO_CIPHER_AES_ECB) {
809 if (options->inc_buffer_size != 0)
810 buffer_size = options->min_buffer_size;
812 buffer_size = options->buffer_size_list[0];
814 while (buffer_size <= options->max_buffer_size) {
815 if ((buffer_size % AES_BLOCK_SIZE) != 0) {
816 RTE_LOG(ERR, USER1, "Some of the buffer sizes are "
817 "not suitable for the algorithm selected\n");
821 if (options->inc_buffer_size != 0)
822 buffer_size += options->inc_buffer_size;
824 if (++buffer_size_idx == options->buffer_size_count)
826 buffer_size = options->buffer_size_list[buffer_size_idx];
832 if (options->cipher_algo == RTE_CRYPTO_CIPHER_DES_CBC ||
833 options->cipher_algo == RTE_CRYPTO_CIPHER_3DES_CBC ||
834 options->cipher_algo == RTE_CRYPTO_CIPHER_3DES_ECB) {
835 for (buffer_size = options->min_buffer_size;
836 buffer_size < options->max_buffer_size;
837 buffer_size += options->inc_buffer_size) {
838 if ((buffer_size % DES_BLOCK_SIZE) != 0) {
839 RTE_LOG(ERR, USER1, "Some of the buffer sizes are "
840 "not suitable for the algorithm selected\n");
850 cperf_options_check(struct cperf_options *options)
852 if (options->segments_nb > options->min_buffer_size) {
854 "Segments number greater than buffer size.\n");
858 if (options->test == CPERF_TEST_TYPE_VERIFY &&
859 options->test_file == NULL) {
860 RTE_LOG(ERR, USER1, "Define path to the file with test"
865 if (options->test == CPERF_TEST_TYPE_VERIFY &&
866 options->op_type != CPERF_CIPHER_ONLY &&
867 options->test_name == NULL) {
868 RTE_LOG(ERR, USER1, "Define test name to get the correct digest"
869 " from the test vectors.\n");
873 if (options->test_name != NULL && options->test_file == NULL) {
874 RTE_LOG(ERR, USER1, "Define path to the file with test"
879 if (options->auth_op == RTE_CRYPTO_AUTH_OP_VERIFY &&
880 options->test_file == NULL) {
881 RTE_LOG(ERR, USER1, "Define path to the file with test"
886 if (options->test == CPERF_TEST_TYPE_VERIFY &&
887 options->total_ops > options->pool_sz) {
888 RTE_LOG(ERR, USER1, "Total number of ops must be less than or"
889 " equal to the pool size.\n");
893 if (options->test == CPERF_TEST_TYPE_VERIFY &&
894 (options->inc_buffer_size != 0 ||
895 options->buffer_size_count > 1)) {
896 RTE_LOG(ERR, USER1, "Only one buffer size is allowed when "
897 "using the verify test.\n");
901 if (options->test == CPERF_TEST_TYPE_VERIFY &&
902 (options->inc_burst_size != 0 ||
903 options->burst_size_count > 1)) {
904 RTE_LOG(ERR, USER1, "Only one burst size is allowed when "
905 "using the verify test.\n");
909 if (options->op_type == CPERF_CIPHER_THEN_AUTH) {
910 if (options->cipher_op != RTE_CRYPTO_CIPHER_OP_ENCRYPT &&
912 RTE_CRYPTO_AUTH_OP_GENERATE) {
913 RTE_LOG(ERR, USER1, "Option cipher then auth must use"
914 " options: encrypt and generate.\n");
917 } else if (options->op_type == CPERF_AUTH_THEN_CIPHER) {
918 if (options->cipher_op != RTE_CRYPTO_CIPHER_OP_DECRYPT &&
920 RTE_CRYPTO_AUTH_OP_VERIFY) {
921 RTE_LOG(ERR, USER1, "Option auth then cipher must use"
922 " options: decrypt and verify.\n");
927 if (options->op_type == CPERF_CIPHER_ONLY ||
928 options->op_type == CPERF_CIPHER_THEN_AUTH ||
929 options->op_type == CPERF_AUTH_THEN_CIPHER) {
930 if (check_cipher_buffer_length(options) < 0)
938 cperf_options_dump(struct cperf_options *opts)
942 printf("# Crypto Performance Application Options:\n");
944 printf("# cperf test: %s\n", cperf_test_type_strs[opts->test]);
946 printf("# size of crypto op / mbuf pool: %u\n", opts->pool_sz);
947 printf("# total number of ops: %u\n", opts->total_ops);
948 if (opts->inc_buffer_size != 0) {
949 printf("# buffer size:\n");
950 printf("#\t min: %u\n", opts->min_buffer_size);
951 printf("#\t max: %u\n", opts->max_buffer_size);
952 printf("#\t inc: %u\n", opts->inc_buffer_size);
954 printf("# buffer sizes: ");
955 for (size_idx = 0; size_idx < opts->buffer_size_count; size_idx++)
956 printf("%u ", opts->buffer_size_list[size_idx]);
959 if (opts->inc_burst_size != 0) {
960 printf("# burst size:\n");
961 printf("#\t min: %u\n", opts->min_burst_size);
962 printf("#\t max: %u\n", opts->max_burst_size);
963 printf("#\t inc: %u\n", opts->inc_burst_size);
965 printf("# burst sizes: ");
966 for (size_idx = 0; size_idx < opts->burst_size_count; size_idx++)
967 printf("%u ", opts->burst_size_list[size_idx]);
970 printf("\n# segments per buffer: %u\n", opts->segments_nb);
972 printf("# cryptodev type: %s\n", opts->device_type);
974 printf("# crypto operation: %s\n", cperf_op_type_strs[opts->op_type]);
975 printf("# sessionless: %s\n", opts->sessionless ? "yes" : "no");
976 printf("# out of place: %s\n", opts->out_of_place ? "yes" : "no");
980 if (opts->op_type == CPERF_AUTH_ONLY ||
981 opts->op_type == CPERF_CIPHER_THEN_AUTH ||
982 opts->op_type == CPERF_AUTH_THEN_CIPHER) {
983 printf("# auth algorithm: %s\n",
984 rte_crypto_auth_algorithm_strings[opts->auth_algo]);
985 printf("# auth operation: %s\n",
986 rte_crypto_auth_operation_strings[opts->auth_op]);
987 printf("# auth key size: %u\n", opts->auth_key_sz);
988 printf("# auth iv size: %u\n", opts->auth_iv_sz);
989 printf("# auth digest size: %u\n", opts->digest_sz);
993 if (opts->op_type == CPERF_CIPHER_ONLY ||
994 opts->op_type == CPERF_CIPHER_THEN_AUTH ||
995 opts->op_type == CPERF_AUTH_THEN_CIPHER) {
996 printf("# cipher algorithm: %s\n",
997 rte_crypto_cipher_algorithm_strings[opts->cipher_algo]);
998 printf("# cipher operation: %s\n",
999 rte_crypto_cipher_operation_strings[opts->cipher_op]);
1000 printf("# cipher key size: %u\n", opts->cipher_key_sz);
1001 printf("# cipher iv size: %u\n", opts->cipher_iv_sz);
1005 if (opts->op_type == CPERF_AEAD) {
1006 printf("# aead algorithm: %s\n",
1007 rte_crypto_aead_algorithm_strings[opts->aead_algo]);
1008 printf("# aead operation: %s\n",
1009 rte_crypto_aead_operation_strings[opts->aead_op]);
1010 printf("# aead key size: %u\n", opts->aead_key_sz);
1011 printf("# aead iv size: %u\n", opts->aead_iv_sz);
1012 printf("# aead digest size: %u\n", opts->digest_sz);
1013 printf("# aead aad size: %u\n", opts->aead_aad_sz);