* [dpdk-dev] [PATCH 0/2] compressdev: add bulk op free API
@ 2018-11-19 22:10 Fiona Trahe
2018-11-19 22:10 ` [dpdk-dev] [PATCH 1/2] compressdev: add api to bulk free ops Fiona Trahe
` (2 more replies)
0 siblings, 3 replies; 7+ messages in thread
From: Fiona Trahe @ 2018-11-19 22:10 UTC (permalink / raw)
To: dev
Cc: akhil.goyal, tomaszx.jozwiak, shally.verma, ashish.gupta,
lee.daly, fiona.trahe
Add API to bulk free operations and use
it in the unit test suite.
Fiona Trahe (2):
compressdev: add api to bulk free ops
test/compress: use bulk free operations api
lib/librte_compressdev/rte_comp.c | 12 ++++++++++++
lib/librte_compressdev/rte_comp.h | 14 ++++++++++++++
lib/librte_compressdev/rte_compressdev_version.map | 1 +
test/test/test_compressdev.c | 15 ++++++++++-----
4 files changed, 37 insertions(+), 5 deletions(-)
--
2.7.4
^ permalink raw reply [flat|nested] 7+ messages in thread
* [dpdk-dev] [PATCH 1/2] compressdev: add api to bulk free ops
2018-11-19 22:10 [dpdk-dev] [PATCH 0/2] compressdev: add bulk op free API Fiona Trahe
@ 2018-11-19 22:10 ` Fiona Trahe
2018-11-20 5:20 ` Verma, Shally
2018-11-19 22:10 ` [dpdk-dev] [PATCH 2/2] test/compress: use bulk free operations api Fiona Trahe
2018-12-18 10:20 ` [dpdk-dev] [PATCH 0/2] compressdev: add bulk op free API Akhil Goyal
2 siblings, 1 reply; 7+ messages in thread
From: Fiona Trahe @ 2018-11-19 22:10 UTC (permalink / raw)
To: dev
Cc: akhil.goyal, tomaszx.jozwiak, shally.verma, ashish.gupta,
lee.daly, fiona.trahe
There's an API to bulk allocate operations,
this adds a corresponding bulk free API.
Signed-off-by: Fiona Trahe <fiona.trahe@intel.com>
---
lib/librte_compressdev/rte_comp.c | 12 ++++++++++++
lib/librte_compressdev/rte_comp.h | 14 ++++++++++++++
lib/librte_compressdev/rte_compressdev_version.map | 1 +
3 files changed, 27 insertions(+)
diff --git a/lib/librte_compressdev/rte_comp.c b/lib/librte_compressdev/rte_comp.c
index 4634c12..06e3d44 100644
--- a/lib/librte_compressdev/rte_comp.c
+++ b/lib/librte_compressdev/rte_comp.c
@@ -213,3 +213,15 @@ rte_comp_op_free(struct rte_comp_op *op)
if (op != NULL && op->mempool != NULL)
rte_mempool_put(op->mempool, op);
}
+
+void __rte_experimental
+rte_comp_op_bulk_free(struct rte_comp_op **ops, uint16_t nb_ops)
+{
+ uint16_t i;
+
+ for (i = 0; i < nb_ops; i++) {
+ if (ops[i] != NULL && ops[i]->mempool != NULL)
+ rte_mempool_put(ops[i]->mempool, ops[i]);
+ ops[i] = NULL;
+ }
+}
diff --git a/lib/librte_compressdev/rte_comp.h b/lib/librte_compressdev/rte_comp.h
index 395ce29..c2b3de8 100644
--- a/lib/librte_compressdev/rte_comp.h
+++ b/lib/librte_compressdev/rte_comp.h
@@ -467,6 +467,20 @@ void __rte_experimental
rte_comp_op_free(struct rte_comp_op *op);
/**
+ * Bulk free operation structures
+ * If operations have been allocated from an rte_mempool, then the operations
+ * will be returned to the mempool.
+ * The array entry will be cleared.
+ *
+ * @param ops
+ * Array of Compress operations
+ * @param nb_ops
+ * Number of operations to free
+ */
+void __rte_experimental
+rte_comp_op_bulk_free(struct rte_comp_op **ops, uint16_t nb_ops);
+
+/**
* Get the name of a compress service feature flag
*
* @param flag
diff --git a/lib/librte_compressdev/rte_compressdev_version.map b/lib/librte_compressdev/rte_compressdev_version.map
index 6f900b6..13a047e 100644
--- a/lib/librte_compressdev/rte_compressdev_version.map
+++ b/lib/librte_compressdev/rte_compressdev_version.map
@@ -32,6 +32,7 @@ EXPERIMENTAL {
rte_comp_get_feature_name;
rte_comp_op_alloc;
rte_comp_op_bulk_alloc;
+ rte_comp_op_bulk_free;
rte_comp_op_free;
rte_comp_op_pool_create;
--
2.7.4
^ permalink raw reply [flat|nested] 7+ messages in thread
* [dpdk-dev] [PATCH 2/2] test/compress: use bulk free operations api
2018-11-19 22:10 [dpdk-dev] [PATCH 0/2] compressdev: add bulk op free API Fiona Trahe
2018-11-19 22:10 ` [dpdk-dev] [PATCH 1/2] compressdev: add api to bulk free ops Fiona Trahe
@ 2018-11-19 22:10 ` Fiona Trahe
2018-11-20 5:20 ` Verma, Shally
2018-11-22 10:45 ` Daly, Lee
2018-12-18 10:20 ` [dpdk-dev] [PATCH 0/2] compressdev: add bulk op free API Akhil Goyal
2 siblings, 2 replies; 7+ messages in thread
From: Fiona Trahe @ 2018-11-19 22:10 UTC (permalink / raw)
To: dev
Cc: akhil.goyal, tomaszx.jozwiak, shally.verma, ashish.gupta,
lee.daly, fiona.trahe
Use the new rte_comp_op_bulk_free API.
Add trace to catch any mempool elements not freed at test end.
Signed-off-by: Fiona Trahe <fiona.trahe@intel.com>
---
test/test/test_compressdev.c | 15 ++++++++++-----
1 file changed, 10 insertions(+), 5 deletions(-)
diff --git a/test/test/test_compressdev.c b/test/test/test_compressdev.c
index 5d5e519..3ea726d 100644
--- a/test/test/test_compressdev.c
+++ b/test/test/test_compressdev.c
@@ -69,6 +69,13 @@ testsuite_teardown(void)
{
struct comp_testsuite_params *ts_params = &testsuite_params;
+ if (rte_mempool_in_use_count(ts_params->large_mbuf_pool))
+ RTE_LOG(ERR, USER1, "Large mbuf pool still has unfreed bufs\n");
+ if (rte_mempool_in_use_count(ts_params->small_mbuf_pool))
+ RTE_LOG(ERR, USER1, "Small mbuf pool still has unfreed bufs\n");
+ if (rte_mempool_in_use_count(ts_params->op_pool))
+ RTE_LOG(ERR, USER1, "op pool still has unfreed ops\n");
+
rte_mempool_free(ts_params->large_mbuf_pool);
rte_mempool_free(ts_params->small_mbuf_pool);
rte_mempool_free(ts_params->op_pool);
@@ -731,6 +738,7 @@ test_deflate_comp_decomp(const char * const test_bufs[],
goto exit;
}
+
for (i = 0; i < num_bufs; i++) {
ops[i]->m_src = uncomp_bufs[i];
ops[i]->m_dst = comp_bufs[i];
@@ -961,12 +969,9 @@ test_deflate_comp_decomp(const char * const test_bufs[],
/*
* Free the previous compress operations,
- * as it is not needed anymore
+ * as they are not needed anymore
*/
- for (i = 0; i < num_bufs; i++) {
- rte_comp_op_free(ops_processed[i]);
- ops_processed[i] = NULL;
- }
+ rte_comp_op_bulk_free(ops_processed, num_bufs);
/* Decompress data (either with Zlib API or compressdev API */
if (zlib_dir == ZLIB_DECOMPRESS || zlib_dir == ZLIB_ALL) {
--
2.7.4
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [dpdk-dev] [PATCH 2/2] test/compress: use bulk free operations api
2018-11-19 22:10 ` [dpdk-dev] [PATCH 2/2] test/compress: use bulk free operations api Fiona Trahe
@ 2018-11-20 5:20 ` Verma, Shally
2018-11-22 10:45 ` Daly, Lee
1 sibling, 0 replies; 7+ messages in thread
From: Verma, Shally @ 2018-11-20 5:20 UTC (permalink / raw)
To: Fiona Trahe, dev; +Cc: akhil.goyal, tomaszx.jozwiak, Gupta, Ashish, lee.daly
>-----Original Message-----
>From: Fiona Trahe <fiona.trahe@intel.com>
>Sent: 20 November 2018 03:40
>To: dev@dpdk.org
>Cc: akhil.goyal@nxp.com; tomaszx.jozwiak@intel.com; Verma, Shally <Shally.Verma@cavium.com>; Gupta, Ashish
><Ashish.Gupta@cavium.com>; lee.daly@intel.com; fiona.trahe@intel.com
>Subject: [PATCH 2/2] test/compress: use bulk free operations api
>
>External Email
>
>Use the new rte_comp_op_bulk_free API.
>Add trace to catch any mempool elements not freed at test end.
>
>Signed-off-by: Fiona Trahe <fiona.trahe@intel.com>
>---
> test/test/test_compressdev.c | 15 ++++++++++-----
> 1 file changed, 10 insertions(+), 5 deletions(-)
>
>diff --git a/test/test/test_compressdev.c b/test/test/test_compressdev.c
>index 5d5e519..3ea726d 100644
>--- a/test/test/test_compressdev.c
>+++ b/test/test/test_compressdev.c
>@@ -69,6 +69,13 @@ testsuite_teardown(void)
> {
> struct comp_testsuite_params *ts_params = &testsuite_params;
>
>+ if (rte_mempool_in_use_count(ts_params->large_mbuf_pool))
>+ RTE_LOG(ERR, USER1, "Large mbuf pool still has unfreed bufs\n");
>+ if (rte_mempool_in_use_count(ts_params->small_mbuf_pool))
>+ RTE_LOG(ERR, USER1, "Small mbuf pool still has unfreed bufs\n");
>+ if (rte_mempool_in_use_count(ts_params->op_pool))
>+ RTE_LOG(ERR, USER1, "op pool still has unfreed ops\n");
>+
> rte_mempool_free(ts_params->large_mbuf_pool);
> rte_mempool_free(ts_params->small_mbuf_pool);
> rte_mempool_free(ts_params->op_pool);
>@@ -731,6 +738,7 @@ test_deflate_comp_decomp(const char * const test_bufs[],
> goto exit;
> }
>
>+
> for (i = 0; i < num_bufs; i++) {
> ops[i]->m_src = uncomp_bufs[i];
> ops[i]->m_dst = comp_bufs[i];
>@@ -961,12 +969,9 @@ test_deflate_comp_decomp(const char * const test_bufs[],
>
> /*
> * Free the previous compress operations,
>- * as it is not needed anymore
>+ * as they are not needed anymore
> */
>- for (i = 0; i < num_bufs; i++) {
>- rte_comp_op_free(ops_processed[i]);
>- ops_processed[i] = NULL;
>- }
>+ rte_comp_op_bulk_free(ops_processed, num_bufs);
>
> /* Decompress data (either with Zlib API or compressdev API */
> if (zlib_dir == ZLIB_DECOMPRESS || zlib_dir == ZLIB_ALL) {
>--
>2.7.4
Acked-by: Shally Verma <shally.verma@caviumnetworks.com>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [dpdk-dev] [PATCH 1/2] compressdev: add api to bulk free ops
2018-11-19 22:10 ` [dpdk-dev] [PATCH 1/2] compressdev: add api to bulk free ops Fiona Trahe
@ 2018-11-20 5:20 ` Verma, Shally
0 siblings, 0 replies; 7+ messages in thread
From: Verma, Shally @ 2018-11-20 5:20 UTC (permalink / raw)
To: Fiona Trahe, dev; +Cc: akhil.goyal, tomaszx.jozwiak, Gupta, Ashish, lee.daly
>-----Original Message-----
>From: Fiona Trahe <fiona.trahe@intel.com>
>Sent: 20 November 2018 03:40
>To: dev@dpdk.org
>Cc: akhil.goyal@nxp.com; tomaszx.jozwiak@intel.com; Verma, Shally <Shally.Verma@cavium.com>; Gupta, Ashish
><Ashish.Gupta@cavium.com>; lee.daly@intel.com; fiona.trahe@intel.com
>Subject: [PATCH 1/2] compressdev: add api to bulk free ops
>
>External Email
>
>There's an API to bulk allocate operations,
>this adds a corresponding bulk free API.
>
>
>Signed-off-by: Fiona Trahe <fiona.trahe@intel.com>
Acked-by: Shally Verma <shally.verma@caviumnetworks.com>
>---
> lib/librte_compressdev/rte_comp.c | 12 ++++++++++++
> lib/librte_compressdev/rte_comp.h | 14 ++++++++++++++
> lib/librte_compressdev/rte_compressdev_version.map | 1 +
> 3 files changed, 27 insertions(+)
>
>diff --git a/lib/librte_compressdev/rte_comp.c b/lib/librte_compressdev/rte_comp.c
>index 4634c12..06e3d44 100644
>--- a/lib/librte_compressdev/rte_comp.c
>+++ b/lib/librte_compressdev/rte_comp.c
>@@ -213,3 +213,15 @@ rte_comp_op_free(struct rte_comp_op *op)
> if (op != NULL && op->mempool != NULL)
> rte_mempool_put(op->mempool, op);
> }
>+
>+void __rte_experimental
>+rte_comp_op_bulk_free(struct rte_comp_op **ops, uint16_t nb_ops)
>+{
>+ uint16_t i;
>+
>+ for (i = 0; i < nb_ops; i++) {
>+ if (ops[i] != NULL && ops[i]->mempool != NULL)
>+ rte_mempool_put(ops[i]->mempool, ops[i]);
>+ ops[i] = NULL;
>+ }
>+}
>diff --git a/lib/librte_compressdev/rte_comp.h b/lib/librte_compressdev/rte_comp.h
>index 395ce29..c2b3de8 100644
>--- a/lib/librte_compressdev/rte_comp.h
>+++ b/lib/librte_compressdev/rte_comp.h
>@@ -467,6 +467,20 @@ void __rte_experimental
> rte_comp_op_free(struct rte_comp_op *op);
>
> /**
>+ * Bulk free operation structures
>+ * If operations have been allocated from an rte_mempool, then the operations
>+ * will be returned to the mempool.
>+ * The array entry will be cleared.
>+ *
>+ * @param ops
>+ * Array of Compress operations
>+ * @param nb_ops
>+ * Number of operations to free
>+ */
>+void __rte_experimental
>+rte_comp_op_bulk_free(struct rte_comp_op **ops, uint16_t nb_ops);
>+
>+/**
> * Get the name of a compress service feature flag
> *
> * @param flag
>diff --git a/lib/librte_compressdev/rte_compressdev_version.map b/lib/librte_compressdev/rte_compressdev_version.map
>index 6f900b6..13a047e 100644
>--- a/lib/librte_compressdev/rte_compressdev_version.map
>+++ b/lib/librte_compressdev/rte_compressdev_version.map
>@@ -32,6 +32,7 @@ EXPERIMENTAL {
> rte_comp_get_feature_name;
> rte_comp_op_alloc;
> rte_comp_op_bulk_alloc;
>+ rte_comp_op_bulk_free;
> rte_comp_op_free;
> rte_comp_op_pool_create;
>
>--
>2.7.4
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [dpdk-dev] [PATCH 2/2] test/compress: use bulk free operations api
2018-11-19 22:10 ` [dpdk-dev] [PATCH 2/2] test/compress: use bulk free operations api Fiona Trahe
2018-11-20 5:20 ` Verma, Shally
@ 2018-11-22 10:45 ` Daly, Lee
1 sibling, 0 replies; 7+ messages in thread
From: Daly, Lee @ 2018-11-22 10:45 UTC (permalink / raw)
To: Trahe, Fiona, dev
Cc: akhil.goyal, Jozwiak, TomaszX, shally.verma, ashish.gupta
> -----Original Message-----
> From: Trahe, Fiona
> Sent: Monday, November 19, 2018 10:10 PM
> To: dev@dpdk.org
> Cc: akhil.goyal@nxp.com; Jozwiak, TomaszX <tomaszx.jozwiak@intel.com>;
> shally.verma@caviumnetworks.com; ashish.gupta@caviumnetworks.com;
> Daly, Lee <lee.daly@intel.com>; Trahe, Fiona <fiona.trahe@intel.com>
> Subject: [PATCH 2/2] test/compress: use bulk free operations api
>
> Use the new rte_comp_op_bulk_free API.
> Add trace to catch any mempool elements not freed at test end.
>
> Signed-off-by: Fiona Trahe <fiona.trahe@intel.com>
> ---
> test/test/test_compressdev.c | 15 ++++++++++-----
> 1 file changed, 10 insertions(+), 5 deletions(-)
>
> diff --git a/test/test/test_compressdev.c b/test/test/test_compressdev.c
> index 5d5e519..3ea726d 100644
> --- a/test/test/test_compressdev.c
> +++ b/test/test/test_compressdev.c
> @@ -69,6 +69,13 @@ testsuite_teardown(void) {
> struct comp_testsuite_params *ts_params = &testsuite_params;
>
> + if (rte_mempool_in_use_count(ts_params->large_mbuf_pool))
> + RTE_LOG(ERR, USER1, "Large mbuf pool still has unfreed
> bufs\n");
> + if (rte_mempool_in_use_count(ts_params->small_mbuf_pool))
> + RTE_LOG(ERR, USER1, "Small mbuf pool still has unfreed
> bufs\n");
> + if (rte_mempool_in_use_count(ts_params->op_pool))
> + RTE_LOG(ERR, USER1, "op pool still has unfreed ops\n");
> +
> rte_mempool_free(ts_params->large_mbuf_pool);
> rte_mempool_free(ts_params->small_mbuf_pool);
> rte_mempool_free(ts_params->op_pool);
> @@ -731,6 +738,7 @@ test_deflate_comp_decomp(const char * const
> test_bufs[],
> goto exit;
> }
>
> +
> for (i = 0; i < num_bufs; i++) {
> ops[i]->m_src = uncomp_bufs[i];
> ops[i]->m_dst = comp_bufs[i];
> @@ -961,12 +969,9 @@ test_deflate_comp_decomp(const char * const
> test_bufs[],
>
> /*
> * Free the previous compress operations,
> - * as it is not needed anymore
> + * as they are not needed anymore
> */
> - for (i = 0; i < num_bufs; i++) {
> - rte_comp_op_free(ops_processed[i]);
> - ops_processed[i] = NULL;
> - }
> + rte_comp_op_bulk_free(ops_processed, num_bufs);
>
> /* Decompress data (either with Zlib API or compressdev API */
> if (zlib_dir == ZLIB_DECOMPRESS || zlib_dir == ZLIB_ALL) {
> --
> 2.7.4
Series Acked-by: Lee Daly <lee.daly@intel.com>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [dpdk-dev] [PATCH 0/2] compressdev: add bulk op free API
2018-11-19 22:10 [dpdk-dev] [PATCH 0/2] compressdev: add bulk op free API Fiona Trahe
2018-11-19 22:10 ` [dpdk-dev] [PATCH 1/2] compressdev: add api to bulk free ops Fiona Trahe
2018-11-19 22:10 ` [dpdk-dev] [PATCH 2/2] test/compress: use bulk free operations api Fiona Trahe
@ 2018-12-18 10:20 ` Akhil Goyal
2 siblings, 0 replies; 7+ messages in thread
From: Akhil Goyal @ 2018-12-18 10:20 UTC (permalink / raw)
To: Fiona Trahe, dev; +Cc: tomaszx.jozwiak, shally.verma, ashish.gupta, lee.daly
On 11/20/2018 3:40 AM, Fiona Trahe wrote:
> Add API to bulk free operations and use
> it in the unit test suite.
>
> Fiona Trahe (2):
> compressdev: add api to bulk free ops
> test/compress: use bulk free operations api
>
> lib/librte_compressdev/rte_comp.c | 12 ++++++++++++
> lib/librte_compressdev/rte_comp.h | 14 ++++++++++++++
> lib/librte_compressdev/rte_compressdev_version.map | 1 +
> test/test/test_compressdev.c | 15 ++++++++++-----
> 4 files changed, 37 insertions(+), 5 deletions(-)
>
Applied to dpdk-next-crypto
Thanks
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2018-12-18 10:20 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-19 22:10 [dpdk-dev] [PATCH 0/2] compressdev: add bulk op free API Fiona Trahe
2018-11-19 22:10 ` [dpdk-dev] [PATCH 1/2] compressdev: add api to bulk free ops Fiona Trahe
2018-11-20 5:20 ` Verma, Shally
2018-11-19 22:10 ` [dpdk-dev] [PATCH 2/2] test/compress: use bulk free operations api Fiona Trahe
2018-11-20 5:20 ` Verma, Shally
2018-11-22 10:45 ` Daly, Lee
2018-12-18 10:20 ` [dpdk-dev] [PATCH 0/2] compressdev: add bulk op free API Akhil Goyal
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).