From fdd73c2366a19ae4c8295bc59a7a62e8eb03954e Mon Sep 17 00:00:00 2001 From: Gurucharan Shetty Date: Mon, 10 Mar 2014 09:59:56 -0700 Subject: [PATCH] ovs-thread: count the number of cpu cores. We use the number of cpu cores to determine the number of threads that we spawn. We are not yet sure what is the ideal number of OVS userspace threads that can run on Hyper-V. Till we figure that out, use the same logic of counting CPU cores in Windows too. Signed-off-by: Gurucharan Shetty Acked-by: Ben Pfaff --- lib/ovs-thread.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/ovs-thread.c b/lib/ovs-thread.c index b6b51c76a..85de014ec 100644 --- a/lib/ovs-thread.c +++ b/lib/ovs-thread.c @@ -509,10 +509,16 @@ count_cpu_cores(void) static long int n_cores; if (ovsthread_once_start(&once)) { +#ifndef _WIN32 parse_cpuinfo(&n_cores); if (!n_cores) { n_cores = sysconf(_SC_NPROCESSORS_ONLN); } +#else + SYSTEM_INFO sysinfo; + GetSystemInfo(&sysinfo); + n_cores = sysinfo.dwNumberOfProcessors; +#endif ovsthread_once_done(&once); } -- 2.47.0