summaryrefslogtreecommitdiff
path: root/lib/cfm.c
diff options
context:
space:
mode:
authoralex wang <alexw@nicira.com>2013-09-20 06:13:33 +0000
committerEthan Jackson <ethan@nicira.com>2013-09-19 17:46:22 -0700
commit03f209ba2737bf29391e64c4eb387648c9d71e86 (patch)
tree9753b579c17968bdd815f15624a66a606b6b7603 /lib/cfm.c
parent04a19fb8f4b8ba19a9805906aac7b30b65b57206 (diff)
downloadopenvswitch-03f209ba2737bf29391e64c4eb387648c9d71e86.tar.gz
cfm: Prevent interval fault when demand mode is enabled on one end.
This commit prevents cfm from raising 'interval' fault when demand mode is only enabled on one end of link. Signed-off-by: Alex Wang <alexw@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.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/cfm.c b/lib/cfm.c
index 4a46c0556..e1866ff5d 100644
--- a/lib/cfm.c
+++ b/lib/cfm.c
@@ -255,9 +255,13 @@ cfm_fault_interval(struct cfm *cfm) OVS_REQUIRES(mutex)
* as a fault (likely due to a configuration error). Thus we can check all
* MPs at once making this quite a bit simpler.
*
- * According to the specification we should check when (ccm_interval_ms *
- * 3.5)ms have passed. */
- return (cfm->ccm_interval_ms * 7) / 2;
+ * When cfm is not in demand mode, we check when (ccm_interval_ms * 3.5) ms
+ * have passed. When cfm is in demand mode, we check when
+ * (MAX(ccm_interval_ms, 500) * 3.5) ms have passed. This ensures that
+ * ovs-vswitchd has enough time to pull statistics from the datapath. */
+
+ return (MAX(cfm->ccm_interval_ms, cfm->demand ? 500 : cfm->ccm_interval_ms)
+ * 7) / 2;
}
static uint8_t
@@ -611,7 +615,6 @@ cfm_configure(struct cfm *cfm, const struct cfm_settings *s)
}
if (s->extended && s->demand) {
- interval_ms = MAX(interval_ms, 500);
if (!cfm->demand) {
cfm->demand = true;
cfm->rx_packets = cfm_rx_packets(cfm);