From: Lukas Sismis Date: Wed, 23 Aug 2023 05:57:50 +0000 (+0200) Subject: dpdk: add hugepage hint on low number of hugepages X-Git-Tag: suricata-7.0.2~7 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9dc83b6a43489e0b66dd494a9a48a46cb34ea782;p=thirdparty%2Fsuricata.git dpdk: add hugepage hint on low number of hugepages If a user doesn't allocate/allocates too little hugepages, Suricata fails to start and outputs a hint to increase number of hugepages (if enabled). Ticket: #5966 --- diff --git a/src/runmode-dpdk.c b/src/runmode-dpdk.c index feba401b41..2cdf5cb325 100644 --- a/src/runmode-dpdk.c +++ b/src/runmode-dpdk.c @@ -1522,11 +1522,17 @@ static void *ParseDpdkConfigAndConfigureDevice(const char *iface) if (retval < 0) { // handles both configure attempts iconf->DerefFunc(iconf); - retval = rte_eal_cleanup(); - if (retval != 0) + if (rte_eal_cleanup() != 0) FatalError("EAL cleanup failed: %s", strerror(-retval)); - FatalError("%s: failed to configure", iface); + if (retval == -ENOMEM) { + FatalError("%s: memory allocation failed - consider" + "%s freeing up some memory.", + iface, + rte_eal_has_hugepages() != 0 ? " increasing the number of hugepages or" : ""); + } else { + FatalError("%s: failed to configure", iface); + } } SC_ATOMIC_RESET(iconf->ref);