|
suricata
|


Go to the source code of this file.
Data Structures | |
| struct | ThreadsAffinityType_ |
Macros | |
| #define | MAX_NUMA_NODES 16 |
Typedefs | |
| typedef struct ThreadsAffinityType_ | ThreadsAffinityType |
Enumerations | |
| enum | { RECEIVE_CPU_SET, WORKER_CPU_SET, VERDICT_CPU_SET, MANAGEMENT_CPU_SET, MAX_CPU_SET } |
| enum | { BALANCED_AFFINITY, EXCLUSIVE_AFFINITY, MAX_AFFINITY } |
Functions | |
| char * | AffinityGetYamlPath (ThreadsAffinityType *taf) |
| Get the YAML path for the given affinity type. The path is built using the parent name (if available) and the affinity name. Do not free the returned string. More... | |
| void | AffinitySetupLoadFromConfig (void) |
| Extract CPU affinity configuration from current config file. More... | |
| ThreadsAffinityType * | GetOrAllocAffinityTypeForIfaceOfName (const char *name, const char *interface_name) |
| Finds affinity by its name and interface name. Interfaces are children of cpu-set names. If the queried interface is not found, then it is allocated, initialized and assigned to the queried cpu-set. More... | |
| ThreadsAffinityType * | GetAffinityTypeForNameAndIface (const char *name, const char *interface_name) |
| Find affinity by name (*-cpu-set name) and an interface name. More... | |
| ThreadsAffinityType * | FindAffinityByInterface (ThreadsAffinityType *parent, const char *interface_name) |
| void | TopologyDestroy (void) |
| uint16_t | AffinityGetNextCPU (ThreadVars *tv, ThreadsAffinityType *taf) |
| uint16_t | UtilAffinityGetAffinedCPUNum (ThreadsAffinityType *taf) |
| Return the total number of CPUs in a given affinity. More... | |
| int | BuildCpusetWithCallback (const char *name, SCConfNode *node, void(*Callback)(int i, void *data), void *data) |
| void | ThreadingAffinityRegisterTests (void) |
| Register all threading affinity unit tests. More... | |
Variables | |
| ThreadsAffinityType | thread_affinity [MAX_CPU_SET] |
Definition in file util-affinity.h.
| #define MAX_NUMA_NODES 16 |
Definition at line 71 of file util-affinity.h.
| typedef struct ThreadsAffinityType_ ThreadsAffinityType |
| anonymous enum |
| Enumerator | |
|---|---|
| RECEIVE_CPU_SET | |
| WORKER_CPU_SET | |
| VERDICT_CPU_SET | |
| MANAGEMENT_CPU_SET | |
| MAX_CPU_SET | |
Definition at line 56 of file util-affinity.h.
| anonymous enum |
| Enumerator | |
|---|---|
| BALANCED_AFFINITY | |
| EXCLUSIVE_AFFINITY | |
| MAX_AFFINITY | |
Definition at line 64 of file util-affinity.h.
| uint16_t AffinityGetNextCPU | ( | ThreadVars * | tv, |
| ThreadsAffinityType * | taf | ||
| ) |
Definition at line 1006 of file util-affinity.c.
| char* AffinityGetYamlPath | ( | ThreadsAffinityType * | taf | ) |
Get the YAML path for the given affinity type. The path is built using the parent name (if available) and the affinity name. Do not free the returned string.
| taf | the affinity type - if NULL, the path is built for the root node |
Definition at line 429 of file util-affinity.c.
References ThreadsAffinityType_::name, ThreadsAffinityType_::parent, and SCLogError.
| void AffinitySetupLoadFromConfig | ( | void | ) |
Extract CPU affinity configuration from current config file.
Definition at line 588 of file util-affinity.c.
References thread_affinity_init_done.
Referenced by RunModeInitializeThreadSettings().

| int BuildCpusetWithCallback | ( | const char * | name, |
| SCConfNode * | node, | ||
| void(*)(int i, void *data) | Callback, | ||
| void * | data | ||
| ) |
Definition at line 227 of file util-affinity.c.
References name, next, SCLogError, StringParseUint32(), TAILQ_FOREACH, UtilCpuGetNumProcessorsOnline(), and SCConfNode_::val.

| ThreadsAffinityType* FindAffinityByInterface | ( | ThreadsAffinityType * | parent, |
| const char * | interface_name | ||
| ) |
Definition at line 113 of file util-affinity.c.
References ThreadsAffinityType_::children, ThreadsAffinityType_::name, and ThreadsAffinityType_::nb_children.
Referenced by GetAffinityTypeForNameAndIface(), and GetOrAllocAffinityTypeForIfaceOfName().

| ThreadsAffinityType* GetAffinityTypeForNameAndIface | ( | const char * | name, |
| const char * | interface_name | ||
| ) |
Find affinity by name (*-cpu-set name) and an interface name.
| name | the name of the affinity (e.g. worker-cpu-set, receive-cpu-set). The name is required and cannot be NULL. |
| interface_name | the name of the interface. If NULL, the affinity is looked up by name only. |
| a | pointer to the affinity or NULL if not found |
Definition at line 138 of file util-affinity.c.
References FindAffinityByInterface(), MAX_CPU_SET, name, SCLogError, and thread_affinity.
Referenced by LiveGetDeviceCountWithoutAssignedThreading().


| ThreadsAffinityType* GetOrAllocAffinityTypeForIfaceOfName | ( | const char * | name, |
| const char * | interface_name | ||
| ) |
Finds affinity by its name and interface name. Interfaces are children of cpu-set names. If the queried interface is not found, then it is allocated, initialized and assigned to the queried cpu-set.
| name | the name of the affinity (e.g. worker-cpu-set, receive-cpu-set). The name is required and cannot be NULL. |
| interface_name | the name of the interface. If NULL, the affinity is looked up by name only. |
| a | pointer to the affinity or NULL if not found |
Definition at line 177 of file util-affinity.c.
References FindAffinityByInterface(), MAX_CPU_SET, name, SCLogError, and thread_affinity.

| void ThreadingAffinityRegisterTests | ( | void | ) |
Register all threading affinity unit tests.
Definition at line 2020 of file util-affinity.c.
References UtRegisterTest().

| void TopologyDestroy | ( | void | ) |
| uint16_t UtilAffinityGetAffinedCPUNum | ( | ThreadsAffinityType * | taf | ) |
Return the total number of CPUs in a given affinity.
| the | number of affined CPUs |
Definition at line 1043 of file util-affinity.c.
References ThreadsAffinityType_::cpu_set, SCMutexLock, SCMutexUnlock, ThreadsAffinityType_::taf_mutex, and UtilCpuGetNumProcessorsOnline().

| ThreadsAffinityType thread_affinity[MAX_CPU_SET] |
store thread affinity mode for all type of threads
Definition at line 38 of file util-affinity.c.
Referenced by GetAffinityTypeForNameAndIface(), GetOrAllocAffinityTypeForIfaceOfName(), and TmThreadGetNbThreads().