[PATCH v4 14/15] app/test: use common division round up macro
Joshua Washington
joshwash at google.com
Tue Oct 6 04:30:50 CEST 2026
The RTE_DIV_ROUND_UP in rte_common.h makes DIV_CEIL redundant.
Signed-off-by: Joshua Washington <joshwash at google.com>
Acked-by: Chengwen Feng <fengchengwen at huawei.com>
---
Changes in v4:
- Add rte_common.h include.
Changes in v3:
- New patch converting DIV_CEIL in test_compressdev.c.
---
app/test/test_compressdev.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/app/test/test_compressdev.c b/app/test/test_compressdev.c
index 293d1d757f..ed0352a909 100644
--- a/app/test/test_compressdev.c
+++ b/app/test/test_compressdev.c
@@ -14,12 +14,11 @@
#include <rte_mbuf.h>
#include <rte_compressdev.h>
#include <rte_string_fns.h>
+#include <rte_common.h>
#include "test_compressdev_test_buffer.h"
#include "test.h"
-#define DIV_CEIL(a, b) ((a) / (b) + ((a) % (b) != 0))
-
#define DEFAULT_WINDOW_SIZE 15
#define DEFAULT_MEM_LEVEL 8
#define MAX_DEQD_RETRIES 10
@@ -688,7 +687,7 @@ prepare_sgl_bufs(const char *test_buf, struct rte_mbuf *head_buf,
uint16_t seg_size)
{
uint32_t remaining_data = total_data_size;
- uint16_t num_remaining_segs = DIV_CEIL(remaining_data, seg_size);
+ uint16_t num_remaining_segs = RTE_DIV_ROUND_UP(remaining_data, seg_size);
struct rte_mempool *pool;
struct rte_mbuf *next_seg;
uint32_t data_size;
--
2.56.0.rc1.315.gc6ed9934b7-goog
More information about the dev
mailing list