]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
dpdk: remove mempool pointer from the thread structure
authorLukas Sismis <lsismis@oisf.net>
Mon, 27 Jan 2025 13:45:58 +0000 (14:45 +0100)
committerVictor Julien <victor@inliniac.net>
Mon, 31 Mar 2025 17:16:50 +0000 (19:16 +0200)
src/runmode-dpdk.c
src/source-dpdk.c

index 5bc2b23fb6379388761c324f54d8a4fc09ffb62a..27252964fbf2c37f3afd7c674e81bf3e34870395 100644 (file)
@@ -1740,6 +1740,7 @@ static void *ParseDpdkConfigAndConfigureDevice(const char *iface)
         FatalError("Device %s is not registered as a live device", iface);
     }
     ldev_instance->dpdk_vars.pkt_mp = iconf->pkt_mempool;
+    iconf->pkt_mempool = NULL;
     return iconf;
 }
 
index d77a53603095ef6f6bdde7ecb8b6b1d6af4162f3..8307b215ec019bd8a5c78c934b8c8e8718f4bf1c 100644 (file)
@@ -134,7 +134,6 @@ typedef struct DPDKThreadVars_ {
     uint16_t port_id;
     uint16_t queue_id;
     int32_t port_socket_id;
-    struct rte_mempool *pkt_mempool;
     struct rte_mbuf *received_mbufs[BURST_SIZE];
     DPDKWorkerSync *workers_sync;
 } DPDKThreadVars;
@@ -609,9 +608,6 @@ static TmEcode ReceiveDPDKThreadInit(ThreadVars *tv, const void *initdata, void
     ptv->port_id = dpdk_config->port_id;
     ptv->out_port_id = dpdk_config->out_port_id;
     ptv->port_socket_id = dpdk_config->socket_id;
-    // pass the pointer to the mempool and then forget about it. Mempool is freed in thread deinit.
-    ptv->pkt_mempool = dpdk_config->pkt_mempool;
-    dpdk_config->pkt_mempool = NULL;
 
     thread_numa = GetNumaNode();
     if (thread_numa >= 0 && ptv->port_socket_id != SOCKET_ID_ANY &&
@@ -771,8 +767,6 @@ static TmEcode ReceiveDPDKThreadDeinit(ThreadVars *tv, void *data)
         }
     }
 
-    ptv->pkt_mempool = NULL; // MP is released when device is closed
-
     SCFree(ptv);
     SCReturnInt(TM_ECODE_OK);
 }