From: Lukas Sismis Date: Sun, 11 Feb 2024 19:43:37 +0000 (+0100) Subject: dpdk: max cache size should be lower than one of the constraints X-Git-Tag: suricata-7.0.4~20 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9aae9aaa16e39eaf30eb37c1c51d04f096865983;p=thirdparty%2Fsuricata.git dpdk: max cache size should be lower than one of the constraints Ticket: 6741 (cherry picked from commit c65ff35819845a3f42c75f79d54f9ab91c5c2ec9) --- 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); }