Skip to content

Commit

Permalink
dpdk: max cache size should be lower than one of the constraints
Browse files Browse the repository at this point in the history
Ticket: 6741
  • Loading branch information
Lukas Sismis authored and victorjulien committed Feb 14, 2024
1 parent cc2eb2d commit c65ff35
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/runmode-dpdk.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit c65ff35

Please sign in to comment.