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

Function test_compressdev_external_mbufs

dpdk/app/test/test_compressdev.c:3100–3162  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3098}
3099
3100static int
3101test_compressdev_external_mbufs(void)
3102{
3103 struct comp_testsuite_params *ts_params = &testsuite_params;
3104 size_t data_len = 0;
3105 uint16_t i;
3106 int ret = TEST_FAILED;
3107
3108 for (i = 0; i < RTE_DIM(compress_test_bufs); i++)
3109 data_len = RTE_MAX(data_len, strlen(compress_test_bufs[i]) + 1);
3110
3111 struct interim_data_params int_data = {
3112 NULL,
3113 1,
3114 NULL,
3115 &ts_params->def_comp_xform,
3116 &ts_params->def_decomp_xform,
3117 1
3118 };
3119
3120 struct test_data_params test_data = {
3121 .compress_state = RTE_COMP_OP_STATELESS,
3122 .decompress_state = RTE_COMP_OP_STATELESS,
3123 .buff_type = LB_BOTH,
3124 .zlib_dir = ZLIB_DECOMPRESS,
3125 .out_of_space = 0,
3126 .big_data = 0,
3127 .use_external_mbufs = 1,
3128 .inbuf_data_size = data_len,
3129 .inbuf_memzone = make_memzone("inbuf", data_len),
3130 .compbuf_memzone = make_memzone("compbuf", data_len *
3131 COMPRESS_BUF_SIZE_RATIO),
3132 .uncompbuf_memzone = make_memzone("decompbuf", data_len),
3133 .overflow = OVERFLOW_DISABLED
3134 };
3135
3136 for (i = 0; i < RTE_DIM(compress_test_bufs); i++) {
3137 /* prepare input data */
3138 data_len = strlen(compress_test_bufs[i]) + 1;
3139 rte_memcpy(test_data.inbuf_memzone->addr, compress_test_bufs[i],
3140 data_len);
3141 test_data.inbuf_data_size = data_len;
3142 int_data.buf_idx = &i;
3143
3144 /* Compress with compressdev, decompress with Zlib */
3145 test_data.zlib_dir = ZLIB_DECOMPRESS;
3146 if (test_deflate_comp_decomp(&int_data, &test_data) < 0)
3147 goto exit;
3148
3149 /* Compress with Zlib, decompress with compressdev */
3150 test_data.zlib_dir = ZLIB_COMPRESS;
3151 if (test_deflate_comp_decomp(&int_data, &test_data) < 0)
3152 goto exit;
3153 }
3154
3155 ret = TEST_SUCCESS;
3156
3157exit:

Callers

nothing calls this directly

Calls 4

make_memzoneFunction · 0.85
test_deflate_comp_decompFunction · 0.85
rte_memzone_freeFunction · 0.85
rte_memcpyFunction · 0.50

Tested by

no test coverage detected