Go to the documentation of this file.
44 "Multi threaded ERF file mode. Packets from "
45 "each flow are assigned to a single detect thread",
56 FatalError(
"Failed to get erf-file.file from config.");
64 "packetpool",
"packetpool",
65 "packetpool",
"packetpool",
68 printf(
"ERROR: TmThreadsCreate failed\n");
73 if (tm_module == NULL) {
74 printf(
"ERROR: TmModuleGetByName failed for ReceiveErfFile\n");
80 if (tm_module == NULL) {
81 printf(
"ERROR: TmModuleGetByName DecodeErfFile failed\n");
87 if (tm_module == NULL) {
88 FatalError(
"TmModuleGetByName for FlowWorker failed");
93 printf(
"ERROR: TmThreadSpawn failed\n");
97 SCLogInfo(
"RunModeErfFileSingle initialised");
111 const char *file = NULL;
113 FatalError(
"Failed retrieving erf-file.file from config");
132 if (thread_max > 1024)
136 if (queues == NULL) {
137 FatalError(
"RunmodeAutoFpCreatePickupQueuesString failed");
143 "packetpool",
"packetpool",
149 printf(
"ERROR: TmThreadsCreate failed\n");
153 if (tm_module == NULL) {
154 printf(
"ERROR: TmModuleGetByName failed for ReceiveErfFile\n");
160 if (tm_module == NULL) {
161 printf(
"ERROR: TmModuleGetByName DecodeErfFile failed\n");
173 printf(
"ERROR: TmThreadSpawn failed\n");
177 for (thread = 0; thread < (uint16_t)thread_max; thread++) {
179 snprintf(qname,
sizeof(qname),
"pickup%d", thread + 1);
181 SCLogDebug(
"tname %s, qname %s", tname, qname);
183 SCLogDebug(
"Assigning %s affinity to cpu %u", tname, cpu);
188 "packetpool",
"packetpool",
190 if (tv_detect_ncpu == NULL) {
191 printf(
"ERROR: TmThreadsCreate failed\n");
196 if (tm_module == NULL) {
197 FatalError(
"TmModuleGetByName for FlowWorker failed");
207 if (cpu == 0 && ncpus > 1) {
209 }
else if (ncpus > 1) {
215 printf(
"ERROR: TmThreadSpawn failed\n");
219 if ((cpu + 1) == ncpus)
225 SCLogInfo(
"RunModeErfFileAutoFp initialised");
const char * thread_name_workers
TmEcode TmThreadSetCPUAffinity(ThreadVars *tv, uint16_t cpu)
Set the thread options (cpu affinity).
TmEcode TmThreadSpawn(ThreadVars *tv)
Spawns a thread associated with the ThreadVars instance tv.
bool threading_set_cpu_affinity
void RunModeErfFileRegister(void)
const char * RunModeErfFileGetDefaultMode(void)
ThreadVars * TmThreadCreatePacketHandler(const char *name, const char *inq_name, const char *inqh_name, const char *outq_name, const char *outqh_name, const char *slots)
Creates and returns a TV instance for a Packet Processing Thread. This function doesn't support custo...
const char * thread_name_autofp
TmEcode TmThreadSetThreadPriority(ThreadVars *tv, int prio)
Set the thread options (thread priority).
const char * thread_name_single
#define TM_THREAD_NAME_MAX
TmModule * TmModuleGetByName(const char *name)
get a tm module ptr by name
char * RunmodeAutoFpCreatePickupQueuesString(int n)
create a queue string for autofp to pass to the flow queue handler.
int SCConfGetNonNull(const char *name, const char **vptr)
Retrieve the non-null value of a configuration node.
Per thread variable structure.
#define TM_QUEUE_NAME_MAX
void RunModeRegisterNewRunMode(enum SCRunModes runmode, const char *name, const char *description, int(*RunModeFunc)(void), int(*RunModeIsIPSEnabled)(void))
Registers a new runmode.
#define SCLogInfo(...)
Macro used to log INFORMATIONAL messages.
void TmSlotSetFuncAppend(ThreadVars *tv, TmModule *tm, const void *data)
Appends a new entry to the slots.
void TimeModeSetOffline(void)
int TmThreadGetNbThreads(uint8_t type)
int RunModeErfFileSingle(void)
int RunModeErfFileAutoFp(void)
uint16_t UtilCpuGetNumProcessorsOnline(void)
Get the number of cpus online in the system.
float threading_detect_ratio