From: Pablo de Lara Date: Thu, 17 Oct 2019 16:30:49 +0000 (+0100) Subject: crypto/aesni_mb: allow device init if no AES-NI is present X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=fb1033a78884d9954d443a8da9c16250e90e404c;p=dpdk.git crypto/aesni_mb: allow device init if no AES-NI is present The IPSec Multi buffer library does not require AES-NI instructions to be supported by the CPU, as it can emulate these instructions in software (adding a big performance penalty when using AES algorithms). Signed-off-by: Pablo de Lara --- diff --git a/drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c b/drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c index ce1144b957..c3001cb725 100644 --- a/drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c +++ b/drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c @@ -1251,12 +1251,6 @@ cryptodev_aesni_mb_create(const char *name, enum aesni_mb_vector_mode vector_mode; MB_MGR *mb_mgr; - /* Check CPU for support for AES instruction set */ - if (!rte_cpu_get_flag_enabled(RTE_CPUFLAG_AES)) { - AESNI_MB_LOG(ERR, "AES instructions not supported by CPU"); - return -EFAULT; - } - dev = rte_cryptodev_pmd_create(name, &vdev->device, init_params); if (dev == NULL) { AESNI_MB_LOG(ERR, "failed to create cryptodev vdev"); @@ -1282,9 +1276,13 @@ cryptodev_aesni_mb_create(const char *name, dev->feature_flags = RTE_CRYPTODEV_FF_SYMMETRIC_CRYPTO | RTE_CRYPTODEV_FF_SYM_OPERATION_CHAINING | - RTE_CRYPTODEV_FF_CPU_AESNI | RTE_CRYPTODEV_FF_OOP_LB_IN_LB_OUT; + /* Check CPU for support for AES instruction set */ + if (rte_cpu_get_flag_enabled(RTE_CPUFLAG_AES)) + dev->feature_flags |= RTE_CRYPTODEV_FF_CPU_AESNI; + else + AESNI_MB_LOG(WARNING, "AES instructions not supported by CPU"); mb_mgr = alloc_mb_mgr(0); if (mb_mgr == NULL)