[dpdk-dev] [PATCH 1/4] cryptodev: add rte_crypto_op_bulk_free function
Jain, Deepak K
deepak.k.jain at intel.com
Thu Jun 16 21:49:00 CEST 2016
From: Declan Doherty <declan.doherty at intel.com>
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 <declan.doherty at intel.com>
---
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
More information about the dev
mailing list