New upstream version 18.02
[deb_dpdk.git] / app / test-crypto-perf / cperf_options.h
1
2 #ifndef _CPERF_OPTIONS_
3 #define _CPERF_OPTIONS_
4
5 #include <rte_crypto.h>
6 #include <rte_cryptodev.h>
7
8 #define CPERF_PTEST_TYPE        ("ptest")
9 #define CPERF_SILENT            ("silent")
10
11 #define CPERF_POOL_SIZE         ("pool-sz")
12 #define CPERF_TOTAL_OPS         ("total-ops")
13 #define CPERF_BURST_SIZE        ("burst-sz")
14 #define CPERF_BUFFER_SIZE       ("buffer-sz")
15 #define CPERF_SEGMENT_SIZE      ("segment-sz")
16 #define CPERF_DESC_NB           ("desc-nb")
17 #define CPERF_IMIX              ("imix")
18
19 #define CPERF_DEVTYPE           ("devtype")
20 #define CPERF_OPTYPE            ("optype")
21 #define CPERF_SESSIONLESS       ("sessionless")
22 #define CPERF_OUT_OF_PLACE      ("out-of-place")
23 #define CPERF_TEST_FILE         ("test-file")
24 #define CPERF_TEST_NAME         ("test-name")
25
26 #define CPERF_CIPHER_ALGO       ("cipher-algo")
27 #define CPERF_CIPHER_OP         ("cipher-op")
28 #define CPERF_CIPHER_KEY_SZ     ("cipher-key-sz")
29 #define CPERF_CIPHER_IV_SZ      ("cipher-iv-sz")
30
31 #define CPERF_AUTH_ALGO         ("auth-algo")
32 #define CPERF_AUTH_OP           ("auth-op")
33 #define CPERF_AUTH_KEY_SZ       ("auth-key-sz")
34 #define CPERF_AUTH_IV_SZ        ("auth-iv-sz")
35
36 #define CPERF_AEAD_ALGO         ("aead-algo")
37 #define CPERF_AEAD_OP           ("aead-op")
38 #define CPERF_AEAD_KEY_SZ       ("aead-key-sz")
39 #define CPERF_AEAD_IV_SZ        ("aead-iv-sz")
40 #define CPERF_AEAD_AAD_SZ       ("aead-aad-sz")
41
42 #define CPERF_DIGEST_SZ         ("digest-sz")
43
44 #define CPERF_CSV               ("csv-friendly")
45
46 /* benchmark-specific options */
47 #define CPERF_PMDCC_DELAY_MS    ("pmd-cyclecount-delay-ms")
48
49 #define MAX_LIST 32
50
51 enum cperf_perf_test_type {
52         CPERF_TEST_TYPE_THROUGHPUT,
53         CPERF_TEST_TYPE_LATENCY,
54         CPERF_TEST_TYPE_VERIFY,
55         CPERF_TEST_TYPE_PMDCC
56 };
57
58
59 extern const char *cperf_test_type_strs[];
60
61 enum cperf_op_type {
62         CPERF_CIPHER_ONLY = 1,
63         CPERF_AUTH_ONLY,
64         CPERF_CIPHER_THEN_AUTH,
65         CPERF_AUTH_THEN_CIPHER,
66         CPERF_AEAD
67 };
68
69 extern const char *cperf_op_type_strs[];
70
71 struct cperf_options {
72         enum cperf_perf_test_type test;
73
74         uint32_t pool_sz;
75         uint32_t total_ops;
76         uint32_t segment_sz;
77         uint32_t test_buffer_size;
78         uint32_t *imix_buffer_sizes;
79         uint32_t nb_descriptors;
80         uint16_t nb_qps;
81
82         uint32_t sessionless:1;
83         uint32_t out_of_place:1;
84         uint32_t silent:1;
85         uint32_t csv:1;
86
87         enum rte_crypto_cipher_algorithm cipher_algo;
88         enum rte_crypto_cipher_operation cipher_op;
89
90         uint16_t cipher_key_sz;
91         uint16_t cipher_iv_sz;
92
93         enum rte_crypto_auth_algorithm auth_algo;
94         enum rte_crypto_auth_operation auth_op;
95
96         uint16_t auth_key_sz;
97         uint16_t auth_iv_sz;
98
99         enum rte_crypto_aead_algorithm aead_algo;
100         enum rte_crypto_aead_operation aead_op;
101
102         uint16_t aead_key_sz;
103         uint16_t aead_iv_sz;
104         uint16_t aead_aad_sz;
105
106         uint16_t digest_sz;
107
108         char device_type[RTE_CRYPTODEV_NAME_MAX_LEN];
109         enum cperf_op_type op_type;
110
111         char *test_file;
112         char *test_name;
113
114         uint32_t buffer_size_list[MAX_LIST];
115         uint8_t buffer_size_count;
116         uint32_t max_buffer_size;
117         uint32_t min_buffer_size;
118         uint32_t inc_buffer_size;
119
120         uint32_t burst_size_list[MAX_LIST];
121         uint8_t burst_size_count;
122         uint32_t max_burst_size;
123         uint32_t min_burst_size;
124         uint32_t inc_burst_size;
125
126         /* pmd-cyclecount specific options */
127         uint32_t pmdcc_delay;
128         uint32_t imix_distribution_list[MAX_LIST];
129         uint8_t imix_distribution_count;
130 };
131
132 void
133 cperf_options_default(struct cperf_options *options);
134
135 int
136 cperf_options_parse(struct cperf_options *options,
137                 int argc, char **argv);
138
139 int
140 cperf_options_check(struct cperf_options *options);
141
142 void
143 cperf_options_dump(struct cperf_options *options);
144
145 #endif