]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
dpdk: improve handling of SOCKET_ID_ANY in DPDK 22.11+
authorLukas Sismis <lsismis@oisf.net>
Thu, 22 Jun 2023 13:43:39 +0000 (15:43 +0200)
committerVictor Julien <vjulien@oisf.net>
Mon, 10 Jul 2023 07:27:02 +0000 (09:27 +0200)
Suricata complained that NIC is on different NUMA node than the CPU
thread. However, sometimes DPDK might be unable to resolve NUMA
location and as a result operate with any NUMA node that is available.
Current implementation reported NUMA ID as -1 which could have been
confusing to users.

Ticket: #6115

src/source-dpdk.c

index 12828572152fa411c02b6e3c86563b0b739cf1aa..363b718897c326171992fd58c47b0dd53d49240e 100644 (file)
@@ -516,7 +516,8 @@ static TmEcode ReceiveDPDKThreadInit(ThreadVars *tv, const void *initdata, void
     dpdk_config->pkt_mempool = NULL;
 
     thread_numa = GetNumaNode();
-    if (thread_numa >= 0 && thread_numa != ptv->port_socket_id) {
+    if (thread_numa >= 0 && ptv->port_socket_id != SOCKET_ID_ANY &&
+            thread_numa != ptv->port_socket_id) {
         SC_ATOMIC_ADD(dpdk_config->inconsitent_numa_cnt, 1);
         SCLogPerf("%s: NIC is on NUMA %d, thread on NUMA %d", dpdk_config->iface,
                 ptv->port_socket_id, thread_numa);
@@ -550,6 +551,11 @@ static TmEcode ReceiveDPDKThreadInit(ThreadVars *tv, const void *initdata, void
             SCLogWarning("%s: NIC is on NUMA %d, %u threads on different NUMA node(s)",
                     dpdk_config->iface, rte_eth_dev_socket_id(ptv->port_id), inconsistent_numa_cnt);
         }
+        if (ptv->port_socket_id == SOCKET_ID_ANY) {
+            SCLogNotice(
+                    "%s: unable to determine NIC's NUMA node, degraded performance can be expected",
+                    dpdk_config->iface);
+        }
     }
 
     *data = (void *)ptv;