summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPravin B Shelar <pshelar@nicira.com>2012-03-23 14:14:24 -0700
committerPravin B Shelar <pshelar@nicira.com>2012-03-23 14:14:24 -0700
commitc1f15723c03d1ed734ed1c2d2ac85e6c8b055206 (patch)
treeb23da289b181dd34bf285dda371f553b1a4aace3
parent324f0c59d2bf3a0ad74c93b683b6ceeb1d732304 (diff)
downloadopenvswitch-c1f15723c03d1ed734ed1c2d2ac85e6c8b055206.tar.gz
vswitchd: Do not refresh existing iface on new device addition.
There is no need to refresh status and stats for existing devices if iface mtu is missing in ovs-db as missing MTU could just mean error in last MTU read for that device. So we can refresh stats for devices which are just created. Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
-rw-r--r--vswitchd/bridge.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/vswitchd/bridge.c b/vswitchd/bridge.c
index 7e2493728..2ea146cfa 100644
--- a/vswitchd/bridge.c
+++ b/vswitchd/bridge.c
@@ -75,6 +75,7 @@ struct iface {
struct netdev *netdev; /* Network device. */
const char *type; /* Usually same as cfg->type. */
const struct ovsrec_interface *cfg;
+ bool need_refresh; /* Refresh iface after create. */
};
struct mirror {
@@ -1189,9 +1190,10 @@ bridge_add_ofproto_ports(struct bridge *br)
}
/* Populate stats columns in new Interface rows. */
- if (iface->netdev && !iface->cfg->mtu) {
+ if (iface->netdev && iface->need_refresh) {
iface_refresh_stats(iface);
iface_refresh_status(iface);
+ iface->need_refresh = false;
}
/* Delete the iface if we failed. */
@@ -2929,6 +2931,7 @@ iface_create(struct port *port, const struct ovsrec_interface *if_cfg)
iface->tag = tag_create_random();
iface->netdev = NULL;
iface->cfg = if_cfg;
+ iface->need_refresh = true;
hmap_insert(&br->iface_by_name, &iface->name_node, hash_string(name, 0));