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

pull/13397/head
Lukas Sismis 12 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) static void SetupCpuSets(ThreadsAffinityType *taf, SCConfNode *affinity, const char *setname)
{ {
CPU_ZERO(&taf->cpu_set); CPU_ZERO(&taf->cpu_set);
SCConfNode *cpu_node = SCConfNodeLookupChild(affinity, "cpu");
SCConfNode *cpu_node = SCConfNodeLookupChild(affinity->head.tqh_first, "cpu");
if (cpu_node != NULL) { if (cpu_node != NULL) {
BuildCpuset(setname, cpu_node, &taf->cpu_set); BuildCpuset(setname, cpu_node, &taf->cpu_set);
} else { } else {
@ -233,8 +232,7 @@ static int SetupAffinityPriority(
CPU_ZERO(&taf->lowprio_cpu); CPU_ZERO(&taf->lowprio_cpu);
CPU_ZERO(&taf->medprio_cpu); CPU_ZERO(&taf->medprio_cpu);
CPU_ZERO(&taf->hiprio_cpu); CPU_ZERO(&taf->hiprio_cpu);
SCConfNode *prio_node = SCConfNodeLookupChild(affinity, "prio");
SCConfNode *prio_node = SCConfNodeLookupChild(affinity->head.tqh_first, "prio");
if (prio_node == NULL) { if (prio_node == NULL) {
return 0; return 0;
} }
@ -251,7 +249,7 @@ static int SetupAffinityPriority(
*/ */
static int SetupAffinityMode(ThreadsAffinityType *taf, SCConfNode *affinity) 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) { if (mode_node == NULL) {
return 0; return 0;
} }
@ -273,7 +271,7 @@ static int SetupAffinityMode(ThreadsAffinityType *taf, SCConfNode *affinity)
*/ */
static int SetupAffinityThreads(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) { if (threads_node == NULL) {
return 0; return 0;
} }

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

Loading…
Cancel
Save