app/compress-perf: optimize ops pool allocation

Message ID 20220223133307.13608-1-rzidane@nvidia.com (mailing list archive)
State Accepted, archived
Delegated to: akhil goyal
Headers
Series app/compress-perf: optimize ops pool allocation |

Checks

Context Check Description
ci/checkpatch warning coding style issues
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/github-robot: build success github build: passed
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-aarch64-unit-testing success Testing PASS
ci/iol-aarch64-compile-testing success Testing PASS
ci/iol-x86_64-compile-testing success Testing PASS
ci/iol-x86_64-unit-testing success Testing PASS
ci/iol-abi-testing success Testing PASS

Commit Message

Raja Zidane Feb. 23, 2022, 1:33 p.m. UTC
  An array of the size of total operations needed for the de/compression is
reserved for ops while enqueueing, although only first burst_size entries
of the array are used.

Reduce the size of the array allocated.

Fixes: b68a82425da4 ("app/compress-perf: add performance measurement")
Cc: stable@dpdk.org

Signed-off-by: Raja Zidane <rzidane@nvidia.com>
---
Acked-by: Matan Azrad matan@nvidia.com
 app/test-compress-perf/comp_perf_test_cyclecount.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
  

Comments

Fan Zhang Feb. 24, 2022, 8:13 p.m. UTC | #1
> -----Original Message-----
> From: Raja Zidane <rzidane@nvidia.com>
> Sent: Wednesday, February 23, 2022 1:33 PM
> To: dev@dpdk.org
> Cc: matan@nvidia.com; stable@dpdk.org
> Subject: [PATCH] app/compress-perf: optimize ops pool allocation
> 
> An array of the size of total operations needed for the de/compression is
> reserved for ops while enqueueing, although only first burst_size entries
> of the array are used.
> 
> Reduce the size of the array allocated.
> 
> Fixes: b68a82425da4 ("app/compress-perf: add performance measurement")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Raja Zidane <rzidane@nvidia.com>
> ---
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
  
Fan Zhang Feb. 24, 2022, 8:14 p.m. UTC | #2
> -----Original Message-----
> From: Raja Zidane <rzidane@nvidia.com>
> Sent: Wednesday, February 23, 2022 1:33 PM
> To: dev@dpdk.org
> Cc: matan@nvidia.com; stable@dpdk.org
> Subject: [PATCH] app/compress-perf: optimize ops pool allocation
> 
> An array of the size of total operations needed for the de/compression is
> reserved for ops while enqueueing, although only first burst_size entries
> of the array are used.
> 
> Reduce the size of the array allocated.
> 
> Fixes: b68a82425da4 ("app/compress-perf: add performance measurement")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Raja Zidane <rzidane@nvidia.com>
> ---
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
  
Akhil Goyal March 4, 2022, 9:33 a.m. UTC | #3
> An array of the size of total operations needed for the de/compression is
> reserved for ops while enqueueing, although only first burst_size entries
> of the array are used.
> 
> Reduce the size of the array allocated.
> 
> Fixes: b68a82425da4 ("app/compress-perf: add performance measurement")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Raja Zidane <rzidane@nvidia.com>
> ---
> Acked-by: Matan Azrad matan@nvidia.com
Please use proper syntax for acks

Applied to dpdk-next-crypto
  

Patch

diff --git a/app/test-compress-perf/comp_perf_test_cyclecount.c b/app/test-compress-perf/comp_perf_test_cyclecount.c
index c215547291..a3f6404eb2 100644
--- a/app/test-compress-perf/comp_perf_test_cyclecount.c
+++ b/app/test-compress-perf/comp_perf_test_cyclecount.c
@@ -175,7 +175,8 @@  main_loop(struct cperf_cyclecount_ctx *ctx, enum rte_comp_xform_type type)
 
 	/* one array for both enqueue and dequeue */
 	ops = rte_zmalloc_socket(NULL,
-		2 * mem->total_bufs * sizeof(struct rte_comp_op *),
+		(test_data->burst_sz + mem->total_bufs) *
+		sizeof(struct rte_comp_op *),
 		0, rte_socket_id());
 
 	if (ops == NULL) {
@@ -184,7 +185,7 @@  main_loop(struct cperf_cyclecount_ctx *ctx, enum rte_comp_xform_type type)
 		return -1;
 	}
 
-	deq_ops = &ops[mem->total_bufs];
+	deq_ops = &ops[test_data->burst_sz];
 
 	if (type == RTE_COMP_COMPRESS) {
 		xform = (struct rte_comp_xform) {