[ovs-dev] [PATCH] bridge: Remove unwanted ports at time of ofproto creation.

Ethan Jackson ethan at nicira.com
Mon Mar 5 21:03:45 UTC 2012


Looks good, thanks.

Ethan

On Fri, Mar 2, 2012 at 13:26, Ben Pfaff <blp at nicira.com> wrote:
> The reconfiguration code only deleted unwanted ports for bridges that had
> been created in previous (re)configurations.  In fact, we should run this
> step even for bridges that are newly added, e.g. to delete ports that
> were added by a previous run of ovs-vswitchd and deleted from the database
> between runs.
>
> Before this commit, the following left "int" in datapath br0.  After this
> commit, "int" is properly deleted:
>
> 1. With ovs-vswitchd running:
>      # ovs-vsctl add-br br0
>      # ovs-vsctl add-port br0 int -- set interface int type=internal
> 2. Kill ovs-vswitchd, then:
>      # ovs-vsctl --no-wait -- del-port br0 int
> 3. Restart ovs-vswitchd.
>
> Bug #9957.
> Reported-by: Hiroshi Tanaka <htanaka at nicira.com>
> Signed-off-by: Ben Pfaff <blp at nicira.com>
> ---
>  AUTHORS           |    1 +
>  vswitchd/bridge.c |    8 ++++++--
>  2 files changed, 7 insertions(+), 2 deletions(-)
>
> diff --git a/AUTHORS b/AUTHORS
> index 6a83514..1f44c36 100644
> --- a/AUTHORS
> +++ b/AUTHORS
> @@ -92,6 +92,7 @@ Gregor Schaffrath       grsch at net.t-labs.tu-berlin.de
>  Hassan Khan             hassan.khan at seecs.edu.pk
>  Hector Oron             hector.oron at gmail.com
>  Henrik Amren            henrik at nicira.com
> +Hiroshi Tanaka          htanaka at nicira.com
>  Jacob Cherkas           jcherkas at nicira.com
>  Jad Naous               jnaous at gmail.com
>  Jamal Hadi Salim        hadi at cyberus.ca
> diff --git a/vswitchd/bridge.c b/vswitchd/bridge.c
> index 6293dad..7c3e4ba 100644
> --- a/vswitchd/bridge.c
> +++ b/vswitchd/bridge.c
> @@ -438,8 +438,12 @@ bridge_reconfigure(const struct ovsrec_open_vswitch *ovs_cfg)
>      * has at least one iface, every "struct iface" has a valid ofp_port and
>      * netdev. */
>     HMAP_FOR_EACH_SAFE (br, next, node, &all_bridges) {
> -        if (!br->ofproto && !bridge_add_ofprotos(br)) {
> -            bridge_destroy(br);
> +        if (!br->ofproto) {
> +            if (bridge_add_ofprotos(br)) {
> +                bridge_del_ofproto_ports(br);
> +            } else {
> +                bridge_destroy(br);
> +            }
>         }
>     }
>     HMAP_FOR_EACH (br, node, &all_bridges) {
> --
> 1.7.2.5
>
> _______________________________________________
> dev mailing list
> dev at openvswitch.org
> http://openvswitch.org/mailman/listinfo/dev



More information about the dev mailing list