From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Jain, Deepak K" Subject: [PATCH 1/4] cryptodev: add rte_crypto_op_bulk_free function Date: Thu, 16 Jun 2016 20:49:00 +0100 Message-ID: <1466106543-209204-2-git-send-email-deepak.k.jain@intel.com> References: <1466106543-209204-1-git-send-email-deepak.k.jain@intel.com> Cc: declan.doherty@intel.com, john.griffin@intel.com, fiona.trahe@intel.com, pablo.de.lara.guarch@intel.com, deepak.k.jain@intel.com To: dev@dpdk.org Return-path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id EC9FCCB46 for ; Thu, 16 Jun 2016 21:49:09 +0200 (CEST) In-Reply-To: <1466106543-209204-1-git-send-email-deepak.k.jain@intel.com> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Declan Doherty Adding rte_crypto_op_bulk_free to free up the ops in bulk so as to expect improvement in performance. Signed-off-by: Declan Doherty --- lib/librte_cryptodev/rte_crypto.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/lib/librte_cryptodev/rte_crypto.h b/lib/librte_cryptodev/rte_crypto.h index 5bc3eaa..31abbdc 100644 --- a/lib/librte_cryptodev/rte_crypto.h +++ b/lib/librte_cryptodev/rte_crypto.h @@ -328,6 +328,21 @@ rte_crypto_op_free(struct rte_crypto_op *op) } /** + * free crypto operation structure + * If operation has been allocate from a rte_mempool, then the operation will + * be returned to the mempool. + * + * @param op symmetric crypto operation + */ +static inline void +rte_crypto_op_bulk_free(struct rte_mempool *mpool, struct rte_crypto_op **ops, + uint16_t nb_ops) +{ + if (ops != NULL) + rte_mempool_put_bulk(mpool, (void * const *)ops, nb_ops); +} + +/** * Allocate a symmetric crypto operation in the private data of an mbuf. * * @param m mbuf which is associated with the crypto operation, the -- 2.5.5