7516ea0ec2867e340ea904fc45808ce398011c2e
[dpdk.git] / app / test-compress-perf / comp_perf_options.h
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright(c) 2018 Intel Corporation
3  */
4
5 #define MAX_DRIVER_NAME         64
6 #define MAX_INPUT_FILE_NAME     64
7 #define MAX_LIST                32
8
9 enum comp_operation {
10         COMPRESS_ONLY,
11         DECOMPRESS_ONLY,
12         COMPRESS_DECOMPRESS
13 };
14
15 struct range_list {
16         uint8_t min;
17         uint8_t max;
18         uint8_t inc;
19         uint8_t count;
20         uint8_t list[MAX_LIST];
21 };
22
23 struct comp_test_data {
24         char driver_name[64];
25         char input_file[64];
26         struct rte_mbuf **comp_bufs;
27         struct rte_mbuf **decomp_bufs;
28         uint32_t total_bufs;
29         uint8_t *input_data;
30         size_t input_data_sz;
31         uint8_t *compressed_data;
32         uint8_t *decompressed_data;
33         struct rte_mempool *comp_buf_pool;
34         struct rte_mempool *decomp_buf_pool;
35         struct rte_mempool *op_pool;
36         int8_t cdev_id;
37         uint16_t seg_sz;
38         uint16_t burst_sz;
39         uint32_t pool_sz;
40         uint32_t num_iter;
41         uint16_t max_sgl_segs;
42         enum rte_comp_huffman huffman_enc;
43         enum comp_operation test_op;
44         int window_sz;
45         struct range_list level;
46         /* Store TSC duration for all levels (including level 0) */
47         uint64_t comp_tsc_duration[RTE_COMP_LEVEL_MAX + 1];
48         uint64_t decomp_tsc_duration[RTE_COMP_LEVEL_MAX + 1];
49 };
50
51 int
52 comp_perf_options_parse(struct comp_test_data *test_data, int argc,
53                         char **argv);
54
55 void
56 comp_perf_options_default(struct comp_test_data *test_data);
57
58 int
59 comp_perf_options_check(struct comp_test_data *test_data);