From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id 403397CB3 for ; Mon, 3 Jul 2017 01:57:24 +0200 (CEST) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 02 Jul 2017 16:57:24 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.40,300,1496127600"; d="scan'208";a="106359493" Received: from silpixa00399464.ir.intel.com (HELO silpixa00399464.ger.corp.intel.com) ([10.237.222.157]) by orsmga002.jf.intel.com with ESMTP; 02 Jul 2017 16:57:21 -0700 From: Pablo de Lara To: declan.doherty@intel.com, zbigniew.bodek@caviumnetworks.com, jerin.jacob@caviumnetworks.com, akhil.goyal@nxp.com, hemant.agrawal@nxp.com, fiona.trahe@intel.com, john.griffin@intel.com, deepak.k.jain@intel.com Cc: dev@dpdk.org, Slawomir Mrozowicz , Pablo de Lara Date: Sun, 2 Jul 2017 16:57:15 +0100 Message-Id: <20170702155719.66530-9-pablo.de.lara.guarch@intel.com> X-Mailer: git-send-email 2.9.4 In-Reply-To: <20170702155719.66530-1-pablo.de.lara.guarch@intel.com> References: <20170630170933.56631-1-pablo.de.lara.guarch@intel.com> <20170702155719.66530-1-pablo.de.lara.guarch@intel.com> Subject: [dpdk-dev] [PATCH v3 08/12] cryptodev: remove mempool from session 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: , X-List-Received-Date: Sun, 02 Jul 2017 23:57:24 -0000 From: Slawomir Mrozowicz 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 Signed-off-by: Pablo de Lara --- doc/guides/rel_notes/release_17_08.rst | 1 + lib/librte_cryptodev/rte_cryptodev.c | 7 +++---- lib/librte_cryptodev/rte_cryptodev.h | 6 ------ 3 files changed, 4 insertions(+), 10 deletions(-) diff --git a/doc/guides/rel_notes/release_17_08.rst b/doc/guides/rel_notes/release_17_08.rst index b0657ec..785489a 100644 --- a/doc/guides/rel_notes/release_17_08.rst +++ b/doc/guides/rel_notes/release_17_08.rst @@ -165,6 +165,7 @@ API Changes the new parameter ``device id``. * ``dev_id`` field has been removed from ``rte_cryptodev_sym_session`` structure. * ``driver_id`` field has been removed from ``rte_cryptodev_sym_session`` structure. + * Mempool pointer ``mp`` has been removed from ``rte_cryptodev_sym_session`` structure. ABI Changes diff --git a/lib/librte_cryptodev/rte_cryptodev.c b/lib/librte_cryptodev/rte_cryptodev.c index b0b4816..5c7191b 100644 --- a/lib/librte_cryptodev/rte_cryptodev.c +++ b/lib/librte_cryptodev/rte_cryptodev.c @@ -1026,8 +1026,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); } @@ -1065,7 +1063,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; } @@ -1137,7 +1135,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; } diff --git a/lib/librte_cryptodev/rte_cryptodev.h b/lib/librte_cryptodev/rte_cryptodev.h index 7d574f1..044a4aa 100644 --- a/lib/librte_cryptodev/rte_cryptodev.h +++ b/lib/librte_cryptodev/rte_cryptodev.h @@ -797,12 +797,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 */ }; -- 2.9.4