[ovs-dev] [PATCH] ovs-vswitchd: Add ability to disable in-band on a bridge

Justin Pettit jpettit at nicira.com
Tue Oct 19 23:45:42 UTC 2010


I forgot to indicate that this was a respin of the patch to only make changes to bridge.c.

--Justin


On Oct 19, 2010, at 4:43 PM, Justin Pettit wrote:

> 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    |   21 +++++++++++++++++++--
> vswitchd/vswitch.xml |    3 +++
> 2 files changed, 22 insertions(+), 2 deletions(-)
> 
> diff --git a/vswitchd/bridge.c b/vswitchd/bridge.c
> index 75cce3c..24c3640 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 bbe4af1..74ac277 100644
> --- a/vswitchd/vswitch.xml
> +++ b/vswitchd/vswitch.xml
> @@ -330,6 +330,9 @@
>           <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>
> -- 
> 1.7.1
> 
> 
> _______________________________________________
> dev mailing list
> dev at openvswitch.org
> http://openvswitch.org/mailman/listinfo/dev_openvswitch.org





More information about the dev mailing list