DPDK patches and discussions
 help / color / mirror / Atom feed
From: Ciara Power <ciara.power@intel.com>
Cc: dev@dpdk.org, kai.ji@intel.com,
	Arkadiusz Kusztal <arkadiuszx.kusztal@intel.com>,
	michaelba@nvidia.com, Ciara Power <ciara.power@intel.com>
Subject: [PATCH] app/compress-perf: fix remaining data for ops
Date: Fri, 10 Mar 2023 16:27:05 +0000	[thread overview]
Message-ID: <20230310162705.182352-1-ciara.power@intel.com> (raw)

From: Arkadiusz Kusztal <arkadiuszx.kusztal@intel.com>

Individual variables are needed for tracking the remaining data for
compression and decompression.

Fixes: 83cc3b90ad7a ("app/compress-perf: fix testing single operation")
Cc: michaelba@nvidia.com

Signed-off-by: Arkadiusz Kusztal <arkadiuszx.kusztal@intel.com>
Signed-off-by: Ciara Power <ciara.power@intel.com>
---
 app/test-compress-perf/comp_perf_test_common.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/app/test-compress-perf/comp_perf_test_common.c b/app/test-compress-perf/comp_perf_test_common.c
index cd60958944..78487196ad 100644
--- a/app/test-compress-perf/comp_perf_test_common.c
+++ b/app/test-compress-perf/comp_perf_test_common.c
@@ -366,6 +366,7 @@ int
 prepare_bufs(struct comp_test_data *test_data, struct cperf_mem_resources *mem)
 {
 	uint32_t remaining_data = test_data->input_data_sz;
+	uint32_t remaining_data_decomp = test_data->input_data_sz;
 	uint8_t *input_data_ptr = test_data->input_data;
 	size_t data_sz = 0;
 	uint8_t *data_addr;
@@ -482,7 +483,7 @@ prepare_bufs(struct comp_test_data *test_data, struct cperf_mem_resources *mem)
 		}
 
 		if (decompress_only)
-			data_sz = RTE_MIN(remaining_data, test_data->seg_sz);
+			data_sz = RTE_MIN(remaining_data_decomp, test_data->seg_sz);
 		else
 			data_sz = test_data->out_seg_sz;
 
@@ -496,11 +497,11 @@ prepare_bufs(struct comp_test_data *test_data, struct cperf_mem_resources *mem)
 		if (decompress_only) {
 			rte_memcpy(data_addr, input_data_ptr, data_sz);
 			input_data_ptr += data_sz;
-			remaining_data -= data_sz;
+			remaining_data_decomp -= data_sz;
 		}
 
 		/* Chain mbufs if needed for output mbufs */
-		for (j = 1; j < segs_per_mbuf && remaining_data > 0; j++) {
+		for (j = 1; j < segs_per_mbuf && remaining_data_decomp > 0; j++) {
 			struct rte_mbuf *next_seg =
 				rte_pktmbuf_alloc(mem->comp_buf_pool);
 
@@ -521,7 +522,7 @@ prepare_bufs(struct comp_test_data *test_data, struct cperf_mem_resources *mem)
 			}
 
 			if (decompress_only)
-				data_sz = RTE_MIN(remaining_data,
+				data_sz = RTE_MIN(remaining_data_decomp,
 						  test_data->seg_sz);
 			else
 				data_sz = test_data->out_seg_sz;
@@ -536,7 +537,7 @@ prepare_bufs(struct comp_test_data *test_data, struct cperf_mem_resources *mem)
 			if (decompress_only) {
 				rte_memcpy(data_addr, input_data_ptr, data_sz);
 				input_data_ptr += data_sz;
-				remaining_data -= data_sz;
+				remaining_data_decomp -= data_sz;
 			}
 
 			if (rte_pktmbuf_chain(mem->comp_bufs[i],
-- 
2.25.1


             reply	other threads:[~2023-03-10 16:27 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-10 16:27 Ciara Power [this message]
2023-03-15 10:31 ` Ji, Kai
2023-03-16 18:22   ` 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=20230310162705.182352-1-ciara.power@intel.com \
    --to=ciara.power@intel.com \
    --cc=arkadiuszx.kusztal@intel.com \
    --cc=dev@dpdk.org \
    --cc=kai.ji@intel.com \
    --cc=michaelba@nvidia.com \
    /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).