From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 7B5EEA317C for ; Thu, 17 Oct 2019 18:20:25 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 3A1861D429; Thu, 17 Oct 2019 18:20:24 +0200 (CEST) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by dpdk.org (Postfix) with ESMTP id C5D3D1D428 for ; Thu, 17 Oct 2019 18:20:22 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 17 Oct 2019 09:20:21 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.67,308,1566889200"; d="scan'208";a="202433007" Received: from silpixa00399593.ir.intel.com (HELO silpixa00399593.ger.corp.intel.com) ([10.237.223.21]) by FMSMGA003.fm.intel.com with ESMTP; 17 Oct 2019 09:20:21 -0700 From: Pablo de Lara To: dev@dpdk.org Cc: Pablo de Lara Date: Thu, 17 Oct 2019 17:20:12 +0100 Message-Id: <1571329213-240529-1-git-send-email-pablo.de.lara.guarch@intel.com> X-Mailer: git-send-email 2.7.5 Subject: [dpdk-dev] [PATCH 1/2] crypto/aesni_mb: allow device init if no AES-NI is present X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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 --- drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c b/drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c index ce1144b..7875d6d 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,14 @@ 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) -- 2.7.5