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-8.0.0-beta1~1761 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c65ff35819845a3f42c75f79d54f9ab91c5c2ec9;p=thirdparty%2Fsuricata.git dpdk: max cache size should be lower than one of the constraints Ticket: 6741 --- diff --git a/src/runmode-dpdk.c b/src/runmode-dpdk.c index 67e1e0050e..5bb071f7f1 100644 --- a/src/runmode-dpdk.c +++ b/src/runmode-dpdk.c @@ -498,7 +498,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); }