From 9aae9aaa16e39eaf30eb37c1c51d04f096865983 Mon Sep 17 00:00:00 2001 From: Lukas Sismis Date: Sun, 11 Feb 2024 20:43:37 +0100 Subject: [PATCH] dpdk: max cache size should be lower than one of the constraints Ticket: 6741 (cherry picked from commit c65ff35819845a3f42c75f79d54f9ab91c5c2ec9) --- src/runmode-dpdk.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/runmode-dpdk.c b/src/runmode-dpdk.c index e4a93699af..342e9b50bd 100644 --- a/src/runmode-dpdk.c +++ b/src/runmode-dpdk.c @@ -487,7 +487,7 @@ static int ConfigSetMempoolCacheSize(DPDKIfaceConfig *iconf, const char *entry_s SCReturnInt(-EINVAL); } - uint32_t max_cache_size = MAX(RTE_MEMPOOL_CACHE_MAX_SIZE, iconf->mempool_size / 1.5); + uint32_t max_cache_size = MIN(RTE_MEMPOOL_CACHE_MAX_SIZE, iconf->mempool_size / 1.5); iconf->mempool_cache_size = GreatestDivisorUpTo(iconf->mempool_size, max_cache_size); SCReturnInt(0); } -- 2.47.2