On 2022/11/24 下午8:27, liulongfang wrote:
On 2022/11/24 17:32, zhangfei.gao@foxmail.com wrote:
On 2022/11/24 下午3:43, liulongfang wrote:
Update the current driver adaptation and usage method, from fixed use of Hisilicon device driver to automatic registration of the driver according to the algorithm.
When the algorithm API layer uses the driver, it is no longer bound to the fixed device driver, but dynamically obtained and stored according to the algorithm query to use.
Any example? not understand this. Does applications need to be changed?
.
For example: static void __attribute__((constructor)) wd_cipher_open_driver(void) { wd_cipher_setting.dlhandle = dlopen("libhisi_sec.so", RTLD_NOW); if (!wd_cipher_setting.dlhandle) WD_ERR("failed to open libhisi_sec.so, %s\n", dlerror()); }
This is the fixed code writing method between the cipher API and the corresponding HiSilicon sec accelerator driver.
It is recommended that you apply the patch to the latest uadk mainline branch. Here, the zip API and driver are modified together. It is very clear to look at the code directly.
The patches can not be applied to the uadk master branch Could you send pr, or push to some branch for easier review.
I still don't understand how to use it. For example. there are two algorithms registered, one hardware, one software, The big package go to hardware, while the small package go to software. Can we handle this case.
We can refer dpdk crypto scheduler. http://doc.dpdk.org/guides/cryptodevs/scheduler.html
"A typical use case in this mode is with the QAT cryptodev as the primary and a software cryptodev as the secondary worker. This may help applications to process additional crypto workload than what the QAT cryptodev can handle on its own, by making use of the available CPU cycles to deal with smaller crypto workloads."
But dpdk crypto scheduler is cut off the call back, so it has to handler differently with different algorithms such as crypto and compress.
Normal case app -> crypto's call back
When crypto scheduler is registered app -> crypto scheduler's call back -> distribution mechanism -> uadk crypto's call back -> software crypto's call back
Thanks