aboutsummaryrefslogtreecommitdiff
path: root/vswitchd
diff options
context:
space:
mode:
authorSimon Horman <horms@verge.net.au>2012-11-19 14:59:30 +0900
committerBen Pfaff <blp@nicira.com>2012-11-19 13:04:11 -0800
commit7beaa082d7f422dda337780d6dd457b9a5ffe7d5 (patch)
tree99a63e1b074865d10922bcd82bbad1ab0816726c /vswitchd
parenteb12aa89e70848837127e10d6d0dd89be89ebaa2 (diff)
vswitchd: Configuration of allowed OpenFlow versions
Versions may be configured using the protocols column of the bridge table. The protocols column is a set which accepts zero or more of the values: 'OpenFlow10' and 'OpenFlow12'. If the protocols column 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@verge.net.au> [blp@nicira.com adjusted comments and documentation] Signed-off-by: Ben Pfaff <blp@nicira.com>
Diffstat (limited to 'vswitchd')
-rw-r--r--vswitchd/bridge.c16
-rw-r--r--vswitchd/vswitch.ovsschema8
-rw-r--r--vswitchd/vswitch.xml6
3 files changed, 27 insertions, 3 deletions
diff --git a/vswitchd/bridge.c b/vswitchd/bridge.c
index 316ecc75..d1e24d0e 100644
--- a/vswitchd/bridge.c
+++ b/vswitchd/bridge.c
@@ -36,6 +36,7 @@
#include "meta-flow.h"
#include "netdev.h"
#include "ofp-print.h"
+#include "ofp-util.h"
#include "ofpbuf.h"
#include "ofproto/ofproto.h"
#include "poll-loop.h"
@@ -814,6 +815,18 @@ bridge_configure_datapath_id(struct bridge *br)
free(dpid_string);
}
+/* Returns a bitmap of "enum ofputil_protocol"s that are allowed for use with
+ * 'br'. */
+static uint32_t
+bridge_get_allowed_versions(struct bridge *br)
+{
+ if (!br->cfg->n_protocols)
+ return 0;
+
+ return ofputil_versions_from_strings(br->cfg->protocols,
+ br->cfg->n_protocols);
+}
+
/* Set NetFlow configuration on 'br'. */
static void
bridge_configure_netflow(struct bridge *br)
@@ -2800,7 +2813,8 @@ bridge_configure_remotes(struct bridge *br,
n_ocs++;
}
- ofproto_set_controllers(br->ofproto, ocs, n_ocs, 0);
+ ofproto_set_controllers(br->ofproto, ocs, n_ocs,
+ bridge_get_allowed_versions(br));
free(ocs[0].target); /* From bridge_ofproto_controller_for_mgmt(). */
free(ocs);
diff --git a/vswitchd/vswitch.ovsschema b/vswitchd/vswitch.ovsschema
index 12344889..fd2bb4bf 100644
--- a/vswitchd/vswitch.ovsschema
+++ b/vswitchd/vswitch.ovsschema
@@ -1,6 +1,6 @@
{"name": "Open_vSwitch",
- "version": "6.11.0",
- "cksum": "3699219253 17163",
+ "version": "6.11.1",
+ "cksum": "2684374538 17324",
"tables": {
"Open_vSwitch": {
"columns": {
@@ -74,6 +74,10 @@
"type": {"key": {"type": "uuid",
"refTable": "Controller"},
"min": 0, "max": "unlimited"}},
+ "protocols": {
+ "type": {"key": {"type": "string",
+ "enum": ["set", ["OpenFlow10", "OpenFlow12"]]},
+ "min": 0, "max": "unlimited"}},
"fail_mode": {
"type": {"key": {"type": "string",
"enum": ["set", ["standalone", "secure"]]},
diff --git a/vswitchd/vswitch.xml b/vswitchd/vswitch.xml
index 602e6871..c9d0dc43 100644
--- a/vswitchd/vswitch.xml
+++ b/vswitchd/vswitch.xml
@@ -453,6 +453,12 @@
QoS configured, or if the port does not have a queue with the specified
ID, the default queue is used instead.
</column>
+
+ <column name="protocols">
+ List of OpenFlow protocols that may be used when negotiating a
+ connection with a controller. A default value of
+ <code>OpenFlow10</code> will be used if this column is empty.
+ </column>
</group>
<group title="Spanning Tree Configuration">