From: Wenkai Lin linwenkai6@hisilicon.com
If task type is uninit, it will be zero, which is mistook as a cipher task and cause a recv timeout problem, so use 0x1 as start value of task type is better.
Signed-off-by: Wenkai Lin linwenkai6@hisilicon.com Signed-off-by: JiangShui Yang yangjiangshui@h-partners.com --- src/uadk_async.c | 2 +- src/uadk_async.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/uadk_async.c b/src/uadk_async.c index aa1407b..3879687 100644 --- a/src/uadk_async.c +++ b/src/uadk_async.c @@ -310,7 +310,7 @@ int async_wake_job(ASYNC_JOB *job)
void async_register_poll_fn(int type, async_recv_t func) { - if (type < 0 || type >= ASYNC_TASK_MAX) { + if (type < ASYNC_TASK_CIPHER || type >= ASYNC_TASK_MAX) { fprintf(stderr, "alg type is error, type= %d.\n", type); return; } diff --git a/src/uadk_async.h b/src/uadk_async.h index 5d73b60..5afc3c6 100644 --- a/src/uadk_async.h +++ b/src/uadk_async.h @@ -42,7 +42,7 @@ struct uadk_e_cb_info { typedef int (*async_recv_t)(void *ctx);
enum task_type { - ASYNC_TASK_CIPHER, + ASYNC_TASK_CIPHER = 0x1, ASYNC_TASK_DIGEST, ASYNC_TASK_AEAD, ASYNC_TASK_RSA,