[PATCH v3 16/16] app/test-compress-perf: use common division round up macro

Joshua Washington joshwash at google.com
Wed Sep 23 03:07:39 CEST 2026


The RTE_DIV_ROUND_UP in rte_common.h makes DIV_CEIL redundant.

Signed-off-by: Joshua Washington <joshwash at google.com>
---
Changes in v3:
  - New patch converting DIV_CEIL in comp_perf_test_common.c.
---
 app/test-compress-perf/comp_perf_test_common.c | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)

diff --git a/app/test-compress-perf/comp_perf_test_common.c b/app/test-compress-perf/comp_perf_test_common.c
index 78487196ad..3f70c222c4 100644
--- a/app/test-compress-perf/comp_perf_test_common.c
+++ b/app/test-compress-perf/comp_perf_test_common.c
@@ -14,9 +14,6 @@
 #include "comp_perf_test_common.h"
 #include "comp_perf_test_verify.h"
 
-
-#define DIV_CEIL(a, b)  ((a) / (b) + ((a) % (b) != 0))
-
 struct cperf_buffer_info {
 	uint16_t total_segments;
 	uint16_t segment_sz;
@@ -238,8 +235,8 @@ comp_perf_allocate_memory(struct comp_test_data *test_data,
 		 * Number of segments for input and output
 		 * (compression and decompression)
 		 */
-		test_data->total_segs = DIV_CEIL(test_data->input_data_sz,
-						 test_data->seg_sz);
+		test_data->total_segs = RTE_DIV_ROUND_UP(test_data->input_data_sz,
+							 test_data->seg_sz);
 	} else {
 		/*
 		 * When application does decompression only, input data is
@@ -292,8 +289,8 @@ comp_perf_allocate_memory(struct comp_test_data *test_data,
 		return -1;
 	}
 
-	mem->total_bufs = DIV_CEIL(test_data->total_segs,
-				   test_data->max_sgl_segs);
+	mem->total_bufs = RTE_DIV_ROUND_UP(test_data->total_segs,
+					   test_data->max_sgl_segs);
 
 	snprintf(pool_name, sizeof(pool_name), "op_pool_%u_qp_%u",
 			mem->dev_id, mem->qp_id);
@@ -557,7 +554,7 @@ prepare_bufs(struct comp_test_data *test_data, struct cperf_mem_resources *mem)
 void
 print_test_dynamics(const struct comp_test_data *test_data)
 {
-	uint32_t opt_total_segs = DIV_CEIL(buffer_info.input_data_sz,
+	uint32_t opt_total_segs = RTE_DIV_ROUND_UP(buffer_info.input_data_sz,
 			MAX_SEG_SIZE);
 
 	if (buffer_info.total_buffs > 1) {
-- 
2.55.0.1082.g2b9226bbc0-goog



More information about the dev mailing list