git://git.onelab.eu
/
sliver-openvswitch.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
ofproto: Reduce default number of miss handlers.
[sliver-openvswitch.git]
/
ofproto
/
ofproto.c
diff --git
a/ofproto/ofproto.c
b/ofproto/ofproto.c
index
a9a20b8
..
abf14f2
100644
(file)
--- 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
}
/* 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 {
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;
}
}
}
}