uadk targets to support more accelerators, including cpu instruction (isa ce and isa sve) and other vendors.
Required from Fanghao
1. How to support these accelerators in the uadk framework, now uadk only support HiSilicon accelerator.
2. How to switch between these accelerators to get full performance.
大概的想法,参考dpdk
1. scheduler也是一个驱动,采用同样的驱动接口ops
2. 必选的驱动,buildin,简化动态加载
3. 该驱动权限更高,接管所有ops,
4. scheduler驱动可带多个workers, 即真正的加速器驱动,scheduler -> workers。
5. scheduler驱动接管所有ops,再根据policy,分发给workers。
6. 最简单是直接转发给默认worker,当worker_num=1,忽略policy.
7. alloc_scheduler(default_worker)传默认worker, 后续再解析环境变量,config文件或者参数传递,增加其他worker。
8. 加速器驱动不用主动注册到uadk,因为需要dlopen->probe,parse scheduler worker参数的时候再解析,类似qemu,
before: app -> crypto/compress api -> ops -> driver ops
now: app -> crypto/compress api -> ops -> scheduler ops -> policy -> driver a ops
-> driver b ops
1. longfang, 名字->adapter
2. shengyang: request_ctx, 没有加速器会失败,用户程序忽略错误,用户程序看下。
3. wd_xxx_init->alloc_sheduler时需要缺省worker, 如何定,直接hardcode,或者wd_xxx_init解析环境?
4. alloc_scheduler woker[8] 简单用数组,还是链表之类,不限制个数
5. worker相同是否要支持。
no big uapi change
required one api for setting para. (env, conf, para setting)
1. 要求前提:所有驱动ops相同, comp, crypto,未来指令加速驱动?
struct wd_alg_driver {
const char *drv_name;
const char *alg_name;
~
int (*init)(void *conf, void *priv);
void (*exit)(void *priv);
int (*send)(handle_t ctx, void *drv_msg);
int (*recv)(handle_t ctx, void *drv_msg);
int (*get_usage)(void *param);
};
2. 一种算法,一个scheduler? (可以多个woker/driver)
wd_xxx_init -> alloc_scheduler
3. 为简化, worker 暂时只增加不减少,初始化的时候,parse条件,一步到位,
先不考虑动态减少worker的情况。后面看情况
4. 为简化,暂时不提供动态修改参数的api,诸如threshold.
1. 参数传递
... --vdev "crypto_aesni_mb0,name=aesni_mb_1" --vdev "crypto_aesni_mb1,name=aesni_mb_2" --vdev "crypto_scheduler,worker=aesni_mb_1,worker=aesni_mb_2" ...