X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=ofproto%2Fofproto.c;h=abf14f2952954f3b9c1095df54c746c7bb78b145;hb=cc86b1f84b1e2fe1b322a23a2b3b88c0375f2fa1;hp=a9a20b811c762714719e39a5e2f3ce7363a5ad70;hpb=0165217e70501130b98ba6a5e81f91c56a2d0bd2;p=sliver-openvswitch.git 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; } }