DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH 0/6] add cnxk lookaside IPsec additional features
@ 2021-10-28 16:52 Archana Muniganti
  2021-10-28 16:52 ` [dpdk-dev] [PATCH 1/6] common/cnxk: add null auth with IPsec Archana Muniganti
                   ` (6 more replies)
  0 siblings, 7 replies; 9+ messages in thread
From: Archana Muniganti @ 2021-10-28 16:52 UTC (permalink / raw)
  To: gakhil; +Cc: Archana Muniganti, ktejasree, adwivedi, anoobj, dev

This series covers additional features, key length update and
feature list update.
* For cn10k, AES-CBC NULL auth support is added.
* For cn9k, ESN and Anti-replay support is added. Along with
  feature addition, key length and supported features list update
  is added.

Anoob Joseph (2):
  common/cnxk: add null auth with IPsec
  crypto/cnxk: add null auth

Archana Muniganti (4):
  crypto/cnxk: add cn9k ESN and anti-replay support
  doc/guides: update feature list supported with cn9k
  crypto/cnxk: update auth key size
  crypto/cnxk: support IPv6 mixed tunnel mode

 doc/guides/cryptodevs/cnxk.rst                |  7 +++
 doc/guides/rel_notes/release_21_11.rst        |  2 +
 drivers/common/cnxk/cnxk_security.c           | 18 +++---
 drivers/common/cnxk/cnxk_security_ar.h        | 21 +++++++
 drivers/crypto/cnxk/cn9k_ipsec.c              | 27 ++++++++-
 drivers/crypto/cnxk/cn9k_ipsec.h              |  5 ++
 drivers/crypto/cnxk/cn9k_ipsec_la_ops.h       | 58 +++++++++++++++++++
 .../crypto/cnxk/cnxk_cryptodev_capabilities.c | 46 +++++++++++++++
 drivers/crypto/cnxk/cnxk_ipsec.h              |  3 +
 9 files changed, 176 insertions(+), 11 deletions(-)

-- 
2.22.0


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [dpdk-dev] [PATCH 1/6] common/cnxk: add null auth with IPsec
  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
  2021-10-28 16:52 ` [dpdk-dev] [PATCH 2/6] crypto/cnxk: add null auth Archana Muniganti
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 9+ messages in thread
From: Archana Muniganti @ 2021-10-28 16:52 UTC (permalink / raw)
  To: gakhil; +Cc: Anoob Joseph, ktejasree, adwivedi, dev

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


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [dpdk-dev] [PATCH 2/6] crypto/cnxk: add null auth
  2021-10-28 16:52 [dpdk-dev] [PATCH 0/6] add cnxk lookaside IPsec additional features Archana Muniganti
  2021-10-28 16:52 ` [dpdk-dev] [PATCH 1/6] common/cnxk: add null auth with IPsec Archana Muniganti
@ 2021-10-28 16:52 ` Archana Muniganti
  2021-10-28 16:52 ` [dpdk-dev] [PATCH 3/6] crypto/cnxk: add cn9k ESN and anti-replay support Archana Muniganti
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 9+ messages in thread
From: Archana Muniganti @ 2021-10-28 16:52 UTC (permalink / raw)
  To: gakhil; +Cc: Anoob Joseph, ktejasree, adwivedi, dev

From: Anoob Joseph <anoobj@marvell.com>

Add null auth support with lookaside IPsec on cn10k crypto PMDs.

Signed-off-by: Anoob Joseph <anoobj@marvell.com>
---
 doc/guides/cryptodevs/cnxk.rst                |  1 +
 doc/guides/rel_notes/release_21_11.rst        |  1 +
 drivers/crypto/cnxk/cn9k_ipsec.c              |  6 +++--
 .../crypto/cnxk/cnxk_cryptodev_capabilities.c | 24 +++++++++++++++++++
 drivers/crypto/cnxk/cnxk_ipsec.h              |  3 +++
 5 files changed, 33 insertions(+), 2 deletions(-)

