2 #ifndef _CPERF_OPTIONS_
3 #define _CPERF_OPTIONS_
5 #include <rte_crypto.h>
7 #define CPERF_PTEST_TYPE ("ptest")
8 #define CPERF_SILENT ("silent")
10 #define CPERF_POOL_SIZE ("pool-sz")
11 #define CPERF_TOTAL_OPS ("total-ops")
12 #define CPERF_BURST_SIZE ("burst-sz")
13 #define CPERF_BUFFER_SIZE ("buffer-sz")
14 #define CPERF_SEGMENT_SIZE ("segment-sz")
15 #define CPERF_DESC_NB ("desc-nb")
16 #define CPERF_IMIX ("imix")
18 #define CPERF_DEVTYPE ("devtype")
19 #define CPERF_OPTYPE ("optype")
20 #define CPERF_SESSIONLESS ("sessionless")
21 #define CPERF_OUT_OF_PLACE ("out-of-place")
22 #define CPERF_TEST_FILE ("test-file")
23 #define CPERF_TEST_NAME ("test-name")
25 #define CPERF_CIPHER_ALGO ("cipher-algo")
26 #define CPERF_CIPHER_OP ("cipher-op")
27 #define CPERF_CIPHER_KEY_SZ ("cipher-key-sz")
28 #define CPERF_CIPHER_IV_SZ ("cipher-iv-sz")
30 #define CPERF_AUTH_ALGO ("auth-algo")
31 #define CPERF_AUTH_OP ("auth-op")
32 #define CPERF_AUTH_KEY_SZ ("auth-key-sz")
33 #define CPERF_AUTH_IV_SZ ("auth-iv-sz")
35 #define CPERF_AEAD_ALGO ("aead-algo")
36 #define CPERF_AEAD_OP ("aead-op")
37 #define CPERF_AEAD_KEY_SZ ("aead-key-sz")
38 #define CPERF_AEAD_IV_SZ ("aead-iv-sz")
39 #define CPERF_AEAD_AAD_SZ ("aead-aad-sz")
41 #define CPERF_DIGEST_SZ ("digest-sz")
43 #define CPERF_CSV ("csv-friendly")
45 /* benchmark-specific options */
46 #define CPERF_PMDCC_DELAY_MS ("pmd-cyclecount-delay-ms")
50 enum cperf_perf_test_type {
51 CPERF_TEST_TYPE_THROUGHPUT,
52 CPERF_TEST_TYPE_LATENCY,
53 CPERF_TEST_TYPE_VERIFY,
58 extern const char *cperf_test_type_strs[];
61 CPERF_CIPHER_ONLY = 1,
63 CPERF_CIPHER_THEN_AUTH,
64 CPERF_AUTH_THEN_CIPHER,
68 extern const char *cperf_op_type_strs[];
70 struct cperf_options {
71 enum cperf_perf_test_type test;
76 uint32_t test_buffer_size;
77 uint32_t *imix_buffer_sizes;
78 uint32_t nb_descriptors;
81 uint32_t sessionless:1;
82 uint32_t out_of_place:1;
86 enum rte_crypto_cipher_algorithm cipher_algo;
87 enum rte_crypto_cipher_operation cipher_op;
89 uint16_t cipher_key_sz;
90 uint16_t cipher_iv_sz;
92 enum rte_crypto_auth_algorithm auth_algo;
93 enum rte_crypto_auth_operation auth_op;
98 enum rte_crypto_aead_algorithm aead_algo;
99 enum rte_crypto_aead_operation aead_op;
101 uint16_t aead_key_sz;
103 uint16_t aead_aad_sz;
107 char device_type[RTE_CRYPTODEV_NAME_LEN];
108 enum cperf_op_type op_type;
113 uint32_t buffer_size_list[MAX_LIST];
114 uint8_t buffer_size_count;
115 uint32_t max_buffer_size;
116 uint32_t min_buffer_size;
117 uint32_t inc_buffer_size;
119 uint32_t burst_size_list[MAX_LIST];
120 uint8_t burst_size_count;
121 uint32_t max_burst_size;
122 uint32_t min_burst_size;
123 uint32_t inc_burst_size;
125 /* pmd-cyclecount specific options */
126 uint32_t pmdcc_delay;
127 uint32_t imix_distribution_list[MAX_LIST];
128 uint8_t imix_distribution_count;
132 cperf_options_default(struct cperf_options *options);
135 cperf_options_parse(struct cperf_options *options,
136 int argc, char **argv);
139 cperf_options_check(struct cperf_options *options);
142 cperf_options_dump(struct cperf_options *options);