[ovs-dev] [PATCH 10/14] in-band: Drop in-band flows when turning off in-band control.

Justin Pettit jpettit at nicira.com
Thu Apr 15 22:52:39 UTC 2010


Seems reasonable to me.

--Justin


On Apr 8, 2010, at 5:07 PM, Ben Pfaff wrote:

> Destroying the in-band control object didn't remove the flows related to
> in-band control, so they could persist until another event caused the
> flow table to be reset.  Changing or removing the controller is one such
> event, which would probably happen at the same time as turning off in-band
> control, so this is a rather minor flaw, but it still seems good to fix it.
> ---
> ofproto/in-band.c |    6 ++++++
> ofproto/ofproto.c |    4 ++--
> 2 files changed, 8 insertions(+), 2 deletions(-)
> 
> diff --git a/ofproto/in-band.c b/ofproto/in-band.c
> index 1f9d422..4f416c3 100644
> --- a/ofproto/in-band.c
> +++ b/ofproto/in-band.c
> @@ -645,6 +645,12 @@ void
> in_band_destroy(struct in_band *in_band)
> {
>     if (in_band) {
> +        int i;
> +
> +        for (i = 0; i < N_IB_RULES; i++) {
> +            drop_flow(in_band, i);
> +        }
> +
>         switch_status_unregister(in_band->ss_cat);
>         netdev_close(in_band->local_netdev);
>         netdev_close(in_band->remote_netdev);
> diff --git a/ofproto/ofproto.c b/ofproto/ofproto.c
> index a480a27..e38bd2e 100644
> --- a/ofproto/ofproto.c
> +++ b/ofproto/ofproto.c
> @@ -717,8 +717,9 @@ ofproto_destroy(struct ofproto *p)
>         return;
>     }
> 
> -    /* Destroy fail-open early, because it touches the classifier. */
> +    /* Destroy fail-open and in-band early, since they touch the classifier. */
>     ofproto_set_failure(p, false);
> +    ofproto_set_in_band(p, false);
> 
>     ofproto_flush_flows(p);
>     classifier_destroy(&p->cls);
> @@ -736,7 +737,6 @@ ofproto_destroy(struct ofproto *p)
>     shash_destroy(&p->port_by_name);
> 
>     switch_status_destroy(p->switch_status);
> -    in_band_destroy(p->in_band);
>     discovery_destroy(p->discovery);
>     pinsched_destroy(p->miss_sched);
>     pinsched_destroy(p->action_sched);
> -- 
> 1.6.6.1
> 
> 
> _______________________________________________
> dev mailing list
> dev at openvswitch.org
> http://openvswitch.org/mailman/listinfo/dev_openvswitch.org





More information about the dev mailing list