This is only for demo of the adapter proposal Goals 1. support cpu instruction accelerator 2. support switch between hardware accelerator and cpu instruction
Status 1. Existing hardware accelerator are supported. 2. Add a hisi_zlib driver to simulate cpu instruction, supported by uadk_comp
Todo: 1. how to better coexist with existing wd_xxx_init. wd_xxx_init is not a must, only required for hardware resources. On platform only support cpu, wd_xxx_init can be used, but the failure should not be treated as error.
2. how to parse workers from config, or environment.
3. how to switch between hardware and cpu, ie, add policy. Now only simply add round-robin policy: adapter_roundrobin.c The plan will add at least adapter_threshold.c, ...
https://github.com/gaozhangfei/uadk/commits/adapter https://github.com/Linaro/uadk/pull/548 the pr is only for demo, not for merge.
Zhangfei Gao (4): add adapter Adding zlib drv to simulate cpu instruction driver uadk_comp: support hisi_zlib to simulate cpu instruction wd_comp: decompress complete when length are consumed
Makefile.am | 13 +- adapter/adapter.c | 245 +++++++++++++++++++++++++++++++++++ adapter/adapter_private.h | 51 ++++++++ adapter/adapter_roundrobin.c | 90 +++++++++++++ drv/hisi_comp.c | 25 ++-- drv/hisi_hpre.c | 47 ++++--- drv/hisi_sec.c | 74 ++++++----- drv/hisi_zlib.c | 167 ++++++++++++++++++++++++ include/adapter.h | 27 ++++ include/drv/wd_aead_drv.h | 16 +-- include/drv/wd_digest_drv.h | 16 +-- include/wd_alg.h | 31 ++++- include/wd_comp.h | 3 + include/wd_util.h | 8 +- libwd.map | 7 + libwd_comp.map | 2 + sample/uadk_comp.c | 58 +++++++-- wd_aead.c | 66 +++++----- wd_alg.c | 26 ++++ wd_cipher.c | 40 ++++-- wd_comp.c | 131 ++++++++++++++----- wd_dh.c | 8 +- wd_digest.c | 66 +++++++--- wd_ecc.c | 8 +- wd_rsa.c | 8 +- wd_util.c | 17 ++- 26 files changed, 1041 insertions(+), 209 deletions(-) create mode 100644 adapter/adapter.c create mode 100644 adapter/adapter_private.h create mode 100644 adapter/adapter_roundrobin.c create mode 100644 drv/hisi_zlib.c create mode 100644 include/adapter.h