dpdk: remove mempool pointer from the thread structure

pull/12888/head
Lukas Sismis 10 months ago committed by Victor Julien
parent 2ef2a9e26f
commit 5e2974458d

@ -1740,6 +1740,7 @@ static void *ParseDpdkConfigAndConfigureDevice(const char *iface)
FatalError("Device %s is not registered as a live device", iface); FatalError("Device %s is not registered as a live device", iface);
} }
ldev_instance->dpdk_vars.pkt_mp = iconf->pkt_mempool; ldev_instance->dpdk_vars.pkt_mp = iconf->pkt_mempool;
iconf->pkt_mempool = NULL;
return iconf; return iconf;
} }

@ -134,7 +134,6 @@ typedef struct DPDKThreadVars_ {
uint16_t port_id; uint16_t port_id;
uint16_t queue_id; uint16_t queue_id;
int32_t port_socket_id; int32_t port_socket_id;
struct rte_mempool *pkt_mempool;
struct rte_mbuf *received_mbufs[BURST_SIZE]; struct rte_mbuf *received_mbufs[BURST_SIZE];
DPDKWorkerSync *workers_sync; DPDKWorkerSync *workers_sync;
} DPDKThreadVars; } DPDKThreadVars;
@ -609,9 +608,6 @@ static TmEcode ReceiveDPDKThreadInit(ThreadVars *tv, const void *initdata, void
ptv->port_id = dpdk_config->port_id; ptv->port_id = dpdk_config->port_id;
ptv->out_port_id = dpdk_config->out_port_id; ptv->out_port_id = dpdk_config->out_port_id;
ptv->port_socket_id = dpdk_config->socket_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(); thread_numa = GetNumaNode();
if (thread_numa >= 0 && ptv->port_socket_id != SOCKET_ID_ANY && 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); SCFree(ptv);
SCReturnInt(TM_ECODE_OK); SCReturnInt(TM_ECODE_OK);
} }

Loading…
Cancel
Save