aboutsummaryrefslogtreecommitdiff
path: root/vswitchd
diff options
context:
space:
mode:
authorEthan Jackson <ethan@nicira.com>2012-03-09 18:16:20 -0800
committerEthan Jackson <ethan@nicira.com>2012-03-19 18:03:36 -0700
commit189cb9e468807f221f9db23a2fce5a721c6b137c (patch)
tree6d5f6036be10d0721b0706c5da22164eb3657283 /vswitchd
parentf486e8405a13667e63765d804dd0ef96f38228c8 (diff)
cfm: Support random VLAN tag for CCM PDUs.
CCM PDUs may take a different path through the network depending on the VLAN tag they carry. In order to exercise these paths, it may be advantageous to use a random VLAN tag. Signed-off-by: Ethan Jackson <ethan@nicira.com>
Diffstat (limited to 'vswitchd')
-rw-r--r--vswitchd/bridge.c13
-rw-r--r--vswitchd/vswitch.xml3
2 files changed, 13 insertions, 3 deletions
diff --git a/vswitchd/bridge.c b/vswitchd/bridge.c
index 5b6976a2..6449333d 100644
--- a/vswitchd/bridge.c
+++ b/vswitchd/bridge.c
@@ -3226,6 +3226,7 @@ iface_configure_cfm(struct iface *iface)
{
const struct ovsrec_interface *cfg = iface->cfg;
const char *extended_str, *opstate_str;
+ const char *cfm_ccm_vlan;
struct cfm_settings s;
if (!cfg->n_cfm_mpid) {
@@ -3236,14 +3237,22 @@ iface_configure_cfm(struct iface *iface)
s.mpid = *cfg->cfm_mpid;
s.interval = atoi(get_interface_other_config(iface->cfg, "cfm_interval",
"0"));
- s.ccm_vlan = atoi(get_interface_other_config(iface->cfg, "cfm_ccm_vlan",
- "0"));
+ cfm_ccm_vlan = get_interface_other_config(iface->cfg, "cfm_ccm_vlan", "0");
s.ccm_pcp = atoi(get_interface_other_config(iface->cfg, "cfm_ccm_pcp",
"0"));
if (s.interval <= 0) {
s.interval = 1000;
}
+ if (!strcasecmp("random", cfm_ccm_vlan)) {
+ s.ccm_vlan = CFM_RANDOM_VLAN;
+ } else {
+ s.ccm_vlan = atoi(cfm_ccm_vlan);
+ if (s.ccm_vlan == CFM_RANDOM_VLAN) {
+ s.ccm_vlan = 0;
+ }
+ }
+
extended_str = get_interface_other_config(iface->cfg, "cfm_extended",
"false");
s.extended = !strcasecmp("true", extended_str);
diff --git a/vswitchd/vswitch.xml b/vswitchd/vswitch.xml
index 3e136823..e3e2a48b 100644
--- a/vswitchd/vswitch.xml
+++ b/vswitchd/vswitch.xml
@@ -1766,7 +1766,8 @@
<column name="other_config" key="cfm_ccm_vlan"
type='{"type": "integer", "minInteger": 1, "maxInteger": 4095}'>
When set, the CFM module will apply a VLAN tag to all CCMs it generates
- with the given value.
+ with the given value. May be the string <code>random</code> in which
+ case each CCM will be tagged with a different randomly generated VLAN.
</column>
<column name="other_config" key="cfm_ccm_pcp"