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_LIBRTE_SECURITY
11 #include <rte_security.h>
14 #define CPERF_PTEST_TYPE ("ptest")
15 #define CPERF_SILENT ("silent")
17 #define CPERF_POOL_SIZE ("pool-sz")
18 #define CPERF_TOTAL_OPS ("total-ops")
19 #define CPERF_BURST_SIZE ("burst-sz")
20 #define CPERF_BUFFER_SIZE ("buffer-sz")
21 #define CPERF_SEGMENT_SIZE ("segment-sz")
22 #define CPERF_DESC_NB ("desc-nb")
23 #define CPERF_IMIX ("imix")
25 #define CPERF_DEVTYPE ("devtype")
26 #define CPERF_OPTYPE ("optype")
27 #define CPERF_SESSIONLESS ("sessionless")
28 #define CPERF_OUT_OF_PLACE ("out-of-place")
29 #define CPERF_TEST_FILE ("test-file")
30 #define CPERF_TEST_NAME ("test-name")
32 #define CPERF_CIPHER_ALGO ("cipher-algo")
33 #define CPERF_CIPHER_OP ("cipher-op")
34 #define CPERF_CIPHER_KEY_SZ ("cipher-key-sz")
35 #define CPERF_CIPHER_IV_SZ ("cipher-iv-sz")
37 #define CPERF_AUTH_ALGO ("auth-algo")
38 #define CPERF_AUTH_OP ("auth-op")
39 #define CPERF_AUTH_KEY_SZ ("auth-key-sz")
40 #define CPERF_AUTH_IV_SZ ("auth-iv-sz")
42 #define CPERF_AEAD_ALGO ("aead-algo")
43 #define CPERF_AEAD_OP ("aead-op")
44 #define CPERF_AEAD_KEY_SZ ("aead-key-sz")
45 #define CPERF_AEAD_IV_SZ ("aead-iv-sz")
46 #define CPERF_AEAD_AAD_SZ ("aead-aad-sz")
48 #define CPERF_DIGEST_SZ ("digest-sz")
50 #ifdef RTE_LIBRTE_SECURITY
51 #define CPERF_PDCP_SN_SZ ("pdcp-sn-sz")
52 #define CPERF_PDCP_DOMAIN ("pdcp-domain")
55 #define CPERF_CSV ("csv-friendly")
57 /* benchmark-specific options */
58 #define CPERF_PMDCC_DELAY_MS ("pmd-cyclecount-delay-ms")
62 enum cperf_perf_test_type {
63 CPERF_TEST_TYPE_THROUGHPUT,
64 CPERF_TEST_TYPE_LATENCY,
65 CPERF_TEST_TYPE_VERIFY,
70 extern const char *cperf_test_type_strs[];
73 CPERF_CIPHER_ONLY = 1,
75 CPERF_CIPHER_THEN_AUTH,
76 CPERF_AUTH_THEN_CIPHER,
81 extern const char *cperf_op_type_strs[];
83 struct cperf_options {
84 enum cperf_perf_test_type test;
91 uint32_t test_buffer_size;
92 uint32_t *imix_buffer_sizes;
93 uint32_t nb_descriptors;
96 uint32_t sessionless:1;
97 uint32_t out_of_place:1;
101 enum rte_crypto_cipher_algorithm cipher_algo;
102 enum rte_crypto_cipher_operation cipher_op;
104 uint16_t cipher_key_sz;
105 uint16_t cipher_iv_sz;
107 enum rte_crypto_auth_algorithm auth_algo;
108 enum rte_crypto_auth_operation auth_op;
110 uint16_t auth_key_sz;
113 enum rte_crypto_aead_algorithm aead_algo;
114 enum rte_crypto_aead_operation aead_op;
116 uint16_t aead_key_sz;
118 uint16_t aead_aad_sz;
122 #ifdef RTE_LIBRTE_SECURITY
124 enum rte_security_pdcp_domain pdcp_domain;
126 char device_type[RTE_CRYPTODEV_NAME_MAX_LEN];
127 enum cperf_op_type op_type;
132 uint32_t buffer_size_list[MAX_LIST];
133 uint8_t buffer_size_count;
134 uint32_t max_buffer_size;
135 uint32_t min_buffer_size;
136 uint32_t inc_buffer_size;
138 uint32_t burst_size_list[MAX_LIST];
139 uint8_t burst_size_count;
140 uint32_t max_burst_size;
141 uint32_t min_burst_size;
142 uint32_t inc_burst_size;
144 /* pmd-cyclecount specific options */
145 uint32_t pmdcc_delay;
146 uint32_t imix_distribution_list[MAX_LIST];
147 uint8_t imix_distribution_count;
151 cperf_options_default(struct cperf_options *options);
154 cperf_options_parse(struct cperf_options *options,
155 int argc, char **argv);
158 cperf_options_check(struct cperf_options *options);
161 cperf_options_dump(struct cperf_options *options);