DPDK patches and discussions
 help / color / mirror / Atom feed
From: Tejasree Kondoj <ktejasree@marvell.com>
To: Akhil Goyal <akhil.goyal@nxp.com>, Radu Nicolau <radu.nicolau@intel.com>
Cc: Vamsi Attunuru <vattunuru@marvell.com>,
	Narayana Prasad <pathreya@marvell.com>,
	Anoob Joseph <anoobj@marvell.com>,
	Tejasree Kondoj <ktejasree@marvell.com>, <dev@dpdk.org>
Subject: [dpdk-dev] [PATCH v3 6/8] crypto/octeontx2: add cryptodev sec misc callbacks
Date: Thu, 16 Jul 2020 14:09:29 +0530
Message-ID: <20200716083931.29092-7-ktejasree@marvell.com> (raw)
In-Reply-To: <20200716083931.29092-1-ktejasree@marvell.com>

From: Vamsi Attunuru <vattunuru@marvell.com>

This patch adds lookaside IPsec callback functions.

Signed-off-by: Vamsi Attunuru <vattunuru@marvell.com>
Signed-off-by: Tejasree Kondoj <ktejasree@marvell.com>
---
 drivers/crypto/octeontx2/otx2_cryptodev_sec.c | 34 +++++++++++++++++--
 1 file changed, 31 insertions(+), 3 deletions(-)

diff --git a/drivers/crypto/octeontx2/otx2_cryptodev_sec.c b/drivers/crypto/octeontx2/otx2_cryptodev_sec.c
index 906a87b9e5..6e14b37a68 100644
--- a/drivers/crypto/octeontx2/otx2_cryptodev_sec.c
+++ b/drivers/crypto/octeontx2/otx2_cryptodev_sec.c
@@ -10,13 +10,41 @@
 #include "otx2_cryptodev.h"
 #include "otx2_cryptodev_capabilities.h"
 #include "otx2_cryptodev_sec.h"
+#include "otx2_security.h"
+
+static unsigned int
+otx2_crypto_sec_session_get_size(void *device __rte_unused)
+{
+	return sizeof(struct otx2_sec_session);
+}
+
+static int
+otx2_crypto_sec_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_crypto_sec_get_userdata(void *device __rte_unused, uint64_t md,
+			     void **userdata)
+{
+	/* Retrieve userdata  */
+	*userdata = (void *)md;
+
+	return 0;
+}
 
 static struct rte_security_ops otx2_crypto_sec_ops = {
 	.session_create		= NULL,
 	.session_destroy	= NULL,
-	.session_get_size	= NULL,
-	.set_pkt_metadata	= NULL,
-	.get_userdata		= NULL,
+	.session_get_size	= otx2_crypto_sec_session_get_size,
+	.set_pkt_metadata	= otx2_crypto_sec_set_pkt_mdata,
+	.get_userdata		= otx2_crypto_sec_get_userdata,
 	.capabilities_get	= otx2_crypto_sec_capabilities_get
 };
 
-- 
2.27.0


  parent reply	other threads:[~2020-07-16  7:46 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-16  8:39 [dpdk-dev] [PATCH v3 0/8] add OCTEON TX2 lookaside IPsec support Tejasree Kondoj
2020-07-16  8:13 ` Anoob Joseph
2020-07-16 16:32   ` Akhil Goyal
2020-07-16  8:39 ` [dpdk-dev] [PATCH v3 1/8] crypto/octeontx2: move capabilities initialization into probe Tejasree Kondoj
2020-07-16  8:39 ` [dpdk-dev] [PATCH v3 2/8] net/octeontx2: move otx2_sec_session struct to otx2_security.h Tejasree Kondoj
2020-07-16  8:39 ` [dpdk-dev] [PATCH v3 3/8] crypto/octeontx2: add lookaside SA context definitions Tejasree Kondoj
2020-07-16  8:39 ` [dpdk-dev] [PATCH v3 4/8] crypto/octeontx2: add cryptodev sec registration Tejasree Kondoj
2020-07-16  8:39 ` [dpdk-dev] [PATCH v3 5/8] crypto/octeontx2: add cryptodev sec capabilities Tejasree Kondoj
2020-07-16  8:39 ` Tejasree Kondoj [this message]
2020-07-16  8:39 ` [dpdk-dev] [PATCH v3 7/8] crypto/octeontx2: add cryptodev sec session create Tejasree Kondoj
2020-07-16  8:39 ` [dpdk-dev] [PATCH v3 8/8] crypto/octeontx2: add cryptodev sec enqueue and dequeue routines Tejasree Kondoj
2020-07-20 12:02   ` Ferruh Yigit
2020-07-20 17:20     ` [dpdk-dev] [EXT] " Tejasree Kondoj
2020-07-20 18:13       ` Ferruh Yigit

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=20200716083931.29092-7-ktejasree@marvell.com \
    --to=ktejasree@marvell.com \
    --cc=akhil.goyal@nxp.com \
    --cc=anoobj@marvell.com \
    --cc=dev@dpdk.org \
    --cc=pathreya@marvell.com \
    --cc=radu.nicolau@intel.com \
    --cc=vattunuru@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

DPDK patches and discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://inbox.dpdk.org/dev/0 dev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dev dev/ https://inbox.dpdk.org/dev \
		dev@dpdk.org
	public-inbox-index dev

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.dev


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git