From patchwork Mon Jan 15 11:52:13 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Gujjar, Abhinandan S" X-Patchwork-Id: 33750 X-Patchwork-Delegate: pablo.de.lara.guarch@intel.com Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 8737B7260; Mon, 15 Jan 2018 12:52:18 +0100 (CET) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by dpdk.org (Postfix) with ESMTP id 416BE7260 for ; Mon, 15 Jan 2018 12:52:17 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 15 Jan 2018 03:52:16 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,363,1511856000"; d="scan'208";a="10217354" Received: from unknown (HELO localhost.localdomain) ([10.224.122.195]) by fmsmga007.fm.intel.com with ESMTP; 15 Jan 2018 03:52:14 -0800 From: Abhinandan Gujjar To: declan.doherty@intel.com, akhil.goyal@nxp.com Cc: dev@dpdk.org, narender.vangati@intel.com, Abhinandan Gujjar , Nikhil Rao Date: Mon, 15 Jan 2018 17:22:13 +0530 Message-Id: <1516017133-166808-1-git-send-email-abhinandan.gujjar@intel.com> X-Mailer: git-send-email 1.9.1 Subject: [dpdk-dev] [PATCH 2/2] lib/security: add support to set session private data X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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 Signed-off-by: Nikhil Rao --- 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