Skip to content

Commit

Permalink
cryptodev: remove mempool from session
Browse files Browse the repository at this point in the history
Mempool pointer can be obtained from the object itself,
which means that it is not required to actually store the pointer
in the session.

Signed-off-by: Slawomir Mrozowicz <slawomirx.mrozowicz@intel.com>
Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Declan Doherty <declan.doherty@intel.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
  • Loading branch information
smrozowx authored and pablodelara committed Jul 6, 2017
1 parent 70c5c3d commit 7c110ce
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 10 deletions.
1 change: 1 addition & 0 deletions doc/guides/rel_notes/release_17_08.rst
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ New Features

* ``dev_id`` field has been removed.
* ``driver_id`` field has been removed.
* Mempool pointer ``mp`` has been removed.

* **Updated cryptodev library.**

Expand Down
7 changes: 3 additions & 4 deletions lib/librte_cryptodev/rte_cryptodev.c
Original file line number Diff line number Diff line change
Expand Up @@ -1087,8 +1087,6 @@ rte_cryptodev_sym_session_init(struct rte_mempool *mp,
{
memset(sess, 0, mp->elt_size);

sess->mp = mp;

if (dev->dev_ops->session_initialize)
(*dev->dev_ops->session_initialize)(mp, sess);
}
Expand Down Expand Up @@ -1126,7 +1124,7 @@ rte_cryptodev_sym_session_create(uint8_t dev_id,
dev_id);

/* Return session to mempool */
rte_mempool_put(sess->mp, _sess);
rte_mempool_put(dev->data->session_pool, _sess);
return NULL;
}

Expand Down Expand Up @@ -1198,7 +1196,8 @@ rte_cryptodev_sym_session_free(uint8_t dev_id,
dev->dev_ops->session_clear(dev, (void *)sess->_private);

/* Return session to mempool */
rte_mempool_put(sess->mp, (void *)sess);
struct rte_mempool *mp = rte_mempool_from_obj(sess);
rte_mempool_put(mp, (void *)sess);

return NULL;
}
Expand Down
6 changes: 0 additions & 6 deletions lib/librte_cryptodev/rte_cryptodev.h
Original file line number Diff line number Diff line change
Expand Up @@ -883,12 +883,6 @@ rte_cryptodev_enqueue_burst(uint8_t dev_id, uint16_t qp_id,
/** Cryptodev symmetric crypto session */
struct rte_cryptodev_sym_session {
RTE_STD_C11
struct {
struct rte_mempool *mp;
/**< Mempool session allocated from */
} __rte_aligned(8);
/**< Public symmetric session details */

__extension__ char _private[0];
/**< Private session material */
};
Expand Down

0 comments on commit 7c110ce

Please sign in to comment.