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