From 5f9de1e7346d45567edfcb3b2e597a89f7c75fad Mon Sep 17 00:00:00 2001 From: Victor Julien Date: Fri, 3 Jun 2016 10:37:59 +0200 Subject: [PATCH] affinity: rename detect -> worker set internall --- src/runmode-erf-file.c | 2 +- src/runmode-pcap-file.c | 6 +++--- src/util-affinity.h | 2 +- src/util-runmodes.c | 12 ++++++------ 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/runmode-erf-file.c b/src/runmode-erf-file.c index 5e0b097ab6..e4f3c3df93 100644 --- a/src/runmode-erf-file.c +++ b/src/runmode-erf-file.c @@ -142,7 +142,7 @@ int RunModeErfFileAutoFp(void) cpu = 1; /* always create at least one thread */ - int thread_max = TmThreadGetNbThreads(DETECT_CPU_SET); + int thread_max = TmThreadGetNbThreads(WORKER_CPU_SET); if (thread_max == 0) thread_max = ncpus * threading_detect_ratio; if (thread_max < 1) diff --git a/src/runmode-pcap-file.c b/src/runmode-pcap-file.c index c6fea2b2de..9db65d485e 100644 --- a/src/runmode-pcap-file.c +++ b/src/runmode-pcap-file.c @@ -109,7 +109,7 @@ int RunModeFilePcapSingle(void) SetupOutputs(tv); - TmThreadSetCPU(tv, DETECT_CPU_SET); + TmThreadSetCPU(tv, WORKER_CPU_SET); #ifndef AFLFUZZ_PCAP_RUNMODE if (TmThreadSpawn(tv) != TM_ECODE_OK) { @@ -177,7 +177,7 @@ int RunModeFilePcapAutoFp(void) cpu = 1; /* always create at least one thread */ - int thread_max = TmThreadGetNbThreads(DETECT_CPU_SET); + int thread_max = TmThreadGetNbThreads(WORKER_CPU_SET); if (thread_max == 0) thread_max = ncpus * threading_detect_ratio; if (thread_max < 1) @@ -253,7 +253,7 @@ int RunModeFilePcapAutoFp(void) /* add outputs as well */ SetupOutputs(tv_detect_ncpu); - TmThreadSetCPU(tv_detect_ncpu, DETECT_CPU_SET); + TmThreadSetCPU(tv_detect_ncpu, WORKER_CPU_SET); if (TmThreadSpawn(tv_detect_ncpu) != TM_ECODE_OK) { SCLogError(SC_ERR_RUNMODE, "TmThreadSpawn failed"); diff --git a/src/util-affinity.h b/src/util-affinity.h index 2c4e424b23..db12276c94 100644 --- a/src/util-affinity.h +++ b/src/util-affinity.h @@ -48,7 +48,7 @@ enum { RECEIVE_CPU_SET, - DETECT_CPU_SET, + WORKER_CPU_SET, VERDICT_CPU_SET, MANAGEMENT_CPU_SET, MAX_CPU_SET diff --git a/src/util-runmodes.c b/src/util-runmodes.c index 375295b104..d2789f0f47 100644 --- a/src/util-runmodes.c +++ b/src/util-runmodes.c @@ -99,7 +99,7 @@ int RunModeSetLiveCaptureAutoFp(ConfigIfaceParserFunc ConfigParser, /* Available cpus */ uint16_t ncpus = UtilCpuGetNumProcessorsOnline(); int nlive = LiveGetDeviceCount(); - int thread_max = TmThreadGetNbThreads(DETECT_CPU_SET); + int thread_max = TmThreadGetNbThreads(WORKER_CPU_SET); /* always create at least one thread */ if (thread_max == 0) thread_max = ncpus * threading_detect_ratio; @@ -253,7 +253,7 @@ int RunModeSetLiveCaptureAutoFp(ConfigIfaceParserFunc ConfigParser, } TmSlotSetFuncAppend(tv_detect_ncpu, tm_module, NULL); - TmThreadSetCPU(tv_detect_ncpu, DETECT_CPU_SET); + TmThreadSetCPU(tv_detect_ncpu, WORKER_CPU_SET); TmThreadSetGroupName(tv_detect_ncpu, "Detect"); @@ -354,7 +354,7 @@ static int RunModeSetLiveCaptureWorkersForDevice(ConfigIfaceThreadsCountFunc Mod SetupOutputs(tv); - TmThreadSetCPU(tv, DETECT_CPU_SET); + TmThreadSetCPU(tv, WORKER_CPU_SET); if (TmThreadSpawn(tv) != TM_ECODE_OK) { SCLogError(SC_ERR_THREAD_SPAWN, "TmThreadSpawn failed"); @@ -455,7 +455,7 @@ int RunModeSetIPSAutoFp(ConfigIPSParserFunc ConfigParser, uint16_t ncpus = UtilCpuGetNumProcessorsOnline(); int nqueue = LiveGetDeviceCount(); - int thread_max = TmThreadGetNbThreads(DETECT_CPU_SET); + int thread_max = TmThreadGetNbThreads(WORKER_CPU_SET); /* always create at least one thread */ if (thread_max == 0) thread_max = ncpus * threading_detect_ratio; @@ -531,7 +531,7 @@ int RunModeSetIPSAutoFp(ConfigIPSParserFunc ConfigParser, } TmSlotSetFuncAppend(tv_detect_ncpu, tm_module, NULL); - TmThreadSetCPU(tv_detect_ncpu, DETECT_CPU_SET); + TmThreadSetCPU(tv_detect_ncpu, WORKER_CPU_SET); SetupOutputs(tv_detect_ncpu); @@ -654,7 +654,7 @@ int RunModeSetIPSWorker(ConfigIPSParserFunc ConfigParser, SetupOutputs(tv); - TmThreadSetCPU(tv, DETECT_CPU_SET); + TmThreadSetCPU(tv, WORKER_CPU_SET); if (TmThreadSpawn(tv) != TM_ECODE_OK) { SCLogError(SC_ERR_RUNMODE, "TmThreadSpawn failed");