From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id C2A4841E65; Fri, 10 Mar 2023 17:27:12 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A5C8840A8B; Fri, 10 Mar 2023 17:27:12 +0100 (CET) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by mails.dpdk.org (Postfix) with ESMTP id 166D340685 for ; Fri, 10 Mar 2023 17:27:10 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1678465631; x=1710001631; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=P6BVy19f7fogos5gnqdxG1E05ml9Xy3sJJTUnpj9QhU=; b=PAuTJaPfV70FXskHEjWwEwEP4LpBVUMcs+ywSOAfIjZWi2ykwhf+Do2Q wPeld7tJ5t882uHfqzovI1jHvcBaRbtqNxuhQLuZ6R5c+2JK7rzMFf8jo 3KZDh+2re0jqn40weRzMW6kROa3XW8lpjXCDX/Tvg//S66kNIshi630ay j9pWQWuaDkCRnDrakLMoME/7FNCj7M5QD1L00TjoG/Op/b982Uk/E5AFU UaC/oFTZ5IezW+HiWlW8xkhXG30YJc1hQTKvTjb4WTeKiAO/Kmk53CQmh 5CeaYg5fx5JqJbPyVYNSEPeilvjZcSpkh/j///K5oBqq4whpR4D24t3lN A==; X-IronPort-AV: E=McAfee;i="6500,9779,10645"; a="335462293" X-IronPort-AV: E=Sophos;i="5.98,250,1673942400"; d="scan'208";a="335462293" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Mar 2023 08:27:10 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10645"; a="710324705" X-IronPort-AV: E=Sophos;i="5.98,250,1673942400"; d="scan'208";a="710324705" Received: from silpixa00400355.ir.intel.com (HELO silpixa00400355.ger.corp.intel.com) ([10.237.222.80]) by orsmga001.jf.intel.com with ESMTP; 10 Mar 2023 08:27:08 -0800 From: Ciara Power To: Cc: dev@dpdk.org, kai.ji@intel.com, Arkadiusz Kusztal , michaelba@nvidia.com, Ciara Power Subject: [PATCH] app/compress-perf: fix remaining data for ops Date: Fri, 10 Mar 2023 16:27:05 +0000 Message-Id: <20230310162705.182352-1-ciara.power@intel.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org From: Arkadiusz Kusztal 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 Signed-off-by: Ciara Power --- 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