aboutsummaryrefslogtreecommitdiff
path: root/vswitchd
diff options
context:
space:
mode:
authorEthan Jackson <ethan@nicira.com>2011-10-14 12:49:57 -0700
committerEthan Jackson <ethan@nicira.com>2011-10-17 15:03:03 -0700
commit65c3058c22803c7e8d8fd0bfbb84fe27456fb137 (patch)
tree88dd05f5dc01a6a554c2d940c007e21d2eb2bfca /vswitchd
parent3a1831242856a975d57c875b8f8987b819e8dd39 (diff)
vswitchd: New column "link_resets".
An interface's 'link_resets' column represents the number of times Open vSwitch has observed its link_state change.
Diffstat (limited to 'vswitchd')
-rw-r--r--vswitchd/bridge.c5
-rw-r--r--vswitchd/vswitch.ovsschema8
-rw-r--r--vswitchd/vswitch.xml7
3 files changed, 18 insertions, 2 deletions
diff --git a/vswitchd/bridge.c b/vswitchd/bridge.c
index b3c62187..d4335c10 100644
--- a/vswitchd/bridge.c
+++ b/vswitchd/bridge.c
@@ -238,6 +238,7 @@ bridge_init(const char *remote)
ovsdb_idl_omit_alert(idl, &ovsrec_interface_col_duplex);
ovsdb_idl_omit_alert(idl, &ovsrec_interface_col_link_speed);
ovsdb_idl_omit_alert(idl, &ovsrec_interface_col_link_state);
+ ovsdb_idl_omit_alert(idl, &ovsrec_interface_col_link_resets);
ovsdb_idl_omit_alert(idl, &ovsrec_interface_col_mtu);
ovsdb_idl_omit_alert(idl, &ovsrec_interface_col_ofport);
ovsdb_idl_omit_alert(idl, &ovsrec_interface_col_statistics);
@@ -1574,6 +1575,7 @@ bridge_run(void)
HMAP_FOR_EACH (iface, name_node, &br->iface_by_name) {
const char *link_state;
+ int64_t link_resets;
int current;
if (iface_is_synthetic(iface)) {
@@ -1591,6 +1593,9 @@ bridge_run(void)
link_state = netdev_get_carrier(iface->netdev) ? "up" : "down";
ovsrec_interface_set_link_state(iface->cfg, link_state);
+
+ link_resets = netdev_get_carrier_resets(iface->netdev);
+ ovsrec_interface_set_link_resets(iface->cfg, &link_resets, 1);
}
}
diff --git a/vswitchd/vswitch.ovsschema b/vswitchd/vswitch.ovsschema
index b32e26b2..5fce9890 100644
--- a/vswitchd/vswitch.ovsschema
+++ b/vswitchd/vswitch.ovsschema
@@ -1,6 +1,6 @@
{"name": "Open_vSwitch",
- "version": "6.1.1",
- "cksum": "282564184 14747",
+ "version": "6.2.0",
+ "cksum": "212779557 14885",
"tables": {
"Open_vSwitch": {
"columns": {
@@ -209,6 +209,10 @@
"enum": ["set", ["up", "down"]]},
"min": 0, "max": 1},
"ephemeral": true},
+ "link_resets": {
+ "type": {"key": {"type": "integer"},
+ "min": 0, "max": 1},
+ "ephemeral": true},
"link_speed": {
"type": {"key": "integer", "min": 0, "max": 1},
"ephemeral": true},
diff --git a/vswitchd/vswitch.xml b/vswitchd/vswitch.xml
index d579b872..683b27ea 100644
--- a/vswitchd/vswitch.xml
+++ b/vswitchd/vswitch.xml
@@ -1181,6 +1181,13 @@
</p>
</column>
+ <column name="link_resets">
+ <p>
+ The number of times Open vSwitch has observed the
+ <ref column="link_state"/> of this <ref table="Interface"/> change.
+ </p>
+ </column>
+
<column name="link_speed">
<p>
The negotiated speed of the physical network link.