diff --git a/doc/guides/cryptodevs/cnxk.rst b/doc/guides/cryptodevs/cnxk.rst
index b5b6645008..709da56ca8 100644
--- a/doc/guides/cryptodevs/cnxk.rst
+++ b/doc/guides/cryptodevs/cnxk.rst
@@ -258,4 +258,5 @@ CN10XX Features supported
 * Transport mode
 * UDP Encapsulation
 * AES-128/192/256-GCM
+* AES-128/192/256-CBC-NULL
 * AES-128/192/256-CBC-SHA1-HMAC
diff --git a/doc/guides/rel_notes/release_21_11.rst b/doc/guides/rel_notes/release_21_11.rst
index 2df443e39f..6cc7b2579e 100644
--- a/doc/guides/rel_notes/release_21_11.rst
+++ b/doc/guides/rel_notes/release_21_11.rst
@@ -212,6 +212,7 @@ New Features
   * Added support for ZUC algorithm with 256-bit key length for CN10K.
   * Added support for CN98xx dual block.
   * Added inner checksum support in lookaside protocol (IPsec) for CN10K.
+  * Added AES-CBC NULL auth support in lookaside protocol (IPsec) for CN10K.
 
 * **Added support for event crypto adapter on Marvell CN10K and CN9K.**
 
