From a8172aa37812cc77de25f0c3baa9d23b6f377e8f Mon Sep 17 00:00:00 2001 From: Ethan Jackson Date: Wed, 13 Apr 2011 16:06:50 -0700 Subject: [PATCH] bridge: Report lacp_slave_is_current() in the database. 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 dc4960e60..a0762fe6e 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, ¤t, 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 40a686630..90fedd98a 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 76037193c..566e6cf69 100644 --- a/vswitchd/vswitch.xml +++ b/vswitchd/vswitch.xml @@ -1211,6 +1211,13 @@ Connectivity monitor configuration for this interface. + + 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. + + Key-value pairs for use by external frameworks that integrate with Open vSwitch, rather than by Open vSwitch itself. System -- 2.43.0