| 1983 | */ |
| 1984 | |
| 1985 | static int |
| 1986 | test_deflate_comp_decomp(const struct interim_data_params *int_data, |
| 1987 | const struct test_data_params *test_data) |
| 1988 | { |
| 1989 | unsigned int num_bufs = int_data->num_bufs; |
| 1990 | unsigned int out_of_space = test_data->out_of_space; |
| 1991 | |
| 1992 | void *stream = NULL; |
| 1993 | char *all_decomp_data = NULL; |
| 1994 | unsigned int decomp_produced_data_size = 0; |
| 1995 | |
| 1996 | int ret_status = -1; |
| 1997 | int ret; |
| 1998 | struct rte_mbuf *uncomp_bufs[num_bufs]; |
| 1999 | struct rte_mbuf *comp_bufs[num_bufs]; |
| 2000 | struct rte_comp_op *ops[num_bufs]; |
| 2001 | struct rte_comp_op *ops_processed[num_bufs]; |
| 2002 | void *priv_xforms[num_bufs]; |
| 2003 | unsigned int i; |
| 2004 | |
| 2005 | uint64_t compress_checksum[num_bufs]; |
| 2006 | uint32_t compressed_data_size[num_bufs]; |
| 2007 | char *contig_buf = NULL; |
| 2008 | |
| 2009 | struct rte_mbuf_ext_shared_info compbuf_info; |
| 2010 | struct rte_mbuf_ext_shared_info decompbuf_info; |
| 2011 | |
| 2012 | const struct rte_compressdev_capabilities *capa; |
| 2013 | |
| 2014 | /* Compressing with CompressDev */ |
| 2015 | unsigned int zlib_compress = |
| 2016 | (test_data->zlib_dir == ZLIB_ALL || |
| 2017 | test_data->zlib_dir == ZLIB_COMPRESS); |
| 2018 | unsigned int zlib_decompress = |
| 2019 | (test_data->zlib_dir == ZLIB_ALL || |
| 2020 | test_data->zlib_dir == ZLIB_DECOMPRESS); |
| 2021 | |
| 2022 | struct test_private_arrays test_priv_data; |
| 2023 | |
| 2024 | test_priv_data.uncomp_bufs = uncomp_bufs; |
| 2025 | test_priv_data.comp_bufs = comp_bufs; |
| 2026 | test_priv_data.ops = ops; |
| 2027 | test_priv_data.ops_processed = ops_processed; |
| 2028 | test_priv_data.priv_xforms = priv_xforms; |
| 2029 | test_priv_data.compress_checksum = compress_checksum; |
| 2030 | test_priv_data.compressed_data_size = compressed_data_size; |
| 2031 | |
| 2032 | test_priv_data.stream = &stream; |
| 2033 | test_priv_data.all_decomp_data = &all_decomp_data; |
| 2034 | test_priv_data.decomp_produced_data_size = &decomp_produced_data_size; |
| 2035 | |
| 2036 | test_priv_data.num_priv_xforms = 0; /* it's used for decompression only */ |
| 2037 | |
| 2038 | capa = rte_compressdev_capability_get(0, RTE_COMP_ALGO_DEFLATE); |
| 2039 | if (capa == NULL) { |
| 2040 | RTE_LOG(ERR, USER1, |
| 2041 | "Compress device does not support DEFLATE\n"); |
| 2042 | return -1; |
no test coverage detected