Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adapter 5.25 #557

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Open

Adapter 5.25 #557

wants to merge 10 commits into from

Commits on Jul 19, 2023

  1. uadk: wd_find_drv with drv_name and alg_name

    Add wd_find_drv to find drv with drv_name and alg_name,
    considering several drivers supporting same alg.
    
    Also add UADK_ALG_ADAPT to compat with init2 interface
    
    Signed-off-by: Zhangfei Gao <[email protected]>
    zhangfeigao committed Jul 19, 2023
    Configuration menu
    Copy the full SHA
    c15eac6 View commit details
    Browse the repository at this point in the history
  2. uadk: add adapter to support multi-accelerators

    Interface:
    	uadk_adapter_alloc;
    	uadk_adapter_free;
    	uadk_adapter_set_mode;
    	uadk_adapter_attach_worker;
    	uadk_adapter_parse;
    	uadk_adapter_config
    
    Supported mode: round-robin, threshold
    
    Signed-off-by: Zhangfei Gao <[email protected]>
    zhangfeigao committed Jul 19, 2023
    Configuration menu
    Copy the full SHA
    20f5545 View commit details
    Browse the repository at this point in the history
  3. Adding zlib drv to simulate cpu instruction driver

    In order to simulate cpu instruction accelerator, this patch adds
    zlib drv, which does not require accelerator at all.
    So may not require wd_xxx_init, and ctx and sched which relates
    to queue.
    
    Btw, zlib is required.
    apt-get install zlib1g-dev
    
    Signed-off-by: Zhangfei Gao <[email protected]>
    zhangfeigao committed Jul 19, 2023
    Configuration menu
    Copy the full SHA
    b041f54 View commit details
    Browse the repository at this point in the history
  4. uadk/alg: let UADK_ALG_SOFT register to uadk

    Will use hisi_zlib to test adapter, so let UADK_ALG_SOFT register to uadk
    
    Signed-off-by: Zhangfei Gao <[email protected]>
    zhangfeigao committed Jul 19, 2023
    Configuration menu
    Copy the full SHA
    388ed22 View commit details
    Browse the repository at this point in the history
  5. hack: move length to the head of msg

    Threshold mode need get msg length from msg, and compare length
    with threhold to decide using hardware or software accelerator.
    
    However msg struct are not same.
    Hack move length to the head of msg.
    
    Hack with digest, cipher, aead: in_bytess
    
    struct wd_rsa_req: __u32 src_bytes
    struct wd_ecc_req: __u32 src_bytes
    struct wd_dh_msg: ?
    struct wd_comp_msg: __u32 in_cons?
    
    Signed-off-by: Zhangfei Gao <[email protected]>
    zhangfeigao committed Jul 19, 2023
    Configuration menu
    Copy the full SHA
    e454c01 View commit details
    Browse the repository at this point in the history
  6. uadk/digest: use adapter

    init interface switch to adapter
    init2 interface use adapter for MIX mode
    
    Test:
    
    uadk_tool test --m sec --digest 0 --sync --optype 0 --pktlen 16 \
    	--keylen 16 --times 1 --multi 1
    
    uadk_tool test --m sec --digest 0 --sync --optype 0 --pktlen 16 \
    	--keylen 16 --times 1 --multi 1 --init 2
    
    Signed-off-by: Zhangfei Gao <[email protected]>
    zhangfeigao committed Jul 19, 2023
    Configuration menu
    Copy the full SHA
    e3dc688 View commit details
    Browse the repository at this point in the history
  7. wd_comp: use adapter via init2

    Switch to adapter interface via init2 interface
    
    Test:
    uadk_tool benchmark --alg zlib --mode sva --opt 0 --sync --pktlen 1024 \
    	--seconds 1 --multi 1 --thread 1
    
    Test
    only hisi_zlib
    only hisi_zip
    Both hisi_zlib and hisi_zip, using round-robin as default mode.
    
    Signed-off-by: Zhangfei Gao <[email protected]>
    zhangfeigao committed Jul 19, 2023
    Configuration menu
    Copy the full SHA
    3373ee4 View commit details
    Browse the repository at this point in the history
  8. wd_comp: decompress complete when length are consumed

    driver can only update length
     msg->produced = msg->req.dst_len - strm.avail_out;
     msg->in_cons = msg->req.src_len;
    status is decided by caller
    
    // not sure about this patch,
    with this patch, compress and decompress are both OK
    
    ./sample/uadk_comp --optype 0 --alg gzip <src >out
    ./sample/uadk_comp --optype 1 --alg gzip <out >dst
    vimdiff src dst
    
    Signed-off-by: Zhangfei Gao <[email protected]>
    zhangfeigao committed Jul 19, 2023
    Configuration menu
    Copy the full SHA
    8e37742 View commit details
    Browse the repository at this point in the history
  9. sample/uadk_comp: use init2 interface

    switch to init2 interface, which use adapter
    
    Test:
    func()
    {
    	uadk_comp  --optype 0 --alg $1 <src >out
    	uadk_comp  --optype 1 --alg $1 <out >dst
    	vimdiff dst src
    }
    func gzip
    func zlib
    
    Signed-off-by: Zhangfei Gao <[email protected]>
    zhangfeigao committed Jul 19, 2023
    Configuration menu
    Copy the full SHA
    78de832 View commit details
    Browse the repository at this point in the history
  10. wd_comp: test threshold

    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]>
    zhangfeigao committed Jul 19, 2023
    Configuration menu
    Copy the full SHA
    ea08f0c View commit details
    Browse the repository at this point in the history