DPDK patches and discussions
 help / color / mirror / Atom feed
From: Abhinandan Gujjar <abhinandan.gujjar@intel.com>
To: declan.doherty@intel.com, akhil.goyal@nxp.com
Cc: dev@dpdk.org, narender.vangati@intel.com,
	Abhinandan Gujjar <abhinandan.gujjar@intel.com>,
	Nikhil Rao <nikhil.rao@intel.com>
Subject: [dpdk-dev] [PATCH 2/2] lib/security: add support to set session private data
Date: Mon, 15 Jan 2018 17:22:13 +0530	[thread overview]
Message-ID: <1516017133-166808-1-git-send-email-abhinandan.gujjar@intel.com> (raw)

The application may want to  store private data along with the
rte_security that is transparent to the rte_security layer.
For e.g., If an eventdev based application is submitting a
rte_security_session operation and wants to indicate event information
required to construct a new event that will be enqueued to eventdev
after completion of the rte_security operation. This patch provides a
mechanism for the application to associate this information with the
rte_security session. The application can set the private data using
rte_security_session_set_private_data() and retrieve it using
rte_security_session_get_private_data()

Signed-off-by: Abhinandan Gujjar <abhinandan.gujjar@intel.com>
Signed-off-by: Nikhil Rao <nikhil.rao@intel.com>
---
 lib/librte_security/rte_security.h | 28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)

diff --git a/lib/librte_security/rte_security.h b/lib/librte_security/rte_security.h
index 653929b..5c58826 100644
--- a/lib/librte_security/rte_security.h
+++ b/lib/librte_security/rte_security.h
@@ -525,6 +525,34 @@ struct rte_security_capability_idx {
 rte_security_capability_get(struct rte_security_ctx *instance,
 			    struct rte_security_capability_idx *idx);
 
+/**
+ * Set private data for a security session.
+ *
+ * @param	sess		security session
+ * @param	data		pointer to the private data.
+ * @param	size		size of the private data.
+ *
+ * @return
+ *  - On success, zero.
+ *  - On failure, a negative value.
+ */
+int rte_security_session_set_private_data(
+				struct rte_security_session *sess,
+				void *data,
+				uint16_t size);
+
+/**
+ * Get private data of a security session.
+ *
+ * @param	sess		security session
+ *
+ * @return
+ *  - On success return pointer to private data.
+ *  - On failure returns NULL.
+ */
+void *rte_security_session_get_private_data(
+				const struct rte_security_session *session);
+
 #ifdef __cplusplus
 }
 #endif
-- 
1.9.1

                 reply	other threads:[~2018-01-15 11:52 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=1516017133-166808-1-git-send-email-abhinandan.gujjar@intel.com \
    --to=abhinandan.gujjar@intel.com \
    --cc=akhil.goyal@nxp.com \
    --cc=declan.doherty@intel.com \
    --cc=dev@dpdk.org \
    --cc=narender.vangati@intel.com \
    --cc=nikhil.rao@intel.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).