From: Justin Pettit Date: Tue, 19 Oct 2010 22:58:35 +0000 (-0700) Subject: ovs-vswitchd: Add ability to disable in-band on a bridge X-Git-Tag: v1.1.0~992 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=8731b2b688b34e02c9357ce6755c5acadfe613e9;p=sliver-openvswitch.git ovs-vswitchd: Add ability to disable in-band on a bridge In-band control is always enabled when a manager is configured. Some applications wish to control all the flows within a bridge, and in-band control can override that wish. Depending on how the network is configured, this can lead to loops as the in-band control rules try to learn where to send traffic. This commit adds a "disable-in-band" key to the "other_config" column of bridge tables. If set to "true", in-band will be disabled regardless of manager or controller configuration. --- diff --git a/vswitchd/bridge.c b/vswitchd/bridge.c index 75cce3c8d..24c36405c 100644 --- a/vswitchd/bridge.c +++ b/vswitchd/bridge.c @@ -1702,12 +1702,25 @@ bridge_reconfigure_remotes(struct bridge *br, struct ovsrec_controller **controllers; size_t n_controllers; bool had_primary; + const char *disable_ib_str; + bool disable_in_band = false; struct ofproto_controller *ocs; size_t n_ocs; size_t i; - ofproto_set_extra_in_band_remotes(br->ofproto, managers, n_managers); + + /* Check if we should disable in-band control on this bridge. */ + disable_ib_str = bridge_get_other_config(br->cfg, "disable-in-band"); + if (disable_ib_str && !strcmp(disable_ib_str, "true")) { + disable_in_band = true; + } + + if (disable_in_band) { + ofproto_set_extra_in_band_remotes(br->ofproto, NULL, 0); + } else { + ofproto_set_extra_in_band_remotes(br->ofproto, managers, n_managers); + } had_primary = ofproto_has_primary_controller(br->ofproto); n_controllers = bridge_get_controllers(br, &controllers); @@ -1732,7 +1745,11 @@ bridge_reconfigure_remotes(struct bridge *br, } bridge_configure_local_iface_netdev(br, c); - bridge_ofproto_controller_from_ovsrec(c, &ocs[n_ocs++]); + bridge_ofproto_controller_from_ovsrec(c, &ocs[n_ocs]); + if (disable_in_band) { + ocs[n_ocs].band = OFPROTO_OUT_OF_BAND; + } + n_ocs++; } ofproto_set_controllers(br->ofproto, ocs, n_ocs); diff --git a/vswitchd/vswitch.xml b/vswitchd/vswitch.xml index bbe4af151..74ac27797 100644 --- a/vswitchd/vswitch.xml +++ b/vswitchd/vswitch.xml @@ -330,6 +330,9 @@
Exactly 16 hex digits to set the OpenFlow datapath ID to a specific value.
+
disable-in-band
+
If set to true, disable in-band control on + the bridge regardless of controller and manager settings.
hwaddr
An Ethernet address in the form xx:xx:xx:xx:xx:xx