DPDK patches and discussions
 help / color / mirror / Atom feed
From: Archana Muniganti <marchana@marvell.com>
To: <gakhil@marvell.com>
Cc: Anoob Joseph <anoobj@marvell.com>, <ktejasree@marvell.com>,
	<adwivedi@marvell.com>, <dev@dpdk.org>
Subject: [dpdk-dev] [PATCH 1/6] common/cnxk: add null auth with IPsec
Date: Thu, 28 Oct 2021 22:22:23 +0530	[thread overview]
Message-ID: <20211028165228.14603-2-marchana@marvell.com> (raw)
In-Reply-To: <20211028165228.14603-1-marchana@marvell.com>

From: Anoob Joseph <anoobj@marvell.com>

Add support for null auth with IPsec operations on cn10k.

Signed-off-by: Anoob Joseph <anoobj@marvell.com>
---
 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


  reply	other threads:[~2021-10-28 16:52 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-28 16:52 [dpdk-dev] [PATCH 0/6] add cnxk lookaside IPsec additional features Archana Muniganti
2021-10-28 16:52 ` Archana Muniganti [this message]
2021-10-28 16:52 ` [dpdk-dev] [PATCH 2/6] crypto/cnxk: add null auth Archana Muniganti
2021-10-28 16:52 ` [dpdk-dev] [PATCH 3/6] crypto/cnxk: add cn9k ESN and anti-replay support Archana Muniganti
2021-10-28 16:52 ` [dpdk-dev] [PATCH 4/6] doc/guides: update feature list supported with cn9k Archana Muniganti
2021-10-28 16:52 ` [dpdk-dev] [PATCH 5/6] crypto/cnxk: update auth key size Archana Muniganti
2021-10-28 16:52 ` [dpdk-dev] [PATCH 6/6] crypto/cnxk: support IPv6 mixed tunnel mode Archana Muniganti
2021-10-29  4:54 ` [dpdk-dev] [PATCH 0/6] add cnxk lookaside IPsec additional features Anoob Joseph
2021-10-31 21:21   ` Akhil Goyal

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211028165228.14603-2-marchana@marvell.com \
    --to=marchana@marvell.com \
    --cc=adwivedi@marvell.com \
    --cc=anoobj@marvell.com \
    --cc=dev@dpdk.org \
    --cc=gakhil@marvell.com \
    --cc=ktejasree@marvell.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).