From: Ethan Jackson Date: Tue, 10 Sep 2013 22:36:21 +0000 (-0700) Subject: ofproto: Reduce default number of miss handlers. X-Git-Tag: sliver-openvswitch-2.0.90-1~15^2~3 X-Git-Url: http://git.onelab.eu/?p=sliver-openvswitch.git;a=commitdiff_plain;h=cc86b1f84b1e2fe1b322a23a2b3b88c0375f2fa1 ofproto: Reduce default number of miss handlers. The default number of miss handlers should be the number of processors minus two to account for the dispatcher and main threads. Signed-off-by: Ethan Jackson Acked-by: Ben Pfaff --- diff --git a/ofproto/ofproto.c b/ofproto/ofproto.c index a9a20b811..abf14f295 100644 --- a/ofproto/ofproto.c +++ b/ofproto/ofproto.c @@ -642,14 +642,15 @@ ofproto_set_mac_table_config(struct ofproto *ofproto, unsigned idle_time, } /* Sets number of upcall handler threads. The default is - * (number of online cores - 1). */ + * (number of online cores - 2). */ void ofproto_set_n_handler_threads(unsigned limit) { if (limit) { n_handler_threads = limit; } else { - n_handler_threads = MAX(1, sysconf(_SC_NPROCESSORS_ONLN) - 1); + int n_proc = sysconf(_SC_NPROCESSORS_ONLN); + n_handler_threads = n_proc > 2 ? n_proc - 2 : 1; } } diff --git a/vswitchd/vswitch.xml b/vswitchd/vswitch.xml index 9a48eb10f..4b42ec738 100644 --- a/vswitchd/vswitch.xml +++ b/vswitchd/vswitch.xml @@ -163,7 +163,7 @@ type='{"type": "integer", "minInteger": 1}'>

Specifies the number of threads for software datapaths to use for - handling new flows. The default is one less than the number of + handling new flows. The default is two less than the number of online CPU cores (but at least 1).