1424dd6c8STomasz Jozwiak /* SPDX-License-Identifier: BSD-3-Clause 2424dd6c8STomasz Jozwiak * Copyright(c) 2019 Intel Corporation 3424dd6c8STomasz Jozwiak */ 4424dd6c8STomasz Jozwiak 5424dd6c8STomasz Jozwiak #ifndef _COMP_PERF_TEST_COMMON_H_ 6424dd6c8STomasz Jozwiak #define _COMP_PERF_TEST_COMMON_H_ 7424dd6c8STomasz Jozwiak 8424dd6c8STomasz Jozwiak #include <stdint.h> 9424dd6c8STomasz Jozwiak 10424dd6c8STomasz Jozwiak #include <rte_mempool.h> 11424dd6c8STomasz Jozwiak 12424dd6c8STomasz Jozwiak struct cperf_mem_resources { 13424dd6c8STomasz Jozwiak uint8_t dev_id; 14424dd6c8STomasz Jozwiak uint16_t qp_id; 15424dd6c8STomasz Jozwiak uint8_t lcore_id; 166f1e5d80SArtur Trybula 17*b6a7e685STyler Retzlaff RTE_ATOMIC(uint16_t) print_info_once; 186f1e5d80SArtur Trybula 19424dd6c8STomasz Jozwiak uint32_t total_bufs; 20424dd6c8STomasz Jozwiak uint8_t *compressed_data; 21424dd6c8STomasz Jozwiak uint8_t *decompressed_data; 22424dd6c8STomasz Jozwiak 23424dd6c8STomasz Jozwiak struct rte_mbuf **comp_bufs; 24424dd6c8STomasz Jozwiak struct rte_mbuf **decomp_bufs; 25424dd6c8STomasz Jozwiak 26424dd6c8STomasz Jozwiak struct rte_mempool *comp_buf_pool; 27424dd6c8STomasz Jozwiak struct rte_mempool *decomp_buf_pool; 28424dd6c8STomasz Jozwiak struct rte_mempool *op_pool; 29c02e33b0SAdam Dybkowski 30c02e33b0SAdam Dybkowski /* external mbuf support */ 31c02e33b0SAdam Dybkowski const struct rte_memzone **comp_memzones; 32c02e33b0SAdam Dybkowski const struct rte_memzone **decomp_memzones; 33c02e33b0SAdam Dybkowski struct rte_mbuf_ext_shared_info *comp_buf_infos; 34c02e33b0SAdam Dybkowski struct rte_mbuf_ext_shared_info *decomp_buf_infos; 35424dd6c8STomasz Jozwiak }; 36424dd6c8STomasz Jozwiak 37424dd6c8STomasz Jozwiak int 38424dd6c8STomasz Jozwiak param_range_check(uint16_t size, const struct rte_param_log2_range *range); 39424dd6c8STomasz Jozwiak 40424dd6c8STomasz Jozwiak void 41c02e33b0SAdam Dybkowski comp_perf_free_memory(struct comp_test_data *test_data, 42c02e33b0SAdam Dybkowski struct cperf_mem_resources *mem); 43424dd6c8STomasz Jozwiak 44424dd6c8STomasz Jozwiak int 45424dd6c8STomasz Jozwiak comp_perf_allocate_memory(struct comp_test_data *test_data, 46424dd6c8STomasz Jozwiak struct cperf_mem_resources *mem); 47424dd6c8STomasz Jozwiak 48424dd6c8STomasz Jozwiak int 49424dd6c8STomasz Jozwiak prepare_bufs(struct comp_test_data *test_data, struct cperf_mem_resources *mem); 50424dd6c8STomasz Jozwiak 516f1e5d80SArtur Trybula void 522695db95SArtur Trybula print_test_dynamics(const struct comp_test_data *test_data); 536f1e5d80SArtur Trybula 54424dd6c8STomasz Jozwiak #endif /* _COMP_PERF_TEST_COMMON_H_ */ 55