[ovs-dev] [PATCH] ofproto: Handle negative number of threads.
Ethan Jackson
ethan at nicira.com
Thu Jan 23 02:30:49 UTC 2014
> - n_revalidators = n_revalidators_;
> - n_handlers = n_handlers_;
> + if (n_revalidators_ > 0) {
> + n_revalidators = n_revalidators_;
> + }
> +
> + if (n_handlers_ > 0) {
> + n_handlers = n_handlers_;
> + }
I'd expect we'd set n_handlers and n_revalidators to (WLOG) n_handlers
= MAX(n_handlers_, 0). If we do that, then setting a negative number
is equivalent to setting nothing, which is less surprising than
holding the previous value.
Ethan
>
> if (!n_revalidators) {
> n_revalidators = n_handlers
> diff --git a/ofproto/ofproto.h b/ofproto/ofproto.h
> index 3034d32..0ac4454 100644
> --- a/ofproto/ofproto.h
> +++ b/ofproto/ofproto.h
> @@ -247,7 +247,7 @@ void ofproto_set_flow_miss_model(unsigned model);
> void ofproto_set_forward_bpdu(struct ofproto *, bool forward_bpdu);
> void ofproto_set_mac_table_config(struct ofproto *, unsigned idle_time,
> size_t max_entries);
> -void ofproto_set_threads(size_t n_handlers, size_t n_revalidators);
> +void ofproto_set_threads(int n_handlers, int n_revalidators);
> void ofproto_set_dp_desc(struct ofproto *, const char *dp_desc);
> int ofproto_set_snoops(struct ofproto *, const struct sset *snoops);
> int ofproto_set_netflow(struct ofproto *,
> --
> 1.7.9.5
>
> _______________________________________________
> dev mailing list
> dev at openvswitch.org
> http://openvswitch.org/mailman/listinfo/dev
More information about the dev
mailing list