From: Yang Shen <shenyang39@huawei.com> The zlibwrapper is used for some users who want to use the uadk library without changing the app source code broad. They can change the app compression api only by calling the uadk zlibwrapper interface. But there are some limits left for uadk zlibwrapper use scenes. First, only some useful interfaces are realized. The zlibwrapper only support test compression and decompression. Second, the zlib library has multiple flush types. But the uadk compression now only support the Z_SYNC_FLUSH and Z_FINISH, others are illegal. Signed-off-by: Yang Shen <shenyang39@huawei.com> --- wd_zlibwrapper.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/wd_zlibwrapper.c b/wd_zlibwrapper.c index 4e20346..8f32f0f 100644 --- a/wd_zlibwrapper.c +++ b/wd_zlibwrapper.c @@ -62,6 +62,14 @@ static int wd_zlib_uadk_init(void) cparams.op_type_num = WD_DIR_MAX; cparams.ctx_set_num = ctx_set_num; + cparams.bmp = numa_allocate_nodemask(); + if (!cparams.bmp) { + WD_ERR("failed to create nodemask!\n"); + ret = Z_MEM_ERROR; + goto out_freectx; + } + + numa_bitmask_setall(cparams.bmp); for (i = 0; i < WD_DIR_MAX; i++) ctx_set_num[i].sync_ctx_num = WD_DIR_MAX; @@ -69,9 +77,16 @@ static int wd_zlib_uadk_init(void) ret = wd_comp_init2_("zlib", 0, 0, &cparams); if (ret && ret != -WD_EEXIST) { ret = Z_STREAM_ERROR; + goto out_freebmp; + } + ret = 0; zlib_status = WD_ZLIB_INIT; +out_freebmp: + numa_free_nodemask(cparams.bmp); + +out_freectx: free(ctx_set_num); return ret; -- 2.33.0