}
/* 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;
}
}
struct oftable *table = &p->tables[i];
struct eviction_group *evg;
struct cls_cursor cursor;
- struct cls_rule cr;
struct rule *rule;
if (!table->eviction_fields) {
}
ovs_rwlock_rdlock(&table->cls.rwlock);
- cls_cursor_init(&cursor, &table->cls, &cr);
+ cls_cursor_init(&cursor, &table->cls, NULL);
CLS_CURSOR_FOR_EACH (rule, cr, &cursor) {
if (!rule->eviction_group
&& (rule->idle_timeout || rule->hard_timeout)) {