[v4,4/5] crypto/dpaa2_sec: add PDCP short MAC-I support

Message ID 20210908125127.3566886-5-g.singh@nxp.com (mailing list archive)
State Accepted, archived
Delegated to: akhil goyal
Headers
Series support of MAC-I |

Checks

Context Check Description
ci/checkpatch warning coding style issues

Commit Message

Gagandeep Singh Sept. 8, 2021, 12:51 p.m. UTC
  This patch add PDCP short mac support in dpaa2_sec driver.

Signed-off-by: Gagandeep Singh <g.singh@nxp.com>
---
 doc/guides/rel_notes/release_21_11.rst      | 4 ++++
 drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c | 4 ++++
 drivers/crypto/dpaa2_sec/dpaa2_sec_priv.h   | 9 +++++++++
 3 files changed, 17 insertions(+)
  

Patch

diff --git a/doc/guides/rel_notes/release_21_11.rst b/doc/guides/rel_notes/release_21_11.rst
index 50e4fb1205..b7e5128be5 100644
--- a/doc/guides/rel_notes/release_21_11.rst
+++ b/doc/guides/rel_notes/release_21_11.rst
@@ -77,6 +77,10 @@  New Features
 
   * Added DES-CBC, AES-XCBC-MAC, AES-CMAC and non-HMAC algo support.
 
+* **Updated NXP dpaa2_sec crypto PMD.**
+
+  * Added PDCP short MAC-I support.
+
 
 Removed Items
 -------------
diff --git a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c
index b8d57c2b22..dfa72f3f93 100644
--- a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c
+++ b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c
@@ -3309,6 +3309,10 @@  dpaa2_sec_set_pdcp_session(struct rte_cryptodev *dev,
 					pdcp_xform->hfn_threshold,
 					&cipherdata, &authdata,
 					0);
+
+	} else if (pdcp_xform->domain == RTE_SECURITY_PDCP_MODE_SHORT_MAC) {
+		bufsize = cnstr_shdsc_pdcp_short_mac(priv->flc_desc[0].desc,
+						     1, swap, &authdata);
 	} else {
 		if (session->dir == DIR_ENC) {
 			if (pdcp_xform->sdap_enabled)
diff --git a/drivers/crypto/dpaa2_sec/dpaa2_sec_priv.h b/drivers/crypto/dpaa2_sec/dpaa2_sec_priv.h
index 7dbc69f6cb..8dee0a4bda 100644
--- a/drivers/crypto/dpaa2_sec/dpaa2_sec_priv.h
+++ b/drivers/crypto/dpaa2_sec/dpaa2_sec_priv.h
@@ -941,6 +941,15 @@  static const struct rte_security_capability dpaa2_sec_security_cap[] = {
 		},
 		.crypto_capabilities = dpaa2_pdcp_capabilities
 	},
+	{ /* PDCP Lookaside Protocol offload Short MAC */
+		.action = RTE_SECURITY_ACTION_TYPE_LOOKASIDE_PROTOCOL,
+		.protocol = RTE_SECURITY_PROTOCOL_PDCP,
+		.pdcp = {
+			.domain = RTE_SECURITY_PDCP_MODE_SHORT_MAC,
+			.capa_flags = 0
+		},
+		.crypto_capabilities = dpaa2_pdcp_capabilities
+	},
 	{
 		.action = RTE_SECURITY_ACTION_TYPE_NONE
 	}