bridge: Report lacp_slave_is_current() in the database.
authorEthan Jackson <ethan@nicira.com>
Wed, 13 Apr 2011 23:06:50 +0000 (16:06 -0700)
committerEthan Jackson <ethan@nicira.com>
Mon, 18 Apr 2011 17:48:48 +0000 (10:48 -0700)
Whether or not a given slave is current with its LACP protocol
messages can be very interesting to a controller.  If an interface
is not current, it usually indicates a connectivity problem or
misconfiguration of some sort.

vswitchd/bridge.c
vswitchd/vswitch.ovsschema
vswitchd/vswitch.xml

index dc4960e..a0762fe 100644 (file)
@@ -1233,6 +1233,27 @@ iface_refresh_cfm_stats(struct iface *iface)
     return changed;
 }
 
+static bool
+iface_refresh_lacp_stats(struct iface *iface)
+{
+    bool *db_current = iface->cfg->lacp_current;
+    bool changed = false;
+
+    if (iface->port->lacp) {
+        bool current = lacp_slave_is_current(iface->port->lacp, iface);
+
+        if (!db_current || *db_current != current) {
+            changed = true;
+            ovsrec_interface_set_lacp_current(iface->cfg, &current, 1);
+        }
+    } else if (db_current) {
+        changed = true;
+        ovsrec_interface_set_lacp_current(iface->cfg, NULL, 0);
+    }
+
+    return changed;
+}
+
 static void
 iface_refresh_stats(struct iface *iface)
 {
@@ -1434,6 +1455,7 @@ bridge_run(void)
 
                 LIST_FOR_EACH (iface, port_elem, &port->ifaces) {
                     changed = iface_refresh_cfm_stats(iface) || changed;
+                    changed = iface_refresh_lacp_stats(iface) || changed;
                 }
             }
         }
index 40a6866..90fedd9 100644 (file)
@@ -1,6 +1,6 @@
 {"name": "Open_vSwitch",
- "version": "3.2.0",
- "cksum": "3787492311 15165",
+ "version": "3.3.0",
+ "cksum": "1105667635 15276",
  "tables": {
    "Open_vSwitch": {
      "columns": {
            "key": {"type": "uuid", "refTable": "Monitor"},
            "min": 0,
            "max": 1}},
+       "lacp_current": {
+         "type": {"key": {"type": "boolean"},
+                  "min": 0, "max": 1}},
        "other_config": {
          "type": {"key": "string", "value": "string", "min": 0, "max": "unlimited"}},
        "statistics": {
index 7603719..566e6cf 100644 (file)
         Connectivity monitor configuration for this interface.
       </column>
 
+      <column name="lacp_current">
+        Boolean value indicating LACP status for this interface.  If true, this
+        interface has current LACP information about its LACP partner.  This
+        information may be used to monitor the health of interfaces in a LACP
+        enabled port. This column will be empty if LACP is not enabled.
+      </column>
+
       <column name="external_ids">
         Key-value pairs for use by external frameworks that integrate
         with Open vSwitch, rather than by Open vSwitch itself.  System