+static int
+test_compressdev_deflate_stateless_dynamic_big(void)
+{
+ struct comp_testsuite_params *ts_params = &testsuite_params;
+ uint16_t i = 0;
+ int ret = TEST_SUCCESS;
+ const struct rte_compressdev_capabilities *capab;
+ char *test_buffer = NULL;
+
+ capab = rte_compressdev_capability_get(0, RTE_COMP_ALGO_DEFLATE);
+ TEST_ASSERT(capab != NULL, "Failed to retrieve device capabilities");
+
+ if ((capab->comp_feature_flags & RTE_COMP_FF_HUFFMAN_DYNAMIC) == 0)
+ return -ENOTSUP;
+
+ if ((capab->comp_feature_flags & RTE_COMP_FF_OOP_SGL_IN_SGL_OUT) == 0)
+ return -ENOTSUP;
+
+ test_buffer = rte_malloc(NULL, BIG_DATA_TEST_SIZE, 0);
+ if (test_buffer == NULL) {
+ RTE_LOG(ERR, USER1,
+ "Can't allocate buffer for big-data\n");
+ return TEST_FAILED;
+ }
+
+ struct interim_data_params int_data = {
+ (const char * const *)&test_buffer,
+ 1,
+ NULL,
+ &ts_params->def_comp_xform,
+ &ts_params->def_decomp_xform,
+ 1
+ };
+
+ struct test_data_params test_data = {
+ RTE_COMP_OP_STATELESS,
+ SGL_BOTH,
+ ZLIB_DECOMPRESS,
+ 0,
+ 1
+ };
+
+ ts_params->def_comp_xform->compress.deflate.huffman =
+ RTE_COMP_HUFFMAN_DYNAMIC;
+
+ /* fill the buffer with data based on rand. data */
+ srand(BIG_DATA_TEST_SIZE);
+ for (uint32_t i = 0; i < BIG_DATA_TEST_SIZE - 1; ++i)
+ test_buffer[i] = (uint8_t)(rand() % ((uint8_t)-1)) | 1;
+
+ test_buffer[BIG_DATA_TEST_SIZE-1] = 0;
+ int_data.buf_idx = &i;
+
+ /* Compress with compressdev, decompress with Zlib */
+ test_data.zlib_dir = ZLIB_DECOMPRESS;
+ if (test_deflate_comp_decomp(&int_data, &test_data) < 0) {
+ ret = TEST_FAILED;
+ goto end;
+ }
+
+ /* Compress with Zlib, decompress with compressdev */
+ test_data.zlib_dir = ZLIB_COMPRESS;
+ if (test_deflate_comp_decomp(&int_data, &test_data) < 0) {
+ ret = TEST_FAILED;
+ goto end;
+ }
+
+end:
+ ts_params->def_comp_xform->compress.deflate.huffman =
+ RTE_COMP_HUFFMAN_DEFAULT;
+ rte_free(test_buffer);
+ return ret;
+}
+