aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Evans <aevans@nicira.com>2011-06-28 13:17:54 -0700
committerAndrew Evans <aevans@nicira.com>2011-06-28 13:17:54 -0700
commit1101a0b4708d87505d80c4641c4adadd5c6ece36 (patch)
tree370ebfa0444c528acae30badd6595e2baa8aa1bd
parent7ba7dcf014a9f830f99967907534bbd5e32dfc36 (diff)
bridge: Populate interface status/statistics as soon as a port is added.
Currently there's a lag of up to five seconds before the status and statistics columns in the Interface table are populated when a port is first added to a bridge. This may confuse systems that expect those columns to be populated right away. Bug #6145.
-rw-r--r--vswitchd/bridge.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/vswitchd/bridge.c b/vswitchd/bridge.c
index d0a5764d..93544032 100644
--- a/vswitchd/bridge.c
+++ b/vswitchd/bridge.c
@@ -195,7 +195,9 @@ static void iface_set_mac(struct iface *);
static void iface_set_ofport(const struct ovsrec_interface *, int64_t ofport);
static void iface_configure_qos(struct iface *, const struct ovsrec_qos *);
static void iface_configure_cfm(struct iface *);
-static bool iface_refresh_cfm_stats(struct iface *iface);
+static bool iface_refresh_cfm_stats(struct iface *);
+static void iface_refresh_stats(struct iface *);
+static void iface_refresh_status(struct iface *);
static bool iface_get_carrier(const struct iface *);
static bool iface_is_synthetic(const struct iface *);
@@ -866,6 +868,12 @@ bridge_add_ofproto_ports(struct bridge *br)
iface->name, strerror(error));
}
+ /* Populate stats columns in new Interface rows. */
+ if (!iface->cfg->mtu) {
+ iface_refresh_stats(iface);
+ iface_refresh_status(iface);
+ }
+
/* Add the port, if necessary. */
if (iface->netdev && iface->ofp_port < 0) {
uint16_t ofp_port;