From mboxrd@z Thu Jan 1 00:00:00 1970 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) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga101.jf.intel.com with ESMTP; 16 Jun 2016 12:49:09 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.26,481,1459839600"; d="scan'208";a="977287776" Received: from sie-lab-214-241.ir.intel.com (HELO silpixa00382162.ir.intel.com) ([10.237.214.241]) by orsmga001.jf.intel.com with ESMTP; 16 Jun 2016 12:49:07 -0700 From: "Jain, Deepak K" To: dev@dpdk.org Cc: declan.doherty@intel.com, john.griffin@intel.com, fiona.trahe@intel.com, pablo.de.lara.guarch@intel.com, deepak.k.jain@intel.com Date: Thu, 16 Jun 2016 20:49:00 +0100 Message-Id: <1466106543-209204-2-git-send-email-deepak.k.jain@intel.com> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1466106543-209204-1-git-send-email-deepak.k.jain@intel.com> References: <1466106543-209204-1-git-send-email-deepak.k.jain@intel.com> Subject: [dpdk-dev] [PATCH 1/4] cryptodev: add rte_crypto_op_bulk_free function X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Jun 2016 19:49:10 -0000 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