* [dpdk-dev] [RFC v3, 2/3] cryptodev: add support to set session private data @ 2018-02-01 9:30 Abhinandan Gujjar 2018-02-13 14:56 ` De Lara Guarch, Pablo 0 siblings, 1 reply; 3+ messages in thread From: Abhinandan Gujjar @ 2018-02-01 9:30 UTC (permalink / raw) To: declan.doherty, akhil.goyal, pablo.de.lara.guarch, Jerin.JacobKollanukkaran Cc: dev, narender.vangati, Abhinandan Gujjar, Nikhil Rao The application may want to store private data along with the rte_cryptodev that is transparent to the rte_cryptodev layer. For e.g., If an eventdev based application is submitting a rte_cryptodev_sym_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_cryptodev_sym_session operation. This patch provides a mechanism for the application to associate this information with the rte_cryptodev_sym_session session. The application can set the private data using rte_cryptodev_sym_session_set_private_data() and retrieve it using rte_cryptodev_sym_session_get_private_data(). Signed-off-by: Abhinandan Gujjar <abhinandan.gujjar@intel.com> Signed-off-by: Nikhil Rao <nikhil.rao@intel.com> --- lib/librte_cryptodev/rte_cryptodev.h | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/lib/librte_cryptodev/rte_cryptodev.h b/lib/librte_cryptodev/rte_cryptodev.h index c8fa689..2f4affe 100644 --- a/lib/librte_cryptodev/rte_cryptodev.h +++ b/lib/librte_cryptodev/rte_cryptodev.h @@ -1037,6 +1037,38 @@ struct rte_cryptodev_sym_session * */ const char *rte_cryptodev_driver_name_get(uint8_t driver_id); +/** + * Set private data for a session. + * + * @param sess Session pointer allocated by + * *rte_cryptodev_sym_session_create*. + * @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_cryptodev_sym_session_set_private_data( + struct rte_cryptodev_sym_session *sess, + void *data, + uint16_t size); + +/** + * Get private data of a session. + * + * @param sess Session pointer allocated by + * *rte_cryptodev_sym_session_create*. + * + * @return + * - On success return pointer to private data. + * - On failure returns NULL. + */ +void * +rte_cryptodev_sym_session_get_private_data( + const struct rte_cryptodev_sym_session *sess); + #ifdef __cplusplus } #endif -- 1.9.1 ^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [dpdk-dev] [RFC v3, 2/3] cryptodev: add support to set session private data 2018-02-01 9:30 [dpdk-dev] [RFC v3, 2/3] cryptodev: add support to set session private data Abhinandan Gujjar @ 2018-02-13 14:56 ` De Lara Guarch, Pablo 2018-02-13 16:11 ` Gujjar, Abhinandan S 0 siblings, 1 reply; 3+ messages in thread From: De Lara Guarch, Pablo @ 2018-02-13 14:56 UTC (permalink / raw) To: Gujjar, Abhinandan S, Doherty, Declan, akhil.goyal, Jerin.JacobKollanukkaran Cc: dev, Vangati, Narender, Rao, Nikhil Hi, > -----Original Message----- > From: Gujjar, Abhinandan S > Sent: Thursday, February 1, 2018 9:30 AM > To: Doherty, Declan <declan.doherty@intel.com>; akhil.goyal@nxp.com; De > Lara Guarch, Pablo <pablo.de.lara.guarch@intel.com>; > Jerin.JacobKollanukkaran@cavium.com > Cc: dev@dpdk.org; Vangati, Narender <narender.vangati@intel.com>; > Gujjar, Abhinandan S <abhinandan.gujjar@intel.com>; Rao, Nikhil > <nikhil.rao@intel.com> > Subject: [RFC v3, 2/3] cryptodev: add support to set session private data > > The application may want to store private data along with the > rte_cryptodev that is transparent to the rte_cryptodev layer. > For e.g., If an eventdev based application is submitting a > rte_cryptodev_sym_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_cryptodev_sym_session operation. > This patch provides a mechanism for the application to associate this > information with the rte_cryptodev_sym_session session. > The application can set the private data using > rte_cryptodev_sym_session_set_private_data() and retrieve it using > rte_cryptodev_sym_session_get_private_data(). > > Signed-off-by: Abhinandan Gujjar <abhinandan.gujjar@intel.com> > Signed-off-by: Nikhil Rao <nikhil.rao@intel.com> This looks good to me. I am expecting then a v1 with the implementation of these functions. Thanks, Pablo ^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [dpdk-dev] [RFC v3, 2/3] cryptodev: add support to set session private data 2018-02-13 14:56 ` De Lara Guarch, Pablo @ 2018-02-13 16:11 ` Gujjar, Abhinandan S 0 siblings, 0 replies; 3+ messages in thread From: Gujjar, Abhinandan S @ 2018-02-13 16:11 UTC (permalink / raw) To: De Lara Guarch, Pablo, Doherty, Declan, akhil.goyal, Jerin.JacobKollanukkaran Cc: dev, Vangati, Narender, Rao, Nikhil Hi Pablo, > -----Original Message----- > From: De Lara Guarch, Pablo > Sent: Tuesday, February 13, 2018 8:27 PM > To: Gujjar, Abhinandan S <abhinandan.gujjar@intel.com>; Doherty, Declan > <declan.doherty@intel.com>; akhil.goyal@nxp.com; > Jerin.JacobKollanukkaran@cavium.com > Cc: dev@dpdk.org; Vangati, Narender <narender.vangati@intel.com>; Rao, > Nikhil <nikhil.rao@intel.com> > Subject: RE: [RFC v3, 2/3] cryptodev: add support to set session private data > > Hi, > > > -----Original Message----- > > From: Gujjar, Abhinandan S > > Sent: Thursday, February 1, 2018 9:30 AM > > To: Doherty, Declan <declan.doherty@intel.com>; akhil.goyal@nxp.com; > > De Lara Guarch, Pablo <pablo.de.lara.guarch@intel.com>; > > Jerin.JacobKollanukkaran@cavium.com > > Cc: dev@dpdk.org; Vangati, Narender <narender.vangati@intel.com>; > > Gujjar, Abhinandan S <abhinandan.gujjar@intel.com>; Rao, Nikhil > > <nikhil.rao@intel.com> > > Subject: [RFC v3, 2/3] cryptodev: add support to set session private > > data > > > > The application may want to store private data along with the > > rte_cryptodev that is transparent to the rte_cryptodev layer. > > For e.g., If an eventdev based application is submitting a > > rte_cryptodev_sym_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_cryptodev_sym_session operation. > > This patch provides a mechanism for the application to associate this > > information with the rte_cryptodev_sym_session session. > > The application can set the private data using > > rte_cryptodev_sym_session_set_private_data() and retrieve it using > > rte_cryptodev_sym_session_get_private_data(). > > > > Signed-off-by: Abhinandan Gujjar <abhinandan.gujjar@intel.com> > > Signed-off-by: Nikhil Rao <nikhil.rao@intel.com> > > This looks good to me. I am expecting then a v1 with the implementation of > these functions. Sure. I will post the implementation. Thanks Abhinandan > > Thanks, > Pablo ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-02-13 16:11 UTC | newest] Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2018-02-01 9:30 [dpdk-dev] [RFC v3, 2/3] cryptodev: add support to set session private data Abhinandan Gujjar 2018-02-13 14:56 ` De Lara Guarch, Pablo 2018-02-13 16:11 ` Gujjar, Abhinandan S
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).