DPDK patches and discussions
 help / color / mirror / Atom feed
From: Raja Zidane <rzidane@nvidia.com>
To: <dev@dpdk.org>
Cc: <matan@nvidia.com>, <stable@dpdk.org>
Subject: [PATCH] app/compress-perf: fix cyclecount enqueue ops allocation
Date: Wed, 23 Feb 2022 15:32:17 +0200	[thread overview]
Message-ID: <20220223133217.13502-1-rzidane@nvidia.com> (raw)

In cyclecount main_loop function, each iteration it tries to enqueue X ops,
in case Y<X ops were enqueued, the rest of the X-Y ops are moved to the
beginning of the ops array, to preserve ops order, and next Y ops are
allocated for the next enqueue action, the allocation of the ops occures on
the first Y entries in the array, when it should have skipped the first X-Y
array entries and allocate the following Y entries.

Fix the allocation by adding the correct offset.

Fixes: 2695db95a147 ("test/compress: add cycle-count mode to perf tool")
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 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/app/test-compress-perf/comp_perf_test_cyclecount.c b/app/test-compress-perf/comp_perf_test_cyclecount.c
index 1d8e5fe6c2..c215547291 100644
--- a/app/test-compress-perf/comp_perf_test_cyclecount.c
+++ b/app/test-compress-perf/comp_perf_test_cyclecount.c
@@ -273,7 +273,7 @@ main_loop(struct cperf_cyclecount_ctx *ctx, enum rte_comp_xform_type type)
 			/* Allocate compression operations */
 			if (ops_needed && rte_mempool_get_bulk(
 						mem->op_pool,
-						(void **)ops,
+						(void **)&ops[ops_unused],
 						ops_needed) != 0) {
 				RTE_LOG(ERR, USER1,
 				      "Could not allocate enough operations\n");
-- 
2.21.0


             reply	other threads:[~2022-02-23 13:32 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-23 13:32 Raja Zidane [this message]
2022-03-04  9:27 ` [EXT] " Akhil Goyal

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220223133217.13502-1-rzidane@nvidia.com \
    --to=rzidane@nvidia.com \
    --cc=dev@dpdk.org \
    --cc=matan@nvidia.com \
    --cc=stable@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).