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 4699EA0546; Thu, 16 Jul 2020 18:00:29 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id B34281BF93; Thu, 16 Jul 2020 18:00:15 +0200 (CEST) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by dpdk.org (Postfix) with ESMTP id 0C5091BF72 for ; Thu, 16 Jul 2020 18:00:11 +0200 (CEST) IronPort-SDR: SlUqNhdtV1mRTRhYGtILupoL46/e9MLM1/aTEYSFuoeiONJHfJNMsN0/HZRqaq8f9HKYZYSrCa cMYKIiU+MDaw== X-IronPort-AV: E=McAfee;i="6000,8403,9684"; a="234275734" X-IronPort-AV: E=Sophos;i="5.75,359,1589266800"; d="scan'208";a="234275734" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Jul 2020 09:00:11 -0700 IronPort-SDR: DouCGvojIKQ+GSaNpMFwfuKSEdBWcbdnu3UoCsdcqaF91Ca0PRiuWL5urCZ4QIGdCFYiZcXUeG GA1Vf1n8jHDQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,359,1589266800"; d="scan'208";a="486152305" Received: from silpixa00399912.ir.intel.com (HELO silpixa00399912.ger.corp.intel.com) ([10.237.223.64]) by fmsmga006.fm.intel.com with ESMTP; 16 Jul 2020 09:00:09 -0700 From: David Coyle To: akhil.goyal@nxp.com, declan.doherty@intel.com, pablo.de.lara.guarch@intel.com, fiona.trahe@intel.com Cc: dev@dpdk.org, brendan.ryan@intel.com, mairtin.oloingsigh@intel.com, David Coyle Date: Thu, 16 Jul 2020 16:36:00 +0100 Message-Id: <20200716153600.66071-3-david.coyle@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200716153600.66071-1-david.coyle@intel.com> References: <20200716153600.66071-1-david.coyle@intel.com> Subject: [dpdk-dev] [PATCH v1 2/2] crypto/aesni_mb: improve security instance setup 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" This patch makes some minor improvements to the security instance setup for the AESNI-MB PMD. All of this setup code is now in one '#ifdef AESNI_MB_DOCSIS_SEC_ENABLED' block. Enabling the RTE_CRYPTODEV_FF_SECURITY feature for the device is also moved to this block. Fixes: fda5216fba55 ("crypto/aesni_mb: support DOCSIS protocol") Signed-off-by: David Coyle --- drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c b/drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c index b54c57f86..171d914a3 100644 --- a/drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c +++ b/drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c @@ -1881,9 +1881,6 @@ cryptodev_aesni_mb_create(const char *name, struct aesni_mb_private *internals; enum aesni_mb_vector_mode vector_mode; MB_MGR *mb_mgr; -#ifdef AESNI_MB_DOCSIS_SEC_ENABLED - struct rte_security_ctx *security_instance; -#endif dev = rte_cryptodev_pmd_create(name, &vdev->device, init_params); if (dev == NULL) { @@ -1912,13 +1909,10 @@ cryptodev_aesni_mb_create(const char *name, RTE_CRYPTODEV_FF_SYM_OPERATION_CHAINING | RTE_CRYPTODEV_FF_OOP_LB_IN_LB_OUT | RTE_CRYPTODEV_FF_SYM_CPU_CRYPTO | - RTE_CRYPTODEV_FF_SYM_SESSIONLESS -#ifdef AESNI_MB_DOCSIS_SEC_ENABLED - | RTE_CRYPTODEV_FF_SECURITY -#endif - ; + RTE_CRYPTODEV_FF_SYM_SESSIONLESS; #ifdef AESNI_MB_DOCSIS_SEC_ENABLED + struct rte_security_ctx *security_instance; security_instance = rte_malloc("aesni_mb_sec", sizeof(struct rte_security_ctx), RTE_CACHE_LINE_SIZE); @@ -1932,6 +1926,7 @@ cryptodev_aesni_mb_create(const char *name, security_instance->ops = rte_aesni_mb_pmd_sec_ops; security_instance->sess_cnt = 0; dev->security_ctx = security_instance; + dev->feature_flags |= RTE_CRYPTODEV_FF_SECURITY; #endif /* Check CPU for support for AES instruction set */ @@ -2011,7 +2006,7 @@ cryptodev_aesni_mb_remove(struct rte_vdev_device *vdev) RTE_PER_LCORE(sync_mb_mgr) = NULL; } -#ifdef RTE_LIBRTE_SECURITY +#ifdef AESNI_MB_DOCSIS_SEC_ENABLED rte_free(cryptodev->security_ctx); #endif -- 2.17.1