diff options
author | Paul Ingram <pingram@nicira.com> | 2013-08-03 07:12:36 +0000 |
---|---|---|
committer | Ethan Jackson <ethan@nicira.com> | 2013-08-05 13:17:05 -0700 |
commit | 016953ae96bebb3d3c421757d1f98b9966433bd1 (patch) | |
tree | 1c999296646f3d5d0d21958df74ea9f21c21f0f8 /lib/cfm.c | |
parent | de8d2ef9dd141f4a96d4b79afbfadb3c4eb042c7 (diff) | |
download | openvswitch-016953ae96bebb3d3c421757d1f98b9966433bd1.tar.gz |
cfm: update remote opstate only when a CCM is received.
The remote opstate for a CFM interface is presumed to be up unless a CCM is
received which signals opstate down. This means than an interface configured
for CFM demand mode may incorrectly appear to be opstate up if it has not
received a CCM within the last fault interval.
We should remember the last remote opstate for a CFM interface and only
change it when a CCM arrives signaling a change.
Bug #18806
Signed-off-by: Paul Ingram <pingram@nicira.com>
Signed-off-by: Ethan Jackson <ethan@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
Diffstat (limited to 'lib/cfm.c')
-rw-r--r-- | lib/cfm.c | 16 |
1 files changed, 13 insertions, 3 deletions
@@ -390,6 +390,8 @@ cfm_run(struct cfm *cfm) OVS_EXCLUDED(mutex) struct remote_mp *rmp, *rmp_next; bool old_cfm_fault = cfm->fault; bool demand_override; + bool rmp_set_opup = false; + bool rmp_set_opdown = false; cfm->fault = cfm->recv_fault; cfm->recv_fault = 0; @@ -399,7 +401,6 @@ cfm_run(struct cfm *cfm) OVS_EXCLUDED(mutex) cfm->rmps_array = xmalloc(hmap_count(&cfm->remote_mps) * sizeof *cfm->rmps_array); - cfm->remote_opup = true; if (cfm->health_interval == CFM_HEALTH_INTERVAL) { /* Calculate the cfm health of the interface. If the number of * remote_mpids of a cfm interface is > 1, the cfm health is @@ -451,14 +452,23 @@ cfm_run(struct cfm *cfm) OVS_EXCLUDED(mutex) } else { rmp->recv = false; - if (!rmp->opup) { - cfm->remote_opup = rmp->opup; + if (rmp->opup) { + rmp_set_opup = true; + } else { + rmp_set_opdown = true; } cfm->rmps_array[cfm->rmps_array_len++] = rmp->mpid; } } + if (rmp_set_opdown) { + cfm->remote_opup = false; + } + else if (rmp_set_opup) { + cfm->remote_opup = true; + } + if (hmap_is_empty(&cfm->remote_mps)) { cfm->fault |= CFM_FAULT_RECV; } |