app/crypto-perf: introduce performance test application
[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_VERIFY            ("verify")
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_DIGEST_SZ    ("auth-digest-sz")
33 #define CPERF_AUTH_AAD_SZ       ("auth-aad-sz")
34 #define CPERF_CSV               ("csv-friendly")
35
36
37 enum cperf_perf_test_type {
38         CPERF_TEST_TYPE_THROUGHPUT,
39         CPERF_TEST_TYPE_CYCLECOUNT,
40         CPERF_TEST_TYPE_LATENCY
41 };
42
43
44 extern const char *cperf_test_type_strs[];
45
46 enum cperf_op_type {
47         CPERF_CIPHER_ONLY = 1,
48         CPERF_AUTH_ONLY,
49         CPERF_CIPHER_THEN_AUTH,
50         CPERF_AUTH_THEN_CIPHER,
51         CPERF_AEAD
52 };
53
54 extern const char *cperf_op_type_strs[];
55
56 struct cperf_options {
57         enum cperf_perf_test_type test;
58
59         uint32_t pool_sz;
60         uint32_t total_ops;
61         uint32_t burst_sz;
62         uint32_t buffer_sz;
63         uint32_t segments_nb;
64
65         char device_type[RTE_CRYPTODEV_NAME_LEN];
66         enum cperf_op_type op_type;
67
68         uint32_t sessionless:1;
69         uint32_t out_of_place:1;
70         uint32_t verify:1;
71         uint32_t silent:1;
72         uint32_t csv:1;
73
74         char *test_file;
75         char *test_name;
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_digest_sz;
88         uint16_t auth_aad_sz;
89 };
90
91 void
92 cperf_options_default(struct cperf_options *options);
93
94 int
95 cperf_options_parse(struct cperf_options *options,
96                 int argc, char **argv);
97
98 int
99 cperf_options_check(struct cperf_options *options);
100
101 void
102 cperf_options_dump(struct cperf_options *options);
103
104 #endif