Same comment about the commit message. Acked-by: Joe Stringer <joestrin...@nicira.com>
On 20 June 2014 16:23, Alex Wang <al...@nicira.com> wrote: > From: Joe Stringer <joestrin...@nicira.com> > > This patch adds a new configuration option, "max-idle" to the > Open_vSwitch "other-config" column. This sets how long datapath flows > are cached in the datapath before revalidators expire them. > > Signed-off-by: Joe Stringer <joestrin...@nicira.com> > Signed-off-by: Justin Pettit <jpet...@nicira.com> > --- > ofproto/ofproto-dpif-upcall.c | 5 ++--- > ofproto/ofproto-provider.h | 5 +++++ > ofproto/ofproto.c | 9 +++++++++ > ofproto/ofproto.h | 2 ++ > vswitchd/bridge.c | 2 ++ > 5 files changed, 20 insertions(+), 3 deletions(-) > > diff --git a/ofproto/ofproto-dpif-upcall.c b/ofproto/ofproto-dpif-upcall.c > index 15be818..f8619d6 100644 > --- a/ofproto/ofproto-dpif-upcall.c > +++ b/ofproto/ofproto-dpif-upcall.c > @@ -41,7 +41,6 @@ > #define MAX_QUEUE_LENGTH 512 > #define FLOW_MISS_MAX_BATCH 50 > #define REVALIDATE_MAX_BATCH 50 > -#define MAX_IDLE 1500 > > VLOG_DEFINE_THIS_MODULE(ofproto_dpif_upcall); > > @@ -636,7 +635,7 @@ udpif_flow_dumper(void *arg) > duration); > } > > - poll_timer_wait_until(start_time + MIN(MAX_IDLE, 500)); > + poll_timer_wait_until(start_time + MIN(ofproto_max_idle, 500)); > seq_wait(udpif->reval_seq, udpif->last_reval_seq); > latch_wait(&udpif->exit_latch); > poll_block(); > @@ -1508,7 +1507,7 @@ revalidate_udumps(struct revalidator *revalidator, > struct list *udumps) > n_flows = udpif_get_n_flows(udpif); > > must_del = false; > - max_idle = MAX_IDLE; > + max_idle = ofproto_max_idle; > if (n_flows > flow_limit) { > must_del = n_flows > 2 * flow_limit; > max_idle = 100; > diff --git a/ofproto/ofproto-provider.h b/ofproto/ofproto-provider.h > index cc318ee..32b688e 100644 > --- a/ofproto/ofproto-provider.h > +++ b/ofproto/ofproto-provider.h > @@ -459,6 +459,11 @@ void rule_collection_destroy(struct rule_collection > *); > * ofproto-dpif implementation. */ > extern unsigned ofproto_flow_limit; > > +/* Maximum idle time (in ms) for flows to be cached in the datapath. > + * Revalidators may expire flows more quickly than the configured value > based > + * on system load and other factors. This variable is subject to change. > */ > +extern unsigned ofproto_max_idle; > + > /* Number of upcall handler and revalidator threads. Only affects the > * ofproto-dpif implementation. */ > extern size_t n_handlers, n_revalidators; > diff --git a/ofproto/ofproto.c b/ofproto/ofproto.c > index 148de2d..e6393b2 100644 > --- a/ofproto/ofproto.c > +++ b/ofproto/ofproto.c > @@ -308,6 +308,7 @@ struct ovs_mutex ofproto_mutex = OVS_MUTEX_INITIALIZER; > > unsigned ofproto_flow_limit = OFPROTO_FLOW_LIMIT_DEFAULT; > enum ofproto_flow_miss_model flow_miss_model = OFPROTO_HANDLE_MISS_AUTO; > +unsigned ofproto_max_idle = OFPROTO_MAX_IDLE_DEFAULT; > > size_t n_handlers, n_revalidators; > > @@ -705,6 +706,14 @@ ofproto_set_flow_miss_model(unsigned model) > flow_miss_model = model; > } > > +/* Sets the maximum idle time for flows in the datapath before they are > + * expired. */ > +void > +ofproto_set_max_idle(unsigned max_idle) > +{ > + ofproto_max_idle = max_idle; > +} > + > /* If forward_bpdu is true, the NORMAL action will forward frames with > * reserved (e.g. STP) destination Ethernet addresses. if forward_bpdu is > false, > * the NORMAL action will drop these frames. */ > diff --git a/ofproto/ofproto.h b/ofproto/ofproto.h > index 3034d32..68854d1 100644 > --- a/ofproto/ofproto.h > +++ b/ofproto/ofproto.h > @@ -214,6 +214,7 @@ int ofproto_port_dump_done(struct ofproto_port_dump *); > ) > > #define OFPROTO_FLOW_LIMIT_DEFAULT 200000 > +#define OFPROTO_MAX_IDLE_DEFAULT 1500 > > /* How flow misses should be handled in ofproto-dpif */ > enum ofproto_flow_miss_model { > @@ -244,6 +245,7 @@ void ofproto_set_extra_in_band_remotes(struct ofproto > *, > void ofproto_set_in_band_queue(struct ofproto *, int queue_id); > void ofproto_set_flow_limit(unsigned limit); > void ofproto_set_flow_miss_model(unsigned model); > +void ofproto_set_max_idle(unsigned max_idle); > 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); > diff --git a/vswitchd/bridge.c b/vswitchd/bridge.c > index 351f3e0..07c4496 100644 > --- a/vswitchd/bridge.c > +++ b/vswitchd/bridge.c > @@ -496,6 +496,8 @@ bridge_reconfigure(const struct ovsrec_open_vswitch > *ovs_cfg) > > ofproto_set_flow_limit(smap_get_int(&ovs_cfg->other_config, > "flow-limit", > OFPROTO_FLOW_LIMIT_DEFAULT)); > + ofproto_set_max_idle(smap_get_int(&ovs_cfg->other_config, "max-idle", > + OFPROTO_MAX_IDLE_DEFAULT)); > > ofproto_set_threads( > smap_get_int(&ovs_cfg->other_config, "n-handler-threads", 0), > -- > 1.7.9.5 > >
_______________________________________________ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev