[09/15] crypto/octeontx2: add datapath ops in eth security ctx
diff mbox series

Message ID 1575806094-28391-10-git-send-email-anoobj@marvell.com
State Superseded
Delegated to: akhil goyal
Headers show
Series
  • add OCTEONTX2 inline IPsec support
Related show

Checks

Context Check Description
ci/Intel-compilation success Compilation OK
ci/checkpatch success coding style OK

Commit Message

Anoob Joseph Dec. 8, 2019, 11:54 a.m. UTC
From: Ankur Dwivedi <adwivedi@marvell.com>

Adding data path ops in eth security ctx.

Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com>
Signed-off-by: Anoob Joseph <anoobj@marvell.com>
Signed-off-by: Archana Muniganti <marchana@marvell.com>
Signed-off-by: Tejasree Kondoj <ktejasree@marvell.com>
Signed-off-by: Vamsi Attunuru <vattunuru@marvell.com>
---
 drivers/crypto/octeontx2/otx2_security.c | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

Patch
diff mbox series

diff --git a/drivers/crypto/octeontx2/otx2_security.c b/drivers/crypto/octeontx2/otx2_security.c
index 393bc12..545c806 100644
--- a/drivers/crypto/octeontx2/otx2_security.c
+++ b/drivers/crypto/octeontx2/otx2_security.c
@@ -486,6 +486,27 @@  otx2_sec_eth_session_get_size(void *device __rte_unused)
 	return sizeof(struct otx2_sec_session);
 }
 
+static int
+otx2_sec_eth_set_pkt_mdata(void *device __rte_unused,
+			    struct rte_security_session *session,
+			    struct rte_mbuf *m, void *params __rte_unused)
+{
+	/* Set security session as the pkt metadata */
+	m->udata64 = (uint64_t)session;
+
+	return 0;
+}
+
+static int
+otx2_sec_eth_get_userdata(void *device __rte_unused, uint64_t md,
+			   void **userdata)
+{
+	/* Retrieve userdata  */
+	*userdata = (void *)md;
+
+	return 0;
+}
+
 static const struct rte_security_capability *
 otx2_sec_eth_capabilities_get(void *device __rte_unused)
 {
@@ -496,6 +517,8 @@  static struct rte_security_ops otx2_sec_eth_ops = {
 	.session_create		= otx2_sec_eth_session_create,
 	.session_destroy	= otx2_sec_eth_session_destroy,
 	.session_get_size	= otx2_sec_eth_session_get_size,
+	.set_pkt_metadata	= otx2_sec_eth_set_pkt_mdata,
+	.get_userdata		= otx2_sec_eth_get_userdata,
 	.capabilities_get	= otx2_sec_eth_capabilities_get
 };