New upstream version 17.08
[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
7 #define CPERF_PTEST_TYPE        ("ptest")
8 #define CPERF_SILENT            ("silent")
9
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_SEGMENTS_NB       ("segments-nb")
15
16 #define CPERF_DEVTYPE           ("devtype")
17 #define CPERF_OPTYPE            ("optype")
18 #define CPERF_SESSIONLESS       ("sessionless")
19 #define CPERF_OUT_OF_PLACE      ("out-of-place")
20 #define CPERF_TEST_FILE         ("test-file")
21 #define CPERF_TEST_NAME         ("test-name")
22
23 #define CPERF_CIPHER_ALGO       ("cipher-algo")
24 #define CPERF_CIPHER_OP         ("cipher-op")
25 #define CPERF_CIPHER_KEY_SZ     ("cipher-key-sz")
26 #define CPERF_CIPHER_IV_SZ      ("cipher-iv-sz")
27
28 #define CPERF_AUTH_ALGO         ("auth-algo")
29 #define CPERF_AUTH_OP           ("auth-op")
30 #define CPERF_AUTH_KEY_SZ       ("auth-key-sz")
31 #define CPERF_AUTH_IV_SZ        ("auth-iv-sz")
32
33 #define CPERF_AEAD_ALGO         ("aead-algo")
34 #define CPERF_AEAD_OP           ("aead-op")
35 #define CPERF_AEAD_KEY_SZ       ("aead-key-sz")
36 #define CPERF_AEAD_IV_SZ        ("aead-iv-sz")
37 #define CPERF_AEAD_AAD_SZ       ("aead-aad-sz")
38
39 #define CPERF_DIGEST_SZ         ("digest-sz")
40
41 #define CPERF_CSV               ("csv-friendly")
42
43 #define MAX_LIST 32
44
45 enum cperf_perf_test_type {
46         CPERF_TEST_TYPE_THROUGHPUT,
47         CPERF_TEST_TYPE_LATENCY,
48         CPERF_TEST_TYPE_VERIFY
49 };
50
51
52 extern const char *cperf_test_type_strs[];
53
54 enum cperf_op_type {
55         CPERF_CIPHER_ONLY = 1,
56         CPERF_AUTH_ONLY,
57         CPERF_CIPHER_THEN_AUTH,
58         CPERF_AUTH_THEN_CIPHER,
59         CPERF_AEAD
60 };
61
62 extern const char *cperf_op_type_strs[];
63
64 struct cperf_options {
65         enum cperf_perf_test_type test;
66
67         uint32_t pool_sz;
68         uint32_t total_ops;
69         uint32_t segments_nb;
70         uint32_t test_buffer_size;
71
72         uint32_t sessionless:1;
73         uint32_t out_of_place:1;
74         uint32_t silent:1;
75         uint32_t csv:1;
76
77         enum rte_crypto_cipher_algorithm cipher_algo;
78         enum rte_crypto_cipher_operation cipher_op;
79
80         uint16_t cipher_key_sz;
81         uint16_t cipher_iv_sz;
82
83         enum rte_crypto_auth_algorithm auth_algo;
84         enum rte_crypto_auth_operation auth_op;
85
86         uint16_t auth_key_sz;
87         uint16_t auth_iv_sz;
88
89         enum rte_crypto_aead_algorithm aead_algo;
90         enum rte_crypto_aead_operation aead_op;
91
92         uint16_t aead_key_sz;
93         uint16_t aead_iv_sz;
94         uint16_t aead_aad_sz;
95
96         uint16_t digest_sz;
97
98         char device_type[RTE_CRYPTODEV_NAME_LEN];
99         enum cperf_op_type op_type;
100
101         char *test_file;
102         char *test_name;
103
104         uint32_t buffer_size_list[MAX_LIST];
105         uint8_t buffer_size_count;
106         uint32_t max_buffer_size;
107         uint32_t min_buffer_size;
108         uint32_t inc_buffer_size;
109
110         uint32_t burst_size_list[MAX_LIST];
111         uint8_t burst_size_count;
112         uint32_t max_burst_size;
113         uint32_t min_burst_size;
114         uint32_t inc_burst_size;
115
116 };
117
118 void
119 cperf_options_default(struct cperf_options *options);
120
121 int
122 cperf_options_parse(struct cperf_options *options,
123                 int argc, char **argv);
124
125 int
126 cperf_options_check(struct cperf_options *options);
127
128 void
129 cperf_options_dump(struct cperf_options *options);
130
131 #endif