From 5e2974458d209a2276ff2efdb324a70fcbee444f Mon Sep 17 00:00:00 2001 From: Lukas Sismis Date: Mon, 27 Jan 2025 14:45:58 +0100 Subject: [PATCH] dpdk: remove mempool pointer from the thread structure --- src/runmode-dpdk.c | 1 + src/source-dpdk.c | 6 ------ 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/src/runmode-dpdk.c b/src/runmode-dpdk.c index 5bc2b23fb6..27252964fb 100644 --- a/src/runmode-dpdk.c +++ b/src/runmode-dpdk.c @@ -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; } diff --git a/src/source-dpdk.c b/src/source-dpdk.c index d77a536030..8307b215ec 100644 --- a/src/source-dpdk.c +++ b/src/source-dpdk.c @@ -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); } -- 2.47.2