unsigned int out_of_space = test_data->out_of_space;
unsigned int big_data = test_data->big_data;
enum zlib_direction zlib_dir = test_data->zlib_dir;
- int ret_status = -1;
+ int ret_status = TEST_FAILED;
int ret;
struct rte_mbuf *uncomp_bufs[num_bufs];
struct rte_mbuf *comp_bufs[num_bufs];
if (capa == NULL) {
RTE_LOG(ERR, USER1,
"Compress device does not support DEFLATE\n");
- return -1;
+ return -ENOTSUP;
}
/* Initialize all arrays to NULL */
if (out_of_space && oos_zlib_decompress) {
if (ops_processed[i]->status !=
RTE_COMP_OP_STATUS_OUT_OF_SPACE_TERMINATED) {
- ret_status = -1;
-
+ ret_status = TEST_FAILED;
RTE_LOG(ERR, USER1,
"Operation without expected out of "
"space status error\n");
}
if (out_of_space && oos_zlib_decompress) {
- ret_status = 0;
+ ret_status = TEST_SUCCESS;
goto exit;
}
if (out_of_space && oos_zlib_compress) {
if (ops_processed[i]->status !=
RTE_COMP_OP_STATUS_OUT_OF_SPACE_TERMINATED) {
- ret_status = -1;
-
+ ret_status = TEST_FAILED;
RTE_LOG(ERR, USER1,
"Operation without expected out of "
"space status error\n");
}
if (out_of_space && oos_zlib_compress) {
- ret_status = 0;
+ ret_status = TEST_SUCCESS;
goto exit;
}
contig_buf = NULL;
}
- ret_status = 0;
+ ret_status = TEST_SUCCESS;
exit:
/* Free resources */
/* 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;
+ ret = test_deflate_comp_decomp(&int_data, &test_data);
+ if (ret < 0)
goto exit;
- }
/* 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;
+ ret = test_deflate_comp_decomp(&int_data, &test_data);
+ if (ret < 0)
goto exit;
- }
}
ret = TEST_SUCCESS;
/* 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;
+ ret = test_deflate_comp_decomp(&int_data, &test_data);
+ if (ret < 0)
goto exit;
- }
/* 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;
+ ret = test_deflate_comp_decomp(&int_data, &test_data);
+ if (ret < 0)
goto exit;
- }
}
ret = TEST_SUCCESS;
uint16_t num_bufs = RTE_DIM(compress_test_bufs);
uint16_t buf_idx[num_bufs];
uint16_t i;
+ int ret;
for (i = 0; i < num_bufs; i++)
buf_idx[i] = i;
/* Compress with compressdev, decompress with Zlib */
test_data.zlib_dir = ZLIB_DECOMPRESS;
- if (test_deflate_comp_decomp(&int_data, &test_data) < 0)
- return TEST_FAILED;
+ ret = test_deflate_comp_decomp(&int_data, &test_data);
+ if (ret < 0)
+ return ret;
/* Compress with Zlib, decompress with compressdev */
test_data.zlib_dir = ZLIB_COMPRESS;
- if (test_deflate_comp_decomp(&int_data, &test_data) < 0)
- return TEST_FAILED;
+ ret = test_deflate_comp_decomp(&int_data, &test_data);
+ if (ret < 0)
+ return ret;
return TEST_SUCCESS;
}
compress_xform->compress.level = level;
/* 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;
+ ret = test_deflate_comp_decomp(&int_data, &test_data);
+ if (ret < 0)
goto exit;
- }
}
}
uint16_t i;
unsigned int level = RTE_COMP_LEVEL_MIN;
uint16_t buf_idx[num_bufs];
-
int ret;
/* Create multiple xforms with various levels */
};
/* Compress with compressdev, decompress with Zlib */
- if (test_deflate_comp_decomp(&int_data, &test_data) < 0) {
- ret = TEST_FAILED;
+ ret = test_deflate_comp_decomp(&int_data, &test_data);
+ if (ret < 0)
goto exit;
- }
ret = TEST_SUCCESS;
+
exit:
for (i = 0; i < NUM_XFORMS; i++) {
rte_free(compress_xforms[i]);
{
struct comp_testsuite_params *ts_params = &testsuite_params;
uint16_t i;
+ int ret;
const struct rte_compressdev_capabilities *capab;
capab = rte_compressdev_capability_get(0, RTE_COMP_ALGO_DEFLATE);
/* Compress with compressdev, decompress with Zlib */
test_data.zlib_dir = ZLIB_DECOMPRESS;
- if (test_deflate_comp_decomp(&int_data, &test_data) < 0)
- return TEST_FAILED;
+ ret = test_deflate_comp_decomp(&int_data, &test_data);
+ if (ret < 0)
+ return ret;
/* Compress with Zlib, decompress with compressdev */
test_data.zlib_dir = ZLIB_COMPRESS;
- if (test_deflate_comp_decomp(&int_data, &test_data) < 0)
- return TEST_FAILED;
+ ret = test_deflate_comp_decomp(&int_data, &test_data);
+ if (ret < 0)
+ return ret;
if (capab->comp_feature_flags & RTE_COMP_FF_OOP_SGL_IN_LB_OUT) {
/* Compress with compressdev, decompress with Zlib */
test_data.zlib_dir = ZLIB_DECOMPRESS;
test_data.buff_type = SGL_TO_LB;
- if (test_deflate_comp_decomp(&int_data, &test_data) < 0)
- return TEST_FAILED;
+ ret = test_deflate_comp_decomp(&int_data, &test_data);
+ if (ret < 0)
+ return ret;
/* Compress with Zlib, decompress with compressdev */
test_data.zlib_dir = ZLIB_COMPRESS;
test_data.buff_type = SGL_TO_LB;
- if (test_deflate_comp_decomp(&int_data, &test_data) < 0)
- return TEST_FAILED;
+ ret = test_deflate_comp_decomp(&int_data, &test_data);
+ if (ret < 0)
+ return ret;
}
if (capab->comp_feature_flags & RTE_COMP_FF_OOP_LB_IN_SGL_OUT) {
/* Compress with compressdev, decompress with Zlib */
test_data.zlib_dir = ZLIB_DECOMPRESS;
test_data.buff_type = LB_TO_SGL;
- if (test_deflate_comp_decomp(&int_data, &test_data) < 0)
- return TEST_FAILED;
+ ret = test_deflate_comp_decomp(&int_data, &test_data);
+ if (ret < 0)
+ return ret;
/* Compress with Zlib, decompress with compressdev */
test_data.zlib_dir = ZLIB_COMPRESS;
test_data.buff_type = LB_TO_SGL;
- if (test_deflate_comp_decomp(&int_data, &test_data) < 0)
- return TEST_FAILED;
+ ret = test_deflate_comp_decomp(&int_data, &test_data);
+ if (ret < 0)
+ return ret;
}
-
-
}
return TEST_SUCCESS;
-
}
static int
rte_malloc(NULL, sizeof(struct rte_comp_xform), 0);
if (compress_xform == NULL) {
RTE_LOG(ERR, USER1, "Compress xform could not be created\n");
- ret = TEST_FAILED;
- return ret;
+ return TEST_FAILED;
}
memcpy(compress_xform, ts_params->def_comp_xform,
if (decompress_xform == NULL) {
RTE_LOG(ERR, USER1, "Decompress xform could not be created\n");
rte_free(compress_xform);
- ret = TEST_FAILED;
- return ret;
+ return TEST_FAILED;
}
memcpy(decompress_xform, ts_params->def_decomp_xform,
* drivers decompression checksum
*/
test_data.zlib_dir = ZLIB_COMPRESS;
- if (test_deflate_comp_decomp(&int_data, &test_data) < 0) {
- ret = TEST_FAILED;
+ ret = test_deflate_comp_decomp(&int_data, &test_data);
+ if (ret < 0)
goto exit;
- }
/* Generate compression and decompression
* checksum of selected driver
*/
test_data.zlib_dir = ZLIB_NONE;
- if (test_deflate_comp_decomp(&int_data, &test_data) < 0) {
- ret = TEST_FAILED;
+ ret = test_deflate_comp_decomp(&int_data, &test_data);
+ if (ret < 0)
goto exit;
- }
}
}
* drivers decompression checksum
*/
test_data.zlib_dir = ZLIB_COMPRESS;
- if (test_deflate_comp_decomp(&int_data, &test_data) < 0) {
- ret = TEST_FAILED;
+ ret = test_deflate_comp_decomp(&int_data, &test_data);
+ if (ret < 0)
goto exit;
- }
/* Generate compression and decompression
* checksum of selected driver
*/
test_data.zlib_dir = ZLIB_NONE;
- if (test_deflate_comp_decomp(&int_data, &test_data) < 0) {
- ret = TEST_FAILED;
+ ret = test_deflate_comp_decomp(&int_data, &test_data);
+ if (ret < 0)
goto exit;
- }
}
}
* checksum of selected driver
*/
test_data.zlib_dir = ZLIB_NONE;
- if (test_deflate_comp_decomp(&int_data, &test_data) < 0) {
- ret = TEST_FAILED;
+ ret = test_deflate_comp_decomp(&int_data, &test_data);
+ if (ret < 0)
goto exit;
- }
}
}
};
/* 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;
+ ret = test_deflate_comp_decomp(&int_data, &test_data);
+ if (ret < 0)
goto exit;
- }
/* 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;
+ ret = test_deflate_comp_decomp(&int_data, &test_data);
+ if (ret < 0)
goto exit;
- }
if (capab->comp_feature_flags & RTE_COMP_FF_OOP_SGL_IN_SGL_OUT) {
/* Compress with compressdev, decompress with Zlib */
test_data.zlib_dir = ZLIB_DECOMPRESS;
test_data.buff_type = SGL_BOTH;
- if (test_deflate_comp_decomp(&int_data, &test_data) < 0) {
- ret = TEST_FAILED;
+ ret = test_deflate_comp_decomp(&int_data, &test_data);
+ if (ret < 0)
goto exit;
- }
/* Compress with Zlib, decompress with compressdev */
test_data.zlib_dir = ZLIB_COMPRESS;
test_data.buff_type = SGL_BOTH;
- if (test_deflate_comp_decomp(&int_data, &test_data) < 0) {
- ret = TEST_FAILED;
+ ret = test_deflate_comp_decomp(&int_data, &test_data);
+ if (ret < 0)
goto exit;
- }
}
ret = TEST_SUCCESS;
{
struct comp_testsuite_params *ts_params = &testsuite_params;
uint16_t i = 0;
- int ret = TEST_SUCCESS;
+ int ret;
int j;
const struct rte_compressdev_capabilities *capab;
char *test_buffer = NULL;
/* 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;
- }
+ ret = test_deflate_comp_decomp(&int_data, &test_data);
+ if (ret < 0)
+ goto exit;
/* 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;
- }
+ ret = test_deflate_comp_decomp(&int_data, &test_data);
+ if (ret < 0)
+ goto exit;
+
+ ret = TEST_SUCCESS;
-end:
+exit:
ts_params->def_comp_xform->compress.deflate.huffman =
RTE_COMP_HUFFMAN_DEFAULT;
rte_free(test_buffer);