* timeout in 'STATUS_CHECK_AGAIN_MSEC' to check again. */
#define STATUS_CHECK_AGAIN_MSEC 100
+/* Statistics update to database. */
+static struct ovsdb_idl_txn *stats_txn;
+
/* Each time this timer expires, the bridge fetches interface and mirror
* statistics and pushes them into the database. */
static int stats_timer_interval;
static void
run_stats_update(void)
{
- static struct ovsdb_idl_txn *stats_txn;
const struct ovsrec_open_vswitch *cfg = ovsrec_open_vswitch_first(idl);
int stats_interval;
}
}
+static void
+stats_update_wait(void)
+{
+ /* If the 'stats_txn' is non-null (transaction incomplete), waits for the
+ * transaction to complete. Otherwise, waits for the 'stats_timer'. */
+ if (stats_txn) {
+ ovsdb_idl_txn_wait(stats_txn);
+ } else {
+ poll_timer_wait_until(stats_timer);
+ }
+}
+
/* Update bridge/port/interface status if necessary. */
static void
run_status_update(void)
HMAP_FOR_EACH (br, node, &all_bridges) {
ofproto_wait(br->ofproto);
}
-
- poll_timer_wait_until(stats_timer);
+ stats_update_wait();
status_update_wait();
}