Skip to content

Commit

Permalink
wd_comp: test threshold
Browse files Browse the repository at this point in the history
use hisi_zip if >= threshold
use hisi_zlib if < threshold

Test:

uadk_tool benchmark --alg zlib --mode sva --opt 0 --sync --pktlen 1024 --seconds 1 --multi 1 --thread 1
uadk_tool benchmark --alg zlib --mode sva --opt 0 --sync --pktlen 10240 --seconds 1 --multi 1 --thread 1

Signed-off-by: Zhangfei Gao <[email protected]>
  • Loading branch information
zhangfeigao committed Jun 8, 2023
1 parent 8348928 commit c554ad8
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
2 changes: 2 additions & 0 deletions include/drv/wd_comp_drv.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ enum wd_comp_state {

/* fixme wd_comp_msg */
struct wd_comp_msg {
/* in bytes */
__u32 in_bytes;
struct wd_comp_req req;
/* Denoted HW ctx cache, for stream mode */
void *ctx_buf;
Expand Down
12 changes: 10 additions & 2 deletions wd_comp.c
Original file line number Diff line number Diff line change
Expand Up @@ -278,8 +278,15 @@ int wd_comp_init2_(char *alg, __u32 sched_type, int task_type, struct wd_ctx_par
wd_alg_driver_init(adapter, NULL);
}

if (found > 1)
uadk_adapter_set_mode(adapter, UADK_ADAPT_MODE_ROUNDROBIN);
if (found > 1) {
/* fixme, should detect env */
//uadk_adapter_set_mode(adapter, UADK_ADAPT_MODE_ROUNDROBIN);

struct uadk_adapter_threshold_cfg cfg;
uadk_adapter_set_mode(adapter, UADK_ADAPT_MODE_THRESHOLD);
cfg.threshold = 16 * 1024;
uadk_adapter_config(adapter, &cfg);
}
} else {
/* Get alg driver and dev name */
wd_comp_setting.driver = wd_alg_drv_bind(task_type, alg);
Expand Down Expand Up @@ -516,6 +523,7 @@ static void fill_comp_msg(struct wd_comp_sess *sess, struct wd_comp_msg *msg,
{
memcpy(&msg->req, req, sizeof(struct wd_comp_req));

msg->in_bytes = req->src_len;
msg->alg_type = sess->alg_type;
msg->comp_lv = sess->comp_lv;
msg->win_sz = sess->win_sz;
Expand Down

0 comments on commit c554ad8

Please sign in to comment.