/* 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
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);
bool vlan_splinters_changed;
struct bridge *br;
+ int stats_interval;
ovsrec_open_vswitch_init(&null_cfg);
}
}
+ /* 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;
ovsdb_idl_txn_destroy(txn); /* XXX */
}
- iface_stats_timer = time_msec() + IFACE_STATS_INTERVAL;
+ stats_timer = time_msec() + stats_timer_interval;
}
if (!status_txn) {
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,