The following code defects are rectified: 1、SM4 CE does not support the epoll mode, Therefore, disable the epoll mode.
2、SM4 CE does not support sgl data format, Therefore, intercept the sgl data format.
Signed-off-by: Qi Tao taoqi10@huawei.com --- drv/isa_ce_sm4.c | 8 ++++++++ 1 file changed, 8 insertions(+)
diff --git a/drv/isa_ce_sm4.c b/drv/isa_ce_sm4.c index af0afd6..6028367 100644 --- a/drv/isa_ce_sm4.c +++ b/drv/isa_ce_sm4.c @@ -33,6 +33,9 @@
static int isa_ce_init(struct wd_alg_driver *drv, void *conf) { + struct wd_ctx_config_internal *config = conf; + + config->epoll_en = 0; return 0; }
@@ -344,6 +347,11 @@ static int isa_ce_cipher_send(struct wd_alg_driver *drv, handle_t ctx, void *wd_ return -WD_EINVAL; }
+ if (msg->data_fmt == WD_SGL_BUF) { + WD_ERR("invalid: SM4 CE driver do not support sgl data format!\n"); + return -WD_EINVAL; + } + if (msg->op_type == WD_CIPHER_ENCRYPTION || msg->mode == WD_CIPHER_CTR || msg->mode == WD_CIPHER_CFB) sm4_set_encrypt_key(msg->key, &rkey);