]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
napatech: print NUMA recommendation early
authorRalph Eastwood <rea@napatech.com>
Wed, 16 Aug 2023 11:30:01 +0000 (13:30 +0200)
committerVictor Julien <victor@inliniac.net>
Tue, 5 Sep 2023 12:21:34 +0000 (14:21 +0200)
When thread affinity is set, the NUMA configuration specified in
the napatech.ini configuration could be incorrect and then fail.
This fails before the recommended configuration is printed, which
is pretty unhelpful.

src/source-napatech.c

index d1d57f856a10b38ec7f70c7c9ed077263dcb4c16..44201a2bb361d004dcf650721d1e1b15183f6015 100644 (file)
@@ -845,6 +845,9 @@ TmEcode NapatechPacketLoop(ThreadVars *tv, void *data, void *slot)
 
         SC_ATOMIC_ADD(stream_count, 1);
         if (SC_ATOMIC_GET(stream_count) == NapatechGetNumConfiguredStreams()) {
+            /* Print the recommended NUMA configuration early because it
+             * can fail with "No available hostbuffers" in NapatechSetupTraffic */
+            RecommendNUMAConfig();
 
 #ifdef NAPATECH_ENABLE_BYPASS
             if (ConfGetBool("napatech.inline", &is_inline) == 0) {
@@ -869,7 +872,6 @@ TmEcode NapatechPacketLoop(ThreadVars *tv, void *data, void *slot)
             } else if (status == 0x20000008) {
                 FatalError("Check napatech.ports in the suricata config file.");
             }
-            RecommendNUMAConfig();
             SCLogNotice("Napatech packet input engine started.");
         }
     } // is_autoconfig