]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
dpdk: max cache size should be lower than one of the constraints
authorLukas Sismis <lsismis@oisf.net>
Sun, 11 Feb 2024 19:43:37 +0000 (20:43 +0100)
committerVictor Julien <victor@inliniac.net>
Wed, 14 Feb 2024 06:04:25 +0000 (07:04 +0100)
Ticket: 6741

src/runmode-dpdk.c

index 67e1e0050ea1f8c5758b7ee5fd044bacdc4a6aeb..5bb071f7f1d7fb577ddfeb8fc42679f8c056f30f 100644 (file)
@@ -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);
     }