1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2018 Intel Corporation
5 #ifndef _CPERF_OPTIONS_
6 #define _CPERF_OPTIONS_
8 #include <rte_crypto.h>
9 #include <rte_cryptodev.h>
10 #ifdef RTE_LIB_SECURITY
11 #include <rte_security.h>
14 #define CPERF_PTEST_TYPE ("ptest")
15 #define CPERF_MODEX_LEN ("modex-len")
16 #define CPERF_SILENT ("silent")
18 #define CPERF_POOL_SIZE ("pool-sz")
19 #define CPERF_TOTAL_OPS ("total-ops")
20 #define CPERF_BURST_SIZE ("burst-sz")
21 #define CPERF_BUFFER_SIZE ("buffer-sz")
22 #define CPERF_SEGMENT_SIZE ("segment-sz")
23 #define CPERF_DESC_NB ("desc-nb")
24 #define CPERF_IMIX ("imix")
26 #define CPERF_DEVTYPE ("devtype")
27 #define CPERF_OPTYPE ("optype")
28 #define CPERF_SESSIONLESS ("sessionless")
29 #define CPERF_OUT_OF_PLACE ("out-of-place")
30 #define CPERF_TEST_FILE ("test-file")
31 #define CPERF_TEST_NAME ("test-name")
33 #define CPERF_CIPHER_ALGO ("cipher-algo")
34 #define CPERF_CIPHER_OP ("cipher-op")
35 #define CPERF_CIPHER_KEY_SZ ("cipher-key-sz")
36 #define CPERF_CIPHER_IV_SZ ("cipher-iv-sz")
38 #define CPERF_AUTH_ALGO ("auth-algo")
39 #define CPERF_AUTH_OP ("auth-op")
40 #define CPERF_AUTH_KEY_SZ ("auth-key-sz")
41 #define CPERF_AUTH_IV_SZ ("auth-iv-sz")
43 #define CPERF_AEAD_ALGO ("aead-algo")
44 #define CPERF_AEAD_OP ("aead-op")
45 #define CPERF_AEAD_KEY_SZ ("aead-key-sz")
46 #define CPERF_AEAD_IV_SZ ("aead-iv-sz")
47 #define CPERF_AEAD_AAD_SZ ("aead-aad-sz")
49 #define CPERF_DIGEST_SZ ("digest-sz")
51 #ifdef RTE_LIB_SECURITY
52 #define CPERF_PDCP_SN_SZ ("pdcp-sn-sz")
53 #define CPERF_PDCP_DOMAIN ("pdcp-domain")
54 #define CPERF_PDCP_SES_HFN_EN ("pdcp-ses-hfn-en")
55 #define PDCP_DEFAULT_HFN 0x1
56 #define CPERF_DOCSIS_HDR_SZ ("docsis-hdr-sz")
59 #define CPERF_CSV ("csv-friendly")
61 /* benchmark-specific options */
62 #define CPERF_PMDCC_DELAY_MS ("pmd-cyclecount-delay-ms")
66 enum cperf_perf_test_type {
67 CPERF_TEST_TYPE_THROUGHPUT,
68 CPERF_TEST_TYPE_LATENCY,
69 CPERF_TEST_TYPE_VERIFY,
74 extern const char *cperf_test_type_strs[];
77 CPERF_CIPHER_ONLY = 1,
79 CPERF_CIPHER_THEN_AUTH,
80 CPERF_AUTH_THEN_CIPHER,
88 extern const char *cperf_op_type_strs[];
90 struct cperf_options {
91 enum cperf_perf_test_type test;
98 uint32_t test_buffer_size;
99 uint32_t *imix_buffer_sizes;
100 uint32_t nb_descriptors;
103 uint32_t sessionless:1;
104 uint32_t out_of_place:1;
108 enum rte_crypto_cipher_algorithm cipher_algo;
109 enum rte_crypto_cipher_operation cipher_op;
111 uint16_t cipher_key_sz;
112 uint16_t cipher_iv_sz;
114 enum rte_crypto_auth_algorithm auth_algo;
115 enum rte_crypto_auth_operation auth_op;
117 uint16_t auth_key_sz;
120 enum rte_crypto_aead_algorithm aead_algo;
121 enum rte_crypto_aead_operation aead_op;
123 uint16_t aead_key_sz;
125 uint16_t aead_aad_sz;
129 #ifdef RTE_LIB_SECURITY
131 uint16_t pdcp_ses_hfn_en;
132 enum rte_security_pdcp_domain pdcp_domain;
133 uint16_t docsis_hdr_sz;
135 char device_type[RTE_CRYPTODEV_NAME_MAX_LEN];
136 enum cperf_op_type op_type;
141 uint32_t buffer_size_list[MAX_LIST];
142 uint8_t buffer_size_count;
143 uint32_t max_buffer_size;
144 uint32_t min_buffer_size;
145 uint32_t inc_buffer_size;
147 uint32_t burst_size_list[MAX_LIST];
148 uint8_t burst_size_count;
149 uint32_t max_burst_size;
150 uint32_t min_burst_size;
151 uint32_t inc_burst_size;
153 /* pmd-cyclecount specific options */
154 uint32_t pmdcc_delay;
155 uint32_t imix_distribution_list[MAX_LIST];
156 uint8_t imix_distribution_count;
157 struct cperf_modex_test_data *modex_data;
162 cperf_options_default(struct cperf_options *options);
165 cperf_options_parse(struct cperf_options *options,
166 int argc, char **argv);
169 cperf_options_check(struct cperf_options *options);
172 cperf_options_dump(struct cperf_options *options);