From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 30411A0547; Thu, 28 Oct 2021 18:52:48 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C4909410FA; Thu, 28 Oct 2021 18:52:45 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by mails.dpdk.org (Postfix) with ESMTP id 82A3B410F7 for ; Thu, 28 Oct 2021 18:52:44 +0200 (CEST) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 19SA5XK1022095 for ; Thu, 28 Oct 2021 09:52:43 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=pfpt0220; bh=cWAq6xKNxzG6b/ElOmp527NoIqtFITW2ZBtU8AENVyI=; b=jQY+si5d5JVgknW7fs3e9NgpSqwT8iTkPHG249zo6u3vBefjbt4FqiNUnLypBUQS/AOZ kleH6+EyD4g+yi+v8n/lkvDh9JGaQd1Xsvh0JJW2Onv+zZCqgkalEbpYbSiEyYDuszr3 EQSLahpsdJxDuF1OnT0fYrvLi+ht0lIoBwBm/vJAvSbfTIUZu56XeVqZnFgOgu7c3vHe pct9EN+M+SH05Dv0FLWkvqvk3qiCJTautIOr3ffV9q/w73gwgGGD+sHS29EZzoY+rW0f XP+8WhFnTC4jcpdVtkI86378A0rfBNs9ogiZbQdgYe2iikhCjRRg4IBFa4gz4XYH08mX xA== Received: from dc5-exch02.marvell.com ([199.233.59.182]) by mx0b-0016f401.pphosted.com with ESMTP id 3byd2fcpx2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT) for ; Thu, 28 Oct 2021 09:52:42 -0700 Received: from DC5-EXCH01.marvell.com (10.69.176.38) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Thu, 28 Oct 2021 09:52:40 -0700 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server id 15.0.1497.18 via Frontend Transport; Thu, 28 Oct 2021 09:52:40 -0700 Received: from hyd1409.caveonetworks.com.com (unknown [10.29.45.15]) by maili.marvell.com (Postfix) with ESMTP id B99673F7065; Thu, 28 Oct 2021 09:52:38 -0700 (PDT) From: Archana Muniganti To: CC: Anoob Joseph , , , Date: Thu, 28 Oct 2021 22:22:23 +0530 Message-ID: <20211028165228.14603-2-marchana@marvell.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20211028165228.14603-1-marchana@marvell.com> References: <20211028165228.14603-1-marchana@marvell.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-ORIG-GUID: Q9Bw7_jyLS4LQmTusfCCZfqdMsVkR5z4 X-Proofpoint-GUID: Q9Bw7_jyLS4LQmTusfCCZfqdMsVkR5z4 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.182.1,Aquarius:18.0.790,Hydra:6.0.425,FMLib:17.0.607.475 definitions=2021-10-28_04,2021-10-26_01,2020-04-07_01 Subject: [dpdk-dev] [PATCH 1/6] common/cnxk: add null auth with IPsec X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 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" From: Anoob Joseph Add support for null auth with IPsec operations on cn10k. Signed-off-by: Anoob Joseph --- drivers/common/cnxk/cnxk_security.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/drivers/common/cnxk/cnxk_security.c b/drivers/common/cnxk/cnxk_security.c index ae3baf62ca..30562b46e3 100644 --- a/drivers/common/cnxk/cnxk_security.c +++ b/drivers/common/cnxk/cnxk_security.c @@ -116,8 +116,18 @@ ot_ipsec_sa_common_param_fill(union roc_ot_ipsec_sa_word2 *w2, } switch (auth_xfrm->auth.algo) { + case RTE_CRYPTO_AUTH_NULL: + w2->s.auth_type = ROC_IE_OT_SA_AUTH_NULL; + break; case RTE_CRYPTO_AUTH_SHA1_HMAC: w2->s.auth_type = ROC_IE_OT_SA_AUTH_SHA1; + ipsec_hmac_opad_ipad_gen(auth_xfrm, hmac_opad_ipad); + + tmp_key = (uint64_t *)hmac_opad_ipad; + for (i = 0; i < (int)(ROC_CTX_MAX_OPAD_IPAD_LEN / + sizeof(uint64_t)); + i++) + tmp_key[i] = rte_be_to_cpu_64(tmp_key[i]); break; default: return -ENOTSUP; @@ -125,14 +135,6 @@ ot_ipsec_sa_common_param_fill(union roc_ot_ipsec_sa_word2 *w2, key = cipher_xfrm->cipher.key.data; length = cipher_xfrm->cipher.key.length; - - ipsec_hmac_opad_ipad_gen(auth_xfrm, hmac_opad_ipad); - - tmp_key = (uint64_t *)hmac_opad_ipad; - for (i = 0; - i < (int)(ROC_CTX_MAX_OPAD_IPAD_LEN / sizeof(uint64_t)); - i++) - tmp_key[i] = rte_be_to_cpu_64(tmp_key[i]); } /* Set encapsulation type */ -- 2.22.0