test mbuf attach
[dpdk.git] / app / test-compress-perf / comp_perf_test_common.h
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright(c) 2019 Intel Corporation
3  */
4
5 #ifndef _COMP_PERF_TEST_COMMON_H_
6 #define _COMP_PERF_TEST_COMMON_H_
7
8 #include <stdint.h>
9
10 #include <rte_mempool.h>
11
12 struct cperf_mem_resources {
13         uint8_t dev_id;
14         uint16_t qp_id;
15         uint8_t lcore_id;
16
17         rte_atomic16_t print_info_once;
18
19         uint32_t total_bufs;
20         uint8_t *compressed_data;
21         uint8_t *decompressed_data;
22
23         struct rte_mbuf **comp_bufs;
24         struct rte_mbuf **decomp_bufs;
25
26         struct rte_mempool *comp_buf_pool;
27         struct rte_mempool *decomp_buf_pool;
28         struct rte_mempool *op_pool;
29
30         /* external mbuf support */
31         const struct rte_memzone **comp_memzones;
32         const struct rte_memzone **decomp_memzones;
33         struct rte_mbuf_ext_shared_info *comp_buf_infos;
34         struct rte_mbuf_ext_shared_info *decomp_buf_infos;
35 };
36
37 int
38 param_range_check(uint16_t size, const struct rte_param_log2_range *range);
39
40 void
41 comp_perf_free_memory(struct comp_test_data *test_data,
42                       struct cperf_mem_resources *mem);
43
44 int
45 comp_perf_allocate_memory(struct comp_test_data *test_data,
46                           struct cperf_mem_resources *mem);
47
48 int
49 prepare_bufs(struct comp_test_data *test_data, struct cperf_mem_resources *mem);
50
51 void
52 print_test_dynamics(const struct comp_test_data *test_data);
53
54 #endif /* _COMP_PERF_TEST_COMMON_H_ */