util-affinity: move properties of *-cpu-set node one layer up in YAML

pull/13397/head
Lukas Sismis 11 months ago committed by Victor Julien
parent fbfced12f2
commit 390baad7dc

@ -173,8 +173,7 @@ static const char *GetAffinitySetName(const char *val)
static void SetupCpuSets(ThreadsAffinityType *taf, SCConfNode *affinity, const char *setname)
{
CPU_ZERO(&taf->cpu_set);
SCConfNode *cpu_node = SCConfNodeLookupChild(affinity->head.tqh_first, "cpu");
SCConfNode *cpu_node = SCConfNodeLookupChild(affinity, "cpu");
if (cpu_node != NULL) {
BuildCpuset(setname, cpu_node, &taf->cpu_set);
} else {
@ -233,8 +232,7 @@ static int SetupAffinityPriority(
CPU_ZERO(&taf->lowprio_cpu);
CPU_ZERO(&taf->medprio_cpu);
CPU_ZERO(&taf->hiprio_cpu);
SCConfNode *prio_node = SCConfNodeLookupChild(affinity->head.tqh_first, "prio");
SCConfNode *prio_node = SCConfNodeLookupChild(affinity, "prio");
if (prio_node == NULL) {
return 0;
}
@ -251,7 +249,7 @@ static int SetupAffinityPriority(
*/
static int SetupAffinityMode(ThreadsAffinityType *taf, SCConfNode *affinity)
{
SCConfNode *mode_node = SCConfNodeLookupChild(affinity->head.tqh_first, "mode");
SCConfNode *mode_node = SCConfNodeLookupChild(affinity, "mode");
if (mode_node == NULL) {
return 0;
}
@ -273,7 +271,7 @@ static int SetupAffinityMode(ThreadsAffinityType *taf, SCConfNode *affinity)
*/
static int SetupAffinityThreads(ThreadsAffinityType *taf, SCConfNode *affinity)
{
SCConfNode *threads_node = SCConfNodeLookupChild(affinity->head.tqh_first, "threads");
SCConfNode *threads_node = SCConfNodeLookupChild(affinity, "threads");
if (threads_node == NULL) {
return 0;
}

@ -1880,24 +1880,24 @@ threading:
#
cpu-affinity:
- management-cpu-set:
cpu: [ 0 ] # include only these CPUs in affinity settings
cpu: [ 0 ] # include only these CPUs in affinity settings
- receive-cpu-set:
cpu: [ 0 ] # include only these CPUs in affinity settings
cpu: [ 0 ] # include only these CPUs in affinity settings
- worker-cpu-set:
cpu: [ "all" ]
mode: "exclusive"
# Use explicitly 3 threads and don't compute number by using
# detect-thread-ratio variable:
# threads: 3
prio:
low: [ 0 ]
medium: [ "1-2" ]
high: [ 3 ]
default: "medium"
cpu: [ "all" ]
mode: "exclusive"
# Use explicitly 3 threads and don't compute number by using
# detect-thread-ratio variable:
# threads: 3
prio:
low: [ 0 ]
medium: [ "1-2" ]
high: [ 3 ]
default: "medium"
#- verdict-cpu-set:
# cpu: [ 0 ]
# prio:
# default: "high"
# cpu: [ 0 ]
# prio:
# default: "high"
#
# By default Suricata creates one "detect" thread per available CPU/CPU core.
# This setting allows controlling this behaviour. A ratio setting of 2 will

Loading…
Cancel
Save