Skip to content

Commit

Permalink
app/compress-perf: optimize operations pool allocation
Browse files Browse the repository at this point in the history
[ upstream commit 68d3287 ]

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: b68a824 ("app/compress-perf: add performance measurement")

Signed-off-by: Raja Zidane <rzidane@nvidia.com>
Acked-by: Matan Azrad <matan@nvidia.com>
Acked-by: Fan Zhang <roy.fan.zhang@intel.com>
  • Loading branch information
RajaZid20 authored and kevintraynor committed Mar 8, 2022
1 parent 03f2aee commit 0fc99dc
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions app/test-compress-perf/comp_perf_test_cyclecount.c
Expand Up @@ -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) {
Expand All @@ -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) {
Expand Down

0 comments on commit 0fc99dc

Please sign in to comment.