Remove unused TM_FLAG_STREAM_TM.
Rename TM_FLAG_DETECT_TM to TM_FLAG_FLOWWORKER_TM as it was mostly used
to check if a thread is a flow worker. TM_FLAG_DETECT_TM was always set
for a flow worker, even when there was no detection in use.
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;
/* 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;
}
/* 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",
* 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;
}
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;
}
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;
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;
}
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 */
/* 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 *);
"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;