From 9dc83b6a43489e0b66dd494a9a48a46cb34ea782 Mon Sep 17 00:00:00 2001 From: Lukas Sismis Date: Wed, 23 Aug 2023 07:57:50 +0200 Subject: [PATCH] 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 --- src/runmode-dpdk.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) 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); -- 2.47.2