From patchwork Fri Oct 25 08:33:34 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 177708 Delivered-To: patch@linaro.org Received: by 2002:ac9:3c86:0:0:0:0:0 with SMTP id w6csp3287465ocf; Fri, 25 Oct 2019 01:37:14 -0700 (PDT) X-Google-Smtp-Source: APXvYqwFFsEuMzs2Qa+LNBXg+/APgh1q5O89vPYJPxAGDqVjvfQ6H1E2e3RDLek7ZRXD0CNq/VSX X-Received: by 2002:a17:906:22cc:: with SMTP id q12mr2286727eja.131.1571992634677; Fri, 25 Oct 2019 01:37:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571992634; cv=none; d=google.com; s=arc-20160816; b=fXGGzRsMjp+CIWl/8g8Y1KgXXxBJEjdkys9nVDdkksqecwvDbkl5nq3S0+AD3Wrmnx zJ3x2s9TOQn5fqxW/A1SrFLhOTjNQfKlNuiHWNNpdXRDtK7YLD4mbq5/SY0U1sJxKvcM +PiG6GEfirB0d01wkI4EVAphTWNK+fkfPXRQNMKSNWxlUAylZq/kmzlb9xfotXxlMcro LHto7sWDFpnmuvQF4z69HdOLpXwA9Fo8J3V72zYr2CiQqUjnbAigSMeBL6xQUbg1cADl LD2RvYxztf/E9eUwOKiXzWzGWgPMM0cE45vNoumKPl0KOK93SZFk6GSJMxPu3+4oMs2O 2BDg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:references:in-reply-to :message-id:date:cc:to:from; bh=U5thSZ4uT8DvlMrwUPNuAljWdtiiK99RTiwBOyJrIcg=; b=CuWNrQzYA0NN+mzAcvSoiPI6r9/Fg73X8tGGaa/qMLOQjTato5IuE8d7ojjJHDqi2i MN9buv2wcKC8z4Mw7Cs61A9FcJUNRd2B3NLatVU2FwRFkzC6Br2j96ER+FEZ4fdvKKAt ORPqFKiktJgNad06HYgMvneCqq3WJ8t017+ts7fSaWOqi7pFp0lgLuWkpwkBpfIydXM5 bK3OQkSJYC0QPgZE/01ViTC9Iw8NdIZq0FoPbImG+KzImP61923kWKQDkSP+NMxvYuex 2kmC1y4WoAxqgCt6oKIbI8Mc2iWrhNItdHWzi7TtZ0rBMlCfTBAUG/22K5kSLncTFUZG Krgg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from dpdk.org (dpdk.org. [92.243.14.124]) by mx.google.com with ESMTP id d9si630964ejt.32.2019.10.25.01.37.14; Fri, 25 Oct 2019 01:37:14 -0700 (PDT) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) client-ip=92.243.14.124; Authentication-Results: mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id A705D1E8FA; Fri, 25 Oct 2019 10:36:45 +0200 (CEST) Received: from inva021.nxp.com (inva021.nxp.com [92.121.34.21]) by dpdk.org (Postfix) with ESMTP id 3236F1BEFA for ; Fri, 25 Oct 2019 10:36:35 +0200 (CEST) Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 17609200068; Fri, 25 Oct 2019 10:36:35 +0200 (CEST) Received: from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com [165.114.16.14]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 487E720043F; Fri, 25 Oct 2019 10:36:33 +0200 (CEST) Received: from bf-netperf1.ap.freescale.net (bf-netperf1.ap.freescale.net [10.232.133.63]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id 8165D4030B; Fri, 25 Oct 2019 16:36:30 +0800 (SGT) From: Hemant Agrawal To: dev@dpdk.org, akhil.goyal@nxp.com Cc: Hemant Agrawal Date: Fri, 25 Oct 2019 14:03:34 +0530 Message-Id: <20191025083336.24212-6-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191025083336.24212-1-hemant.agrawal@nxp.com> References: <20191025083336.24212-1-hemant.agrawal@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Subject: [dpdk-dev] [PATCH 6/8] crypto/dpaa2_sec: add AES-GCM support for lookaside case 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" Signed-off-by: Hemant Agrawal --- drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c | 34 +++++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) -- 2.17.1 diff --git a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c index 7652c7431..ba9ba4bd7 100644 --- a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c +++ b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c @@ -2550,12 +2550,40 @@ dpaa2_sec_ipsec_aead_init(struct rte_crypto_aead_xform *aead_xform, switch (aead_xform->algo) { case RTE_CRYPTO_AEAD_AES_GCM: - aeaddata->algtype = OP_ALG_ALGSEL_AES; + switch (session->digest_length) { + case 8: + aeaddata->algtype = OP_PCL_IPSEC_AES_GCM8; + break; + case 12: + aeaddata->algtype = OP_PCL_IPSEC_AES_GCM12; + break; + case 16: + aeaddata->algtype = OP_PCL_IPSEC_AES_GCM16; + break; + default: + DPAA2_SEC_ERR("Crypto: Undefined GCM digest %d", + session->digest_length); + return -1; + } aeaddata->algmode = OP_ALG_AAI_GCM; session->aead_alg = RTE_CRYPTO_AEAD_AES_GCM; break; case RTE_CRYPTO_AEAD_AES_CCM: - aeaddata->algtype = OP_ALG_ALGSEL_AES; + switch (session->digest_length) { + case 8: + aeaddata->algtype = OP_PCL_IPSEC_AES_CCM8; + break; + case 12: + aeaddata->algtype = OP_PCL_IPSEC_AES_CCM12; + break; + case 16: + aeaddata->algtype = OP_PCL_IPSEC_AES_CCM16; + break; + default: + DPAA2_SEC_ERR("Crypto: Undefined CCM digest %d", + session->digest_length); + return -1; + } aeaddata->algmode = OP_ALG_AAI_CCM; session->aead_alg = RTE_CRYPTO_AEAD_AES_CCM; break; @@ -2764,6 +2792,8 @@ dpaa2_sec_set_ipsec_session(struct rte_cryptodev *dev, aead_xform = &conf->crypto_xform->aead; ret = dpaa2_sec_ipsec_aead_init(aead_xform, session, &cipherdata); + authdata.keylen = 0; + authdata.algtype = 0; } else { DPAA2_SEC_ERR("XFORM not specified"); ret = -EINVAL;