diff --git a/drivers/crypto/cnxk/cn9k_ipsec.c b/drivers/crypto/cnxk/cn9k_ipsec.c
index 53fb793654..a43864df0d 100644
--- a/drivers/crypto/cnxk/cn9k_ipsec.c
+++ b/drivers/crypto/cnxk/cn9k_ipsec.c
@@ -316,7 +316,8 @@ cn9k_ipsec_outb_sa_create(struct cnxk_cpt_qp *qp,
 	if (ret)
 		return ret;
 
-	if (ctl->enc_type == ROC_IE_ON_SA_ENC_AES_GCM) {
+	if (ctl->enc_type == ROC_IE_ON_SA_ENC_AES_GCM ||
+	    ctl->auth_type == ROC_IE_ON_SA_AUTH_NULL) {
 		template = &out_sa->aes_gcm.template;
 		ctx_len = offsetof(struct roc_ie_on_outb_sa, aes_gcm.template);
 	} else if (ctl->auth_type == ROC_IE_ON_SA_AUTH_SHA1) {
@@ -449,7 +450,8 @@ cn9k_ipsec_inb_sa_create(struct cnxk_cpt_qp *qp,
 	if (ret)
 		return ret;
 
-	if (crypto_xform->type == RTE_CRYPTO_SYM_XFORM_AEAD) {
+	if (crypto_xform->type == RTE_CRYPTO_SYM_XFORM_AEAD ||
+	    auth_xform->auth.algo == RTE_CRYPTO_AUTH_NULL) {
 		ctx_len = offsetof(struct roc_ie_on_inb_sa,
 				   sha1_or_gcm.hmac_key[0]);
 	} else {
diff --git a/drivers/crypto/cnxk/cnxk_cryptodev_capabilities.c b/drivers/crypto/cnxk/cnxk_cryptodev_capabilities.c
index a53b489a04..19d75a63c6 100644
--- a/drivers/crypto/cnxk/cnxk_cryptodev_capabilities.c
+++ b/drivers/crypto/cnxk/cnxk_cryptodev_capabilities.c
@@ -930,6 +930,27 @@ sec_caps_add(struct rte_cryptodev_capabilities cnxk_caps[], int *cur_pos,
 	*cur_pos += nb_caps;
 }
 
+static void
+cn10k_sec_crypto_caps_update(struct rte_cryptodev_capabilities cnxk_caps[],
+			     int *cur_pos)
+{
+	const struct rte_cryptodev_capabilities *cap;
+	unsigned int i;
+
+	if ((CNXK_CPT_MAX_CAPS - *cur_pos) < 1)
+		return;
+
+	/* NULL auth */
+	for (i = 0; i < RTE_DIM(caps_null); i++) {
+		cap = &caps_null[i];
+		if (cap->sym.xform_type == RTE_CRYPTO_SYM_XFORM_AUTH &&
+		    cap->sym.auth.algo == RTE_CRYPTO_AUTH_NULL) {
+			cnxk_caps[*cur_pos] = caps_null[i];
+			*cur_pos += 1;
+		}
+	}
+}
+
 static void
 sec_crypto_caps_populate(struct rte_cryptodev_capabilities cnxk_caps[],
 			 union cpt_eng_caps *hw_caps)
@@ -939,6 +960,9 @@ sec_crypto_caps_populate(struct rte_cryptodev_capabilities cnxk_caps[],
 	SEC_CAPS_ADD(cnxk_caps, &cur_pos, hw_caps, aes);
 	SEC_CAPS_ADD(cnxk_caps, &cur_pos, hw_caps, sha1_sha2);
 
+	if (roc_model_is_cn10k())
+		cn10k_sec_crypto_caps_update(cnxk_caps, &cur_pos);
+
 	sec_caps_add(cnxk_caps, &cur_pos, caps_end, RTE_DIM(caps_end));
 }
 
diff --git a/drivers/crypto/cnxk/cnxk_ipsec.h b/drivers/crypto/cnxk/cnxk_ipsec.h
index ff396179ca..dddb414793 100644
--- a/drivers/crypto/cnxk/cnxk_ipsec.h
+++ b/drivers/crypto/cnxk/cnxk_ipsec.h
@@ -40,6 +40,9 @@ ipsec_xform_auth_verify(struct rte_crypto_sym_xform *crypto_xform)
 {
 	uint16_t keylen = crypto_xform->auth.key.length;
 
+	if (crypto_xform->auth.algo == RTE_CRYPTO_AUTH_NULL)
+		return 0;
+
 	if (crypto_xform->auth.algo == RTE_CRYPTO_AUTH_SHA1_HMAC) {
 		if (keylen >= 20 && keylen <= 64)
 			return 0;
-- 
2.22.0


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [dpdk-dev] [PATCH 3/6] crypto/cnxk: add cn9k ESN and anti-replay support
  2021-10-28 16:52 [dpdk-dev] [PATCH 0/6] add cnxk lookaside IPsec additional features Archana Muniganti
  2021-10-28 16:52 ` [dpdk-dev] [PATCH 1/6] common/cnxk: add null auth with IPsec Archana Muniganti
  2021-10-28 16:52 ` [dpdk-dev] [PATCH 2/6] crypto/cnxk: add null auth Archana Muniganti
@ 2021-10-28 16:52 ` Archana Muniganti
  2021-10-28 16:52 ` [dpdk-dev] [PATCH 4/6] doc/guides: update feature list supported with cn9k Archana Muniganti
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 9+ messages in thread
From: Archana Muniganti @ 2021-10-28 16:52 UTC (permalink / raw)
  To: gakhil; +Cc: Archana Muniganti, ktejasree, adwivedi, anoobj, dev

Adds ESN and anti-replay support for lookaside IPsec.

Signed-off-by: Archana Muniganti <marchana@marvell.com>
Signed-off-by: Tejasree Kondoj <ktejasree@marvell.com>
---
 doc/guides/cryptodevs/cnxk.rst          |  2 +
 doc/guides/rel_notes/release_21_11.rst  |  1 +
 drivers/common/cnxk/cnxk_security_ar.h  | 21 +++++++++
 drivers/crypto/cnxk/cn9k_ipsec.c        | 17 ++++++++
 drivers/crypto/cnxk/cn9k_ipsec.h        |  5 +++
 drivers/crypto/cnxk/cn9k_ipsec_la_ops.h | 58 +++++++++++++++++++++++++
 6 files changed, 104 insertions(+)

diff --git a/doc/guides/cryptodevs/cnxk.rst b/doc/guides/cryptodevs/cnxk.rst
index 709da56ca8..faad6a499d 100644
--- a/doc/guides/cryptodevs/cnxk.rst
+++ b/doc/guides/cryptodevs/cnxk.rst
@@ -248,6 +248,8 @@ CN9XX Features supported
 * Tunnel mode
 * UDP Encapsulation
 * AES-128/192/256-GCM
+* ESN
+* Anti-replay
 
 CN10XX Features supported
 ~~~~~~~~~~~~~~~~~~~~~~~~~
diff --git a/doc/guides/rel_notes/release_21_11.rst b/doc/guides/rel_notes/release_21_11.rst
index 6cc7b2579e..82cdff641a 100644
--- a/doc/guides/rel_notes/release_21_11.rst
+++ b/doc/guides/rel_notes/release_21_11.rst
@@ -213,6 +213,7 @@ New Features
   * Added support for CN98xx dual block.
   * Added inner checksum support in lookaside protocol (IPsec) for CN10K.
   * Added AES-CBC NULL auth support in lookaside protocol (IPsec) for CN10K.
+  * Added ESN and anti-replay support in lookaside protocol (IPsec) for CN9K.
 
 * **Added support for event crypto adapter on Marvell CN10K and CN9K.**
 
diff --git a/drivers/common/cnxk/cnxk_security_ar.h b/drivers/common/cnxk/cnxk_security_ar.h
index 6bc517c875..3ec4c296c2 100644
--- a/drivers/common/cnxk/cnxk_security_ar.h
+++ b/drivers/common/cnxk/cnxk_security_ar.h
@@ -30,6 +30,27 @@ struct cnxk_on_ipsec_ar {
 	uint64_t window[AR_WIN_ARR_SZ]; /**< anti-replay window */
 };
 
+static inline uint32_t
+cnxk_on_anti_replay_get_seqh(uint32_t winsz, uint32_t seql, uint32_t esn_hi,
+			     uint32_t esn_low)
+{
+	uint32_t win_low = esn_low - winsz + 1;
+
+	if (esn_low > winsz - 1) {
+		/* Window is in one sequence number subspace */
+		if (seql > win_low)
+			return esn_hi;
+		else
+			return esn_hi + 1;
+	} else {
+		/* Window is split across two sequence number subspaces */
+		if (seql > win_low)
+			return esn_hi - 1;
+		else
+			return esn_hi;
+	}
+}
+
 static inline int
 cnxk_on_anti_replay_check(uint64_t seq, struct cnxk_on_ipsec_ar *ar,
 			  uint32_t winsz)
diff --git a/drivers/crypto/cnxk/cn9k_ipsec.c b/drivers/crypto/cnxk/cn9k_ipsec.c
index a43864df0d..ca26d9289c 100644
--- a/drivers/crypto/cnxk/cn9k_ipsec.c
+++ b/drivers/crypto/cnxk/cn9k_ipsec.c
@@ -445,6 +445,7 @@ cn9k_ipsec_inb_sa_create(struct cnxk_cpt_qp *qp,
 	memset(sa, 0, sizeof(struct cn9k_ipsec_sa));
 
 	sa->dir = RTE_SECURITY_IPSEC_SA_DIR_INGRESS;
+	sa->replay_win_sz = ipsec->replay_win_sz;
 
 	ret = fill_ipsec_common_sa(ipsec, crypto_xform, &in_sa->common_sa);
 	if (ret)
@@ -483,6 +484,22 @@ cn9k_ipsec_inb_sa_create(struct cnxk_cpt_qp *qp,
 	w7.s.cptr = rte_mempool_virt2iova(in_sa);
 	inst_tmpl->w7 = w7.u64;
 
+	if (sa->replay_win_sz) {
+		if (sa->replay_win_sz > CNXK_ON_AR_WIN_SIZE_MAX) {
+			plt_err("Replay window size:%u is not supported",
+				sa->replay_win_sz);
+			return -ENOTSUP;
+		}
+
+		/* Set window bottom to 1, base and top to size of window */
+		sa->ar.winb = 1;
+		sa->ar.wint = sa->replay_win_sz;
+		sa->ar.base = sa->replay_win_sz;
+
+		in_sa->common_sa.esn_low = 0;
+		in_sa->common_sa.esn_hi = 0;
+	}
+
 	return cn9k_cpt_enq_sa_write(
 		sa, qp, ROC_IE_ON_MAJOR_OP_WRITE_IPSEC_INBOUND, ctx_len);
 }
diff --git a/drivers/crypto/cnxk/cn9k_ipsec.h b/drivers/crypto/cnxk/cn9k_ipsec.h
index 13d522ec6f..fc440d54ba 100644
--- a/drivers/crypto/cnxk/cn9k_ipsec.h
+++ b/drivers/crypto/cnxk/cn9k_ipsec.h
@@ -7,6 +7,7 @@
 
 #include "cnxk_ipsec.h"
 #include "cnxk_security.h"
+#include "cnxk_security_ar.h"
 
 struct cn9k_ipsec_sa {
 	union {
@@ -35,6 +36,10 @@ struct cn9k_ipsec_sa {
 			uint32_t seq_hi;
 		};
 	};
+	/** Anti replay */
+	struct cnxk_on_ipsec_ar ar;
+	/** Anti replay window size */
+	uint32_t replay_win_sz;
 };
 
 struct cn9k_sec_session {
diff --git a/drivers/crypto/cnxk/cn9k_ipsec_la_ops.h b/drivers/crypto/cnxk/cn9k_ipsec_la_ops.h
index b7a88e1b35..2dc8913feb 100644
--- a/drivers/crypto/cnxk/cn9k_ipsec_la_ops.h
+++ b/drivers/crypto/cnxk/cn9k_ipsec_la_ops.h
@@ -6,9 +6,11 @@
 #define __CN9K_IPSEC_LA_OPS_H__
 
 #include <rte_crypto_sym.h>
+#include <rte_esp.h>
 #include <rte_security.h>
 
 #include "cn9k_ipsec.h"
+#include "cnxk_security_ar.h"
 
 static __rte_always_inline int32_t
 ipsec_po_out_rlen_get(struct cn9k_ipsec_sa *sa, uint32_t plen)
@@ -21,6 +23,53 @@ ipsec_po_out_rlen_get(struct cn9k_ipsec_sa *sa, uint32_t plen)
 	return sa->rlens.partial_len + enc_payload_len;
 }
 
+static __rte_always_inline int
+ipsec_antireplay_check(struct cn9k_ipsec_sa *sa, uint32_t win_sz,
+		       struct rte_mbuf *m)
+{
+	uint32_t esn_low = 0, esn_hi = 0, seql = 0, seqh = 0;
+	struct roc_ie_on_common_sa *common_sa;
+	struct roc_ie_on_inb_sa *in_sa;
+	struct roc_ie_on_sa_ctl *ctl;
+	uint64_t seq_in_sa, seq = 0;
+	struct rte_esp_hdr *esp;
+	uint8_t esn;
+	int ret;
+
+	in_sa = &sa->in_sa;
+	common_sa = &in_sa->common_sa;
+	ctl = &common_sa->ctl;
+
+	esn = ctl->esn_en;
+	esn_low = rte_be_to_cpu_32(common_sa->esn_low);
+	esn_hi = rte_be_to_cpu_32(common_sa->esn_hi);
+
+	esp = rte_pktmbuf_mtod_offset(m, void *, sizeof(struct rte_ipv4_hdr));
+	seql = rte_be_to_cpu_32(esp->seq);
+
+	if (!esn) {
+		seq = (uint64_t)seql;
+	} else {
+		seqh = cnxk_on_anti_replay_get_seqh(win_sz, seql, esn_hi,
+						    esn_low);
+		seq = ((uint64_t)seqh << 32) | seql;
+	}
+
+	if (unlikely(seq == 0))
+		return IPSEC_ANTI_REPLAY_FAILED;
+
+	ret = cnxk_on_anti_replay_check(seq, &sa->ar, win_sz);
+	if (esn && !ret) {
+		seq_in_sa = ((uint64_t)esn_hi << 32) | esn_low;
+		if (seq > seq_in_sa) {
+			common_sa->esn_low = rte_cpu_to_be_32(seql);
+			common_sa->esn_hi = rte_cpu_to_be_32(seqh);
+		}
+	}
+
+	return ret;
+}
+
 static __rte_always_inline int
 process_outb_sa(struct rte_crypto_op *cop, struct cn9k_ipsec_sa *sa,
 		struct cpt_inst_s *inst)
@@ -78,6 +127,15 @@ process_inb_sa(struct rte_crypto_op *cop, struct cn9k_ipsec_sa *sa,
 {
 	struct rte_crypto_sym_op *sym_op = cop->sym;
 	struct rte_mbuf *m_src = sym_op->m_src;
+	int ret;
+
+	if (sa->replay_win_sz) {
+		ret = ipsec_antireplay_check(sa, sa->replay_win_sz, m_src);
+		if (unlikely(ret)) {
+			plt_dp_err("Anti replay check failed");
+			return ret;
+		}
+	}
 
 	/* Prepare CPT instruction */
 	inst->w4.u64 = sa->inst.w4 | rte_pktmbuf_pkt_len(m_src);
-- 
2.22.0


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [dpdk-dev] [PATCH 4/6] doc/guides: update feature list supported with cn9k
  2021-10-28 16:52 [dpdk-dev] [PATCH 0/6] add cnxk lookaside IPsec additional features Archana Muniganti
                   ` (2 preceding siblings ...)
  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 ` Archana Muniganti
  2021-10-28 16:52 ` [dpdk-dev] [PATCH 5/6] crypto/cnxk: update auth key size Archana Muniganti
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 9+ messages in thread
From: Archana Muniganti @ 2021-10-28 16:52 UTC (permalink / raw)
  To: gakhil; +Cc: Archana Muniganti, ktejasree, adwivedi, anoobj, dev

Updated feature list supported with cn9k.

Signed-off-by: Archana Muniganti <marchana@marvell.com>
---
 doc/guides/cryptodevs/cnxk.rst | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/doc/guides/cryptodevs/cnxk.rst b/doc/guides/cryptodevs/cnxk.rst
index faad6a499d..23cc823e03 100644
--- a/doc/guides/cryptodevs/cnxk.rst
+++ b/doc/guides/cryptodevs/cnxk.rst
@@ -244,10 +244,14 @@ CN9XX Features supported
 ~~~~~~~~~~~~~~~~~~~~~~~~
 
 * IPv4
+* IPv6
 * ESP
 * Tunnel mode
+* Transport mode(IPv4)
 * UDP Encapsulation
 * AES-128/192/256-GCM
+* AES-128/192/256-CBC-SHA1-HMAC
+* AES-128/192/256-CBC-SHA256-128-HMAC
 * ESN
 * Anti-replay
 
-- 
2.22.0


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [dpdk-dev] [PATCH 5/6] crypto/cnxk: update auth key size
  2021-10-28 16:52 [dpdk-dev] [PATCH 0/6] add cnxk lookaside IPsec additional features Archana Muniganti
                   ` (3 preceding siblings ...)
  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 ` 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
  6 siblings, 0 replies; 9+ messages in thread
From: Archana Muniganti @ 2021-10-28 16:52 UTC (permalink / raw)
  To: gakhil; +Cc: Archana Muniganti, ktejasree, adwivedi, anoobj, dev

Update auth key size for SHA256_HMAC for cn9k.

Signed-off-by: Archana Muniganti <marchana@marvell.com>
---
 .../crypto/cnxk/cnxk_cryptodev_capabilities.c | 22 +++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/drivers/crypto/cnxk/cnxk_cryptodev_capabilities.c b/drivers/crypto/cnxk/cnxk_cryptodev_capabilities.c
index 19d75a63c6..7dbea0b364 100644
--- a/drivers/crypto/cnxk/cnxk_cryptodev_capabilities.c
+++ b/drivers/crypto/cnxk/cnxk_cryptodev_capabilities.c
@@ -951,6 +951,26 @@ cn10k_sec_crypto_caps_update(struct rte_cryptodev_capabilities cnxk_caps[],
 	}
 }
 
+static void
+cn9k_sec_crypto_caps_update(struct rte_cryptodev_capabilities cnxk_caps[])
+{
+
+	struct rte_cryptodev_capabilities *caps;
+	int i = 0;
+
+	while ((caps = &cnxk_caps[i++])->op != RTE_CRYPTO_OP_TYPE_UNDEFINED) {
+		if ((caps->op == RTE_CRYPTO_OP_TYPE_SYMMETRIC) &&
+		    (caps->sym.xform_type == RTE_CRYPTO_SYM_XFORM_AUTH) &&
+		    (caps->sym.auth.algo == RTE_CRYPTO_AUTH_SHA256_HMAC)) {
+			caps->sym.auth.key_size.min = 32;
+			caps->sym.auth.key_size.max = 64;
+			caps->sym.auth.key_size.increment = 1;
+
+			break;
+		}
+	}
+}
+
 static void
 sec_crypto_caps_populate(struct rte_cryptodev_capabilities cnxk_caps[],
 			 union cpt_eng_caps *hw_caps)
@@ -962,6 +982,8 @@ sec_crypto_caps_populate(struct rte_cryptodev_capabilities cnxk_caps[],
 
 	if (roc_model_is_cn10k())
 		cn10k_sec_crypto_caps_update(cnxk_caps, &cur_pos);
+	else
+		cn9k_sec_crypto_caps_update(cnxk_caps);
 
 	sec_caps_add(cnxk_caps, &cur_pos, caps_end, RTE_DIM(caps_end));
 }
-- 
2.22.0


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [dpdk-dev] [PATCH 6/6] crypto/cnxk: support IPv6 mixed tunnel mode
  2021-10-28 16:52 [dpdk-dev] [PATCH 0/6] add cnxk lookaside IPsec additional features Archana Muniganti
                   ` (4 preceding siblings ...)
  2021-10-28 16:52 ` [dpdk-dev] [PATCH 5/6] crypto/cnxk: update auth key size Archana Muniganti
@ 2021-10-28 16:52 ` Archana Muniganti
  2021-10-29  4:54 ` [dpdk-dev] [PATCH 0/6] add cnxk lookaside IPsec additional features Anoob Joseph
  6 siblings, 0 replies; 9+ messages in thread
From: Archana Muniganti @ 2021-10-28 16:52 UTC (permalink / raw)
  To: gakhil; +Cc: Archana Muniganti, ktejasree, adwivedi, anoobj, dev

Adds IPv6 mixed tunnel mode support for cn9k.

Signed-off-by: Archana Muniganti <marchana@marvell.com>
---
 drivers/crypto/cnxk/cn9k_ipsec.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/crypto/cnxk/cn9k_ipsec.c b/drivers/crypto/cnxk/cn9k_ipsec.c
index ca26d9289c..a81130b244 100644
--- a/drivers/crypto/cnxk/cn9k_ipsec.c
+++ b/drivers/crypto/cnxk/cn9k_ipsec.c
@@ -407,7 +407,8 @@ cn9k_ipsec_outb_sa_create(struct cnxk_cpt_qp *qp,
 	w4.u64 = 0;
 	w4.s.opcode_major = ROC_IE_ON_MAJOR_OP_PROCESS_OUTBOUND_IPSEC;
 	w4.s.opcode_minor = ctx_len >> 3;
-	w4.s.param1 = ROC_IE_ON_PER_PKT_IV;
+	w4.s.param1 = BIT(9);
+	w4.s.param1 |= ROC_IE_ON_PER_PKT_IV;
 	inst_tmpl->w4 = w4.u64;
 
 	w7.u64 = 0;
@@ -477,6 +478,7 @@ cn9k_ipsec_inb_sa_create(struct cnxk_cpt_qp *qp,
 	w4.u64 = 0;
 	w4.s.opcode_major = ROC_IE_ON_MAJOR_OP_PROCESS_INBOUND_IPSEC;
 	w4.s.opcode_minor = ctx_len >> 3;
+	w4.s.param2 = BIT(12);
 	inst_tmpl->w4 = w4.u64;
 
 	w7.u64 = 0;
-- 
2.22.0


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [dpdk-dev] [PATCH 0/6] add cnxk lookaside IPsec additional features
  2021-10-28 16:52 [dpdk-dev] [PATCH 0/6] add cnxk lookaside IPsec additional features Archana Muniganti
                   ` (5 preceding siblings ...)
  2021-10-28 16:52 ` [dpdk-dev] [PATCH 6/6] crypto/cnxk: support IPv6 mixed tunnel mode Archana Muniganti
@ 2021-10-29  4:54 ` Anoob Joseph
  2021-10-31 21:21   ` Akhil Goyal
  6 siblings, 1 reply; 9+ messages in thread
From: Anoob Joseph @ 2021-10-29  4:54 UTC (permalink / raw)
  To: Archana Muniganti, Akhil Goyal
  Cc: Archana Muniganti, Tejasree Kondoj, Ankur Dwivedi, dev

> Subject: [PATCH 0/6] add cnxk lookaside IPsec additional features
> 
> This series covers additional features, key length update and feature list
> update.
> * For cn10k, AES-CBC NULL auth support is added.
> * For cn9k, ESN and Anti-replay support is added. Along with
>   feature addition, key length and supported features list update
>   is added.
> 
> Anoob Joseph (2):
>   common/cnxk: add null auth with IPsec
>   crypto/cnxk: add null auth
> 
> Archana Muniganti (4):
>   crypto/cnxk: add cn9k ESN and anti-replay support
>   doc/guides: update feature list supported with cn9k
>   crypto/cnxk: update auth key size
>   crypto/cnxk: support IPv6 mixed tunnel mode
> 

Series Acked-by: Anoob Joseph <anoobj@marvell.com>

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [dpdk-dev] [PATCH 0/6] add cnxk lookaside IPsec additional features
  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
  0 siblings, 0 replies; 9+ messages in thread
From: Akhil Goyal @ 2021-10-31 21:21 UTC (permalink / raw)
  To: Anoob Joseph, Archana Muniganti
  Cc: Archana Muniganti, Tejasree Kondoj, Ankur Dwivedi, dev


> > Subject: [PATCH 0/6] add cnxk lookaside IPsec additional features
> >
> > This series covers additional features, key length update and feature list
> > update.
> > * For cn10k, AES-CBC NULL auth support is added.
> > * For cn9k, ESN and Anti-replay support is added. Along with
> >   feature addition, key length and supported features list update
> >   is added.
> >
> > Anoob Joseph (2):
> >   common/cnxk: add null auth with IPsec
> >   crypto/cnxk: add null auth
> >
> > Archana Muniganti (4):
> >   crypto/cnxk: add cn9k ESN and anti-replay support
> >   doc/guides: update feature list supported with cn9k
> >   crypto/cnxk: update auth key size
> >   crypto/cnxk: support IPv6 mixed tunnel mode
> >
> 
> Series Acked-by: Anoob Joseph <anoobj@marvell.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>

Applied to dpdk-next-crypto

Thanks.


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2021-10-31 21:21 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-28 16:52 [dpdk-dev] [PATCH 0/6] add cnxk lookaside IPsec additional features Archana Muniganti
2021-10-28 16:52 ` [dpdk-dev] [PATCH 1/6] common/cnxk: add null auth with IPsec Archana Muniganti
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

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).