2
0
mirror of https://github.com/openvswitch/ovs synced 2025-10-13 14:07:02 +00:00

vswitchd: Update link_state instantly.

With this patch, instead of updating an interface's link_state once
every 5 seconds, it's updated immediately when changed.  To avoid
stressing the database, these updates are rate limited to once per
second.
This commit is contained in:
Ethan Jackson
2011-10-14 17:29:35 -07:00
parent 15236eb49d
commit 70aa337d73

View File

@@ -1274,11 +1274,6 @@ iface_refresh_status(struct iface *iface)
ovsrec_interface_set_link_speed(iface->cfg, NULL, 0);
}
ovsrec_interface_set_link_state(iface->cfg,
(netdev_get_carrier(iface->netdev)
? "up"
: "down"));
error = netdev_get_mtu(iface->netdev, &mtu);
if (!error) {
mtu_64 = mtu;
@@ -1578,6 +1573,7 @@ bridge_run(void)
struct iface *iface;
HMAP_FOR_EACH (iface, name_node, &br->iface_by_name) {
const char *link_state;
int current;
if (iface_is_synthetic(iface)) {
@@ -1592,6 +1588,9 @@ bridge_run(void)
} else {
ovsrec_interface_set_lacp_current(iface->cfg, NULL, 0);
}
link_state = netdev_get_carrier(iface->netdev) ? "up" : "down";
ovsrec_interface_set_link_state(iface->cfg, link_state);
}
}