[ovs-dev] [PATCH 3/3] bridge: Report lacp_slave_is_current() in the database.

Ethan Jackson ethan at nicira.com
Fri Apr 15 20:49:19 UTC 2011


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          |   22 ++++++++++++++++++++++
 vswitchd/vswitch.ovsschema |    7 +++++--
 vswitchd/vswitch.xml       |    7 +++++++
 3 files changed, 34 insertions(+), 2 deletions(-)

diff --git a/vswitchd/bridge.c b/vswitchd/bridge.c
index 58f5ef6..8670402 100644
--- a/vswitchd/bridge.c
+++ b/vswitchd/bridge.c
@@ -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;
                 }
             }
         }
diff --git a/vswitchd/vswitch.ovsschema b/vswitchd/vswitch.ovsschema
index 40a6866..90fedd9 100644
--- a/vswitchd/vswitch.ovsschema
+++ b/vswitchd/vswitch.ovsschema
@@ -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": {
@@ -167,6 +167,9 @@
            "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": {
diff --git a/vswitchd/vswitch.xml b/vswitchd/vswitch.xml
index 7603719..c88fb41 100644
--- a/vswitchd/vswitch.xml
+++ b/vswitchd/vswitch.xml
@@ -1211,6 +1211,13 @@
         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.
+      </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
-- 
1.7.4.2




More information about the dev mailing list