[ovs-dev] [PATCH V2] cfm: Update the ovsdb when remote maintenance points changed.

Alex Wang alexw at nicira.com
Sat Mar 15 23:40:28 UTC 2014


The list of remote maintenance points can be used by other daemons
in leader election.  This commit makes ovs-vswitchd update the
row of remote maintenance points in ovsdb immediately after it is
changed.

Signed-off-by: Alex Wang <alexw at nicira.com>

---
PATCH -> V2:
- remove the seq_change in cfm_process_heartbeat().
  realize that the returned rmps_array is only updated in
  cfm_run(), the check should be placed there.
---
 lib/cfm.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/lib/cfm.c b/lib/cfm.c
index 38448ab..5e4be6c 100644
--- a/lib/cfm.c
+++ b/lib/cfm.c
@@ -393,6 +393,7 @@ cfm_run(struct cfm *cfm) OVS_EXCLUDED(mutex)
     if (timer_expired(&cfm->fault_timer)) {
         long long int interval = cfm_fault_interval(cfm);
         struct remote_mp *rmp, *rmp_next;
+        size_t old_rmps_array_len = cfm->rmps_array_len;
         bool old_cfm_fault = cfm->fault;
         bool old_rmp_opup = cfm->remote_opup;
         bool demand_override;
@@ -457,6 +458,7 @@ cfm_run(struct cfm *cfm) OVS_EXCLUDED(mutex)
                           " %lldms", cfm->name, rmp->mpid,
                           time_msec() - rmp->last_rx);
                 if (!demand_override) {
+                    seq_change(connectivity_seq_get());
                     hmap_remove(&cfm->remote_mps, &rmp->node);
                     free(rmp);
                 }
@@ -480,7 +482,8 @@ cfm_run(struct cfm *cfm) OVS_EXCLUDED(mutex)
             cfm->remote_opup = true;
         }
 
-        if (old_rmp_opup != cfm->remote_opup) {
+        if (old_rmp_opup != cfm->remote_opup
+            || old_rmps_array_len != cfm->rmps_array_len) {
             seq_change(connectivity_seq_get());
         }
 
-- 
1.7.9.5




More information about the dev mailing list