X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=vswitchd%2Fbridge.c;h=1145e98db5efcae89d17e077141939acdbc6fb56;hb=HEAD;hp=84e9ab82b3639b83379f7d03b373ea3d02327d2a;hpb=6a5f9a8fbdfa85795101b46ee1047dfd2b1007c6;p=sliver-openvswitch.git diff --git a/vswitchd/bridge.c b/vswitchd/bridge.c index 84e9ab82b..1145e98db 100644 --- a/vswitchd/bridge.c +++ b/vswitchd/bridge.c @@ -182,8 +182,8 @@ static struct ovsdb_idl_txn *status_txn; /* Each time this timer expires, the bridge fetches interface and mirror * statistics and pushes them into the database. */ -#define IFACE_STATS_INTERVAL (5 * 1000) /* In milliseconds. */ -static long long int iface_stats_timer = LLONG_MIN; +static int stats_timer_interval; +static long long int stats_timer = LLONG_MIN; /* Set to true to allow experimental use of OpenFlow 1.4. * This is false initially because OpenFlow 1.4 is not yet safe to use: it can @@ -626,13 +626,6 @@ bridge_reconfigure(const struct ovsrec_open_vswitch *ovs_cfg) bridge_configure_stp(br); bridge_configure_tables(br); bridge_configure_dp_desc(br); - - if (smap_get(&br->cfg->other_config, "flow-eviction-threshold")) { - /* XXX: Remove this warning message eventually. */ - VLOG_WARN_ONCE("As of June 2013, flow-eviction-threshold has been" - " moved to the Open_vSwitch table. Ignoring its" - " setting in the bridge table."); - } } free(managers); @@ -2282,6 +2275,7 @@ bridge_run(void) bool vlan_splinters_changed; struct bridge *br; + int stats_interval; ovsrec_open_vswitch_init(&null_cfg); @@ -2387,8 +2381,17 @@ bridge_run(void) } } + /* Statistics update interval should always be greater than or equal to + * 5000 ms. */ + stats_interval = MAX(smap_get_int(&cfg->other_config, + "stats-update-interval", 5000), 5000); + if (stats_timer_interval != stats_interval) { + stats_timer_interval = stats_interval; + stats_timer = LLONG_MIN; + } + /* Refresh interface and mirror stats if necessary. */ - if (time_msec() >= iface_stats_timer) { + if (time_msec() >= stats_timer) { if (cfg) { struct ovsdb_idl_txn *txn; @@ -2417,7 +2420,7 @@ bridge_run(void) ovsdb_idl_txn_destroy(txn); /* XXX */ } - iface_stats_timer = time_msec() + IFACE_STATS_INTERVAL; + stats_timer = time_msec() + stats_timer_interval; } if (!status_txn) { @@ -2484,7 +2487,8 @@ bridge_wait(void) HMAP_FOR_EACH (br, node, &all_bridges) { ofproto_wait(br->ofproto); } - poll_timer_wait_until(iface_stats_timer); + + poll_timer_wait_until(stats_timer); } /* If the status database transaction is 'TXN_INCOMPLETE' in this run,