MCPcopy Create free account
hub / github.com/F-Stack/f-stack / test_compressdev_deflate_stateless_sgl

Function test_compressdev_deflate_stateless_sgl

dpdk/app/test/test_compressdev.c:2505–2589  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2503}
2504
2505static int
2506test_compressdev_deflate_stateless_sgl(void)
2507{
2508 struct comp_testsuite_params *ts_params = &testsuite_params;
2509 uint16_t i;
2510 int ret;
2511 const struct rte_compressdev_capabilities *capab;
2512
2513 capab = rte_compressdev_capability_get(0, RTE_COMP_ALGO_DEFLATE);
2514 TEST_ASSERT(capab != NULL, "Failed to retrieve device capabilities");
2515
2516 if ((capab->comp_feature_flags & RTE_COMP_FF_OOP_SGL_IN_SGL_OUT) == 0)
2517 return -ENOTSUP;
2518
2519 struct interim_data_params int_data = {
2520 NULL,
2521 1,
2522 NULL,
2523 &ts_params->def_comp_xform,
2524 &ts_params->def_decomp_xform,
2525 1
2526 };
2527
2528 struct test_data_params test_data = {
2529 .compress_state = RTE_COMP_OP_STATELESS,
2530 .decompress_state = RTE_COMP_OP_STATELESS,
2531 .buff_type = SGL_BOTH,
2532 .zlib_dir = ZLIB_DECOMPRESS,
2533 .out_of_space = 0,
2534 .big_data = 0,
2535 .overflow = OVERFLOW_DISABLED,
2536 .ratio = RATIO_ENABLED
2537 };
2538
2539 for (i = 0; i < RTE_DIM(compress_test_bufs); i++) {
2540 int_data.test_bufs = &compress_test_bufs[i];
2541 int_data.buf_idx = &i;
2542
2543 /* Compress with compressdev, decompress with Zlib */
2544 test_data.zlib_dir = ZLIB_DECOMPRESS;
2545 ret = test_deflate_comp_decomp(&int_data, &test_data);
2546 if (ret < 0)
2547 return ret;
2548
2549 /* Compress with Zlib, decompress with compressdev */
2550 test_data.zlib_dir = ZLIB_COMPRESS;
2551 ret = test_deflate_comp_decomp(&int_data, &test_data);
2552 if (ret < 0)
2553 return ret;
2554
2555 if (capab->comp_feature_flags & RTE_COMP_FF_OOP_SGL_IN_LB_OUT) {
2556 /* Compress with compressdev, decompress with Zlib */
2557 test_data.zlib_dir = ZLIB_DECOMPRESS;
2558 test_data.buff_type = SGL_TO_LB;
2559 ret = test_deflate_comp_decomp(&int_data, &test_data);
2560 if (ret < 0)
2561 return ret;
2562

Callers

nothing calls this directly

Calls 2

test_deflate_comp_decompFunction · 0.85

Tested by

no test coverage detected