diff --git a/src/detect-engine.c b/src/detect-engine.c index ba3a54b93f..7c6e9c1363 100644 --- a/src/detect-engine.c +++ b/src/detect-engine.c @@ -2324,7 +2324,7 @@ static int DetectEngineReloadThreads(DetectEngineCtx *new_de_ctx) uint32_t i = 0; /* count detect threads in use */ - uint32_t no_of_detect_tvs = TmThreadCountThreadsByTmmFlags(TM_FLAG_DETECT_TM); + uint32_t no_of_detect_tvs = TmThreadCountThreadsByTmmFlags(TM_FLAG_FLOWWORKER_TM); /* can be zero in unix socket mode */ if (no_of_detect_tvs == 0) { return 0; @@ -2343,12 +2343,12 @@ static int DetectEngineReloadThreads(DetectEngineCtx *new_de_ctx) /* get reference to tv's and setup new_det_ctx array */ SCMutexLock(&tv_root_lock); for (ThreadVars *tv = tv_root[TVT_PPT]; tv != NULL; tv = tv->next) { - if ((tv->tmm_flags & TM_FLAG_DETECT_TM) == 0) { + if ((tv->tmm_flags & TM_FLAG_FLOWWORKER_TM) == 0) { continue; } for (TmSlot *s = tv->tm_slots; s != NULL; s = s->slot_next) { TmModule *tm = TmModuleGetById(s->tm_id); - if (!(tm->flags & TM_FLAG_DETECT_TM)) { + if (!(tm->flags & TM_FLAG_FLOWWORKER_TM)) { continue; } @@ -2378,12 +2378,12 @@ static int DetectEngineReloadThreads(DetectEngineCtx *new_de_ctx) /* atomically replace the det_ctx data */ i = 0; for (ThreadVars *tv = tv_root[TVT_PPT]; tv != NULL; tv = tv->next) { - if ((tv->tmm_flags & TM_FLAG_DETECT_TM) == 0) { + if ((tv->tmm_flags & TM_FLAG_FLOWWORKER_TM) == 0) { continue; } for (TmSlot *s = tv->tm_slots; s != NULL; s = s->slot_next) { TmModule *tm = TmModuleGetById(s->tm_id); - if (!(tm->flags & TM_FLAG_DETECT_TM)) { + if (!(tm->flags & TM_FLAG_FLOWWORKER_TM)) { continue; } SCLogDebug("swapping new det_ctx - %p with older one - %p", @@ -2432,7 +2432,7 @@ retry: * THV_DEINIT flag */ if (i != no_of_detect_tvs) { // not all threads we swapped for (ThreadVars *tv = tv_root[TVT_PPT]; tv != NULL; tv = tv->next) { - if ((tv->tmm_flags & TM_FLAG_DETECT_TM) == 0) { + if ((tv->tmm_flags & TM_FLAG_FLOWWORKER_TM) == 0) { continue; } diff --git a/src/flow-worker.c b/src/flow-worker.c index 92ea75f432..0bd4ae2785 100644 --- a/src/flow-worker.c +++ b/src/flow-worker.c @@ -819,5 +819,5 @@ void TmModuleFlowWorkerRegister (void) tmm_modules[TMM_FLOWWORKER].ThreadBusy = FlowWorkerIsBusy; tmm_modules[TMM_FLOWWORKER].ThreadDeinit = FlowWorkerThreadDeinit; tmm_modules[TMM_FLOWWORKER].cap_flags = 0; - tmm_modules[TMM_FLOWWORKER].flags = TM_FLAG_STREAM_TM|TM_FLAG_DETECT_TM; + tmm_modules[TMM_FLOWWORKER].flags = TM_FLAG_FLOWWORKER_TM; } diff --git a/src/log-flush.c b/src/log-flush.c index 155154f38d..f9ab98b068 100644 --- a/src/log-flush.c +++ b/src/log-flush.c @@ -43,7 +43,7 @@ static void WorkerFlushLogs(void) SCEnter(); /* count detect threads in use */ - uint32_t no_of_detect_tvs = TmThreadCountThreadsByTmmFlags(TM_FLAG_DETECT_TM); + uint32_t no_of_detect_tvs = TmThreadCountThreadsByTmmFlags(TM_FLAG_FLOWWORKER_TM); /* can be zero in unix socket mode */ if (no_of_detect_tvs == 0) { return; @@ -61,12 +61,12 @@ static void WorkerFlushLogs(void) SCMutexLock(&tv_root_lock); /* get reference to tv's and setup fw_threads array */ for (ThreadVars *tv = tv_root[TVT_PPT]; tv != NULL; tv = tv->next) { - if ((tv->tmm_flags & TM_FLAG_DETECT_TM) == 0) { + if ((tv->tmm_flags & TM_FLAG_FLOWWORKER_TM) == 0) { continue; } for (TmSlot *s = tv->tm_slots; s != NULL; s = s->slot_next) { TmModule *tm = TmModuleGetById(s->tm_id); - if (!(tm->flags & TM_FLAG_DETECT_TM)) { + if (!(tm->flags & TM_FLAG_FLOWWORKER_TM)) { continue; } diff --git a/src/suricata.c b/src/suricata.c index a862a0aaed..2158aaeea2 100644 --- a/src/suricata.c +++ b/src/suricata.c @@ -2292,7 +2292,7 @@ void PostRunDeinit(const int runmode, struct timeval *start_time) TmThreadDisableReceiveThreads(); /* tell relevant packet threads to enter flow timeout loop */ TmThreadDisablePacketThreads( - THV_REQ_FLOW_LOOP, THV_FLOW_LOOP, (TM_FLAG_RECEIVE_TM | TM_FLAG_DETECT_TM)); + THV_REQ_FLOW_LOOP, THV_FLOW_LOOP, (TM_FLAG_RECEIVE_TM | TM_FLAG_FLOWWORKER_TM)); /* run cleanup on the flow hash */ FlowWorkToDoCleanup(); /* gracefully shut down all packet threads */ diff --git a/src/tm-modules.h b/src/tm-modules.h index ef7b63f889..a557280d89 100644 --- a/src/tm-modules.h +++ b/src/tm-modules.h @@ -31,16 +31,14 @@ /* thread flags */ #define TM_FLAG_RECEIVE_TM 0x01 #define TM_FLAG_DECODE_TM 0x02 -#define TM_FLAG_STREAM_TM 0x04 -#define TM_FLAG_DETECT_TM 0x08 +#define TM_FLAG_FLOWWORKER_TM 0x04 +#define TM_FLAG_VERDICT_TM 0x08 #define TM_FLAG_MANAGEMENT_TM 0x10 #define TM_FLAG_COMMAND_TM 0x20 -#define TM_FLAG_VERDICT_TM 0x40 /* all packet modules combined */ #define TM_FLAG_PACKET_ALL \ - (TM_FLAG_RECEIVE_TM | TM_FLAG_DECODE_TM | TM_FLAG_STREAM_TM | TM_FLAG_DETECT_TM | \ - TM_FLAG_VERDICT_TM) + (TM_FLAG_RECEIVE_TM | TM_FLAG_DECODE_TM | TM_FLAG_FLOWWORKER_TM | TM_FLAG_VERDICT_TM) typedef TmEcode (*ThreadInitFunc)(ThreadVars *, const void *, void **); typedef TmEcode (*ThreadDeinitFunc)(ThreadVars *, void *); diff --git a/src/tmqh-packetpool.c b/src/tmqh-packetpool.c index e301025730..9a812c644a 100644 --- a/src/tmqh-packetpool.c +++ b/src/tmqh-packetpool.c @@ -465,7 +465,7 @@ void PacketPoolPostRunmodes(void) "must be at least %d", RESERVED_PACKETS); } - uint32_t threads = TmThreadCountThreadsByTmmFlags(TM_FLAG_DETECT_TM); + uint32_t threads = TmThreadCountThreadsByTmmFlags(TM_FLAG_FLOWWORKER_TM); if (threads == 0) return;