[ovs-dev] [PATCH 11/18] vswitchd: Configuration of allowed OpenFlow versions

Simon Horman horms at verge.net.au
Thu Oct 18 05:58:11 UTC 2012


Versions may be configured using a comma delimited list as
the value for 'openflow-versions' the 'other-config' column
of the Bridge table.

Currently list elements other than 'OpenFlow10' and 'OpenFlow12' will
be ignored.

If the list is empty, then OpenFlow10 is used.
This default is consistent with the behaviour of ovs-vswtichd
prior to this patch.

Signed-off-by: Simon Horman <horms at verge.net.au>
---
 vswitchd/bridge.c |   18 +++++++++++++++++-
 1 file changed, 17 insertions(+), 1 deletion(-)

diff --git a/vswitchd/bridge.c b/vswitchd/bridge.c
index f405872..3899f47 100644
--- a/vswitchd/bridge.c
+++ b/vswitchd/bridge.c
@@ -768,6 +768,22 @@ bridge_configure_datapath_id(struct bridge *br)
     free(dpid_string);
 }
 
+/* Pick local port hardware address and datapath ID for 'br'. */
+static void
+bridge_get_allowed_versions(struct bridge *br,
+                            struct ofputil_version_bitmap *allowed_versions)
+{
+    const char *config_str = smap_get(&br->cfg->other_config, "openflow-versions");
+    if (config_str) {
+        ofputil_versions_from_string(config_str, allowed_versions);
+        ofputil_version_bitmap_and(ofputil_get_supported_versions(),
+                                   allowed_versions);
+    } else {
+        ofputil_version_bitmap_clone_data(ofputil_get_allowed_versions_default(),
+                                          allowed_versions);
+    }
+}
+
 /* Set NetFlow configuration on 'br'. */
 static void
 bridge_configure_netflow(struct bridge *br)
@@ -2665,7 +2681,7 @@ bridge_configure_remotes(struct bridge *br,
     struct ofputil_version_bitmap allowed_versions =
         OFPUTIL_VERSION_BITMAP_INITIALIZER;
 
-    ofputil_version_bitmap_set1(&allowed_versions, OFP10_VERSION);
+    bridge_get_allowed_versions(br, &allowed_versions);
 
     /* Check if we should disable in-band control on this bridge. */
     disable_in_band = smap_get_bool(&br->cfg->other_config, "disable-in-band",
-- 
1.7.10.4




More information about the dev mailing list