[dpdk-dev,v2,02/11] cryptodev: move session init out of session pool creation

Message ID 20170630170933.56631-3-pablo.de.lara.guarch@intel.com (mailing list archive)
State Superseded, archived
Delegated to: Pablo de Lara Guarch
Headers

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation fail apply patch file failure

Commit Message

De Lara Guarch, Pablo June 30, 2017, 5:09 p.m. UTC
  Prior to removing the session pool creation from cryptodev
configure function, session init function needs to be
separated from the pool creation.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
---
 lib/librte_cryptodev/rte_cryptodev.c | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)
  

Patch

diff --git a/lib/librte_cryptodev/rte_cryptodev.c b/lib/librte_cryptodev/rte_cryptodev.c
index 17f7c63..d1e0ecc 100644
--- a/lib/librte_cryptodev/rte_cryptodev.c
+++ b/lib/librte_cryptodev/rte_cryptodev.c
@@ -1030,13 +1030,9 @@  rte_cryptodev_pmd_callback_process(struct rte_cryptodev *dev,
 
 static void
 rte_cryptodev_sym_session_init(struct rte_mempool *mp,
-		void *opaque_arg,
-		void *_sess,
-		__rte_unused unsigned i)
+		struct rte_cryptodev *dev,
+		struct rte_cryptodev_sym_session *sess)
 {
-	struct rte_cryptodev_sym_session *sess = _sess;
-	struct rte_cryptodev *dev = opaque_arg;
-
 	memset(sess, 0, mp->elt_size);
 
 	sess->dev_id = dev->data->dev_id;
@@ -1093,8 +1089,7 @@  rte_cryptodev_sym_session_pool_create(struct rte_cryptodev *dev,
 				0, /* private data size */
 				NULL, /* obj initialization constructor */
 				NULL, /* obj initialization constructor arg */
-				rte_cryptodev_sym_session_init,
-				/**< obj constructor*/
+				NULL, /**< obj constructor*/
 				dev, /* obj constructor arg */
 				socket_id, /* socket id */
 				0); /* flags */
@@ -1132,6 +1127,8 @@  rte_cryptodev_sym_session_create(uint8_t dev_id,
 
 	sess = _sess;
 
+	rte_cryptodev_sym_session_init(dev->data->session_pool, dev,
+					sess);
 	RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->session_configure, NULL);
 	if (dev->dev_ops->session_configure(dev, xform, sess->_private) ==
 			NULL) {