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 73678A317C for ; Thu, 17 Oct 2019 18:31:05 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id F41141E9C1; Thu, 17 Oct 2019 18:30:59 +0200 (CEST) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id 3511D1E8EF for ; Thu, 17 Oct 2019 18:30:57 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 17 Oct 2019 09:30:56 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.67,308,1566889200"; d="scan'208";a="226224808" Received: from silpixa00399593.ir.intel.com (HELO silpixa00399593.ger.corp.intel.com) ([10.237.223.21]) by fmsmga002.fm.intel.com with ESMTP; 17 Oct 2019 09:30:56 -0700 From: Pablo de Lara To: dev@dpdk.org Cc: Pablo de Lara Date: Thu, 17 Oct 2019 17:30:50 +0100 Message-Id: <1571329850-241335-2-git-send-email-pablo.de.lara.guarch@intel.com> X-Mailer: git-send-email 2.7.5 In-Reply-To: <1571329850-241335-1-git-send-email-pablo.de.lara.guarch@intel.com> References: <1571329213-240529-1-git-send-email-pablo.de.lara.guarch@intel.com> <1571329850-241335-1-git-send-email-pablo.de.lara.guarch@intel.com> Subject: [dpdk-dev] [PATCH v2 2/2] crypto/aesni_gcm: 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 --- v2: - Fixed leading whitespaces drivers/crypto/aesni_gcm/aesni_gcm_pmd.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/crypto/aesni_gcm/aesni_gcm_pmd.c b/drivers/crypto/aesni_gcm/aesni_gcm_pmd.c index 1006a5c..f029362 100644 --- a/drivers/crypto/aesni_gcm/aesni_gcm_pmd.c +++ b/drivers/crypto/aesni_gcm/aesni_gcm_pmd.c @@ -491,11 +491,6 @@ aesni_gcm_create(const char *name, enum aesni_gcm_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_GCM_LOG(ERR, "AES instructions not supported by CPU"); - return -EFAULT; - } dev = rte_cryptodev_pmd_create(name, &vdev->device, init_params); if (dev == NULL) { AESNI_GCM_LOG(ERR, "driver %s: create failed", @@ -522,10 +517,15 @@ aesni_gcm_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_SGL_IN_LB_OUT | 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_GCM_LOG(WARNING, "AES instructions not supported by CPU"); + mb_mgr = alloc_mb_mgr(0); if (mb_mgr == NULL) return -ENOMEM; -- 2.7.5