summaryrefslogtreecommitdiff
path: root/vswitchd
diff options
context:
space:
mode:
authorEthan Jackson <ethan@nicira.com>2011-08-26 14:54:34 -0700
committerEthan Jackson <ethan@nicira.com>2011-09-09 14:11:14 -0700
commit1de11730e612b09e28892880c2845185497a3741 (patch)
tree87e8cb6122e52d7c6b709faefce670ae638d9c68 /vswitchd
parent348f01e3e36b67f86ac2f9f90c7574d9e1b85d73 (diff)
downloadopenvswitch-1de11730e612b09e28892880c2845185497a3741.tar.gz
cfm: Write remote MPIDs to the database.
A controller may want to know which MPIDs are reachable from an interface configured with CFM. This patch regularly writes this information to the database. Bug #7014.
Diffstat (limited to 'vswitchd')
-rw-r--r--vswitchd/bridge.c14
-rw-r--r--vswitchd/vswitch.ovsschema7
2 files changed, 19 insertions, 2 deletions
diff --git a/vswitchd/bridge.c b/vswitchd/bridge.c
index 44b5fbe94..abea4f348 100644
--- a/vswitchd/bridge.c
+++ b/vswitchd/bridge.c
@@ -243,6 +243,7 @@ bridge_init(const char *remote)
ovsdb_idl_omit_alert(idl, &ovsrec_interface_col_statistics);
ovsdb_idl_omit_alert(idl, &ovsrec_interface_col_status);
ovsdb_idl_omit_alert(idl, &ovsrec_interface_col_cfm_fault);
+ ovsdb_idl_omit_alert(idl, &ovsrec_interface_col_cfm_remote_mpids);
ovsdb_idl_omit_alert(idl, &ovsrec_interface_col_lacp_current);
ovsdb_idl_omit(idl, &ovsrec_interface_col_external_ids);
@@ -1262,7 +1263,9 @@ static void
iface_refresh_cfm_stats(struct iface *iface)
{
const struct ovsrec_interface *cfg = iface->cfg;
- int fault;
+ int fault, error;
+ const uint64_t *rmps;
+ size_t n_rmps;
fault = ofproto_port_get_cfm_fault(iface->port->bridge->ofproto,
iface->ofp_port);
@@ -1272,6 +1275,15 @@ iface_refresh_cfm_stats(struct iface *iface)
} else {
ovsrec_interface_set_cfm_fault(cfg, NULL, 0);
}
+
+ error = ofproto_port_get_cfm_remote_mpids(iface->port->bridge->ofproto,
+ iface->ofp_port, &rmps, &n_rmps);
+ if (error >= 0) {
+ ovsrec_interface_set_cfm_remote_mpids(cfg, (const int64_t *)rmps,
+ n_rmps);
+ } else {
+ ovsrec_interface_set_cfm_remote_mpids(cfg, NULL, 0);
+ }
}
static bool
diff --git a/vswitchd/vswitch.ovsschema b/vswitchd/vswitch.ovsschema
index 4a009b0df..25047b5ce 100644
--- a/vswitchd/vswitch.ovsschema
+++ b/vswitchd/vswitch.ovsschema
@@ -1,6 +1,6 @@
{"name": "Open_vSwitch",
"version": "6.0.0",
- "cksum": "277444055 14339",
+ "cksum": "3439303729 14480",
"tables": {
"Open_vSwitch": {
"columns": {
@@ -171,6 +171,11 @@
"key": {"type": "integer"},
"min": 0,
"max": 1}},
+ "cfm_remote_mpids": {
+ "type": {
+ "key": {"type": "integer"},
+ "min": 0,
+ "max": "unlimited"}},
"cfm_fault": {
"type": {
"key": { "type": "boolean"},