ovs-vswitchd: Add ability to disable in-band on a bridge
authorJustin Pettit <jpettit@nicira.com>
Tue, 19 Oct 2010 22:58:35 +0000 (15:58 -0700)
committerJustin Pettit <jpettit@nicira.com>
Tue, 19 Oct 2010 23:39:48 +0000 (16:39 -0700)
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.

vswitchd/bridge.c
vswitchd/vswitch.xml

index 75cce3c8da315f1889e4bf641d6222b5051500a1..24c36405c051499fd34a77f13e53305d9d4b00e3 100644 (file)
@@ -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);
index bbe4af151e304a592453f32fdc3827f0ce8bc991..74ac27797eacc859c591a077920667ef3dc24942 100644 (file)
           <dd>Exactly 16 hex
             digits to set the OpenFlow datapath ID to a specific
             value.</dd>
+          <dt><code>disable-in-band</code></dt>
+          <dd>If set to <code>true</code>, disable in-band control on 
+            the bridge regardless of controller and manager settings.</dd>
           <dt><code>hwaddr</code></dt>
           <dd>An Ethernet address in the form
             <var>xx</var>:<var>xx</var>:<var>xx</var>:<var>xx</var>:<var>xx</var>:<var>xx</var>