Re: [ovs-dev] [PATCH] ovn-controller: Remove old values from local_ids.

2016-07-28 Thread Russell Bryant
On Thu, Jul 28, 2016 at 6:13 PM, Ryan Moats <rmo...@us.ibm.com> wrote:

> "dev" <dev-boun...@openvswitch.org> wrote on 07/28/2016 04:22:41 PM:
>
> > From: Russell Bryant <russ...@ovn.org>
> > To: dev@openvswitch.org
> > Date: 07/28/2016 04:23 PM
> > Subject: [ovs-dev] [PATCH] ovn-controller: Remove old values from
> local_ids.
> > Sent by: "dev" <dev-boun...@openvswitch.org>
> >
> > local_ids is supposed to be the set of interface iface-id values from
> > this chassis that correspond to OVN logical ports.  We use this for
> > detecting when an interface has been removed as well as if child-ports
> > should be bound to this chassis.
> >
> > Old values were not being removed from local_ids.  The most immediate
> > effect of this was that once an interface has been removed from a
> > chassis, we would think a removal has occured *every* time through
> > binding_run and trigger the full binding processing.  This was
> > a performance problem.
> >
> > The second problem this would cause is if a port that had child ports
> > was moved to another chassis.  We would end up with two chassis fighting
> > over the binding of the child ports.
> >
> > Signed-off-by: Russell Bryant <russ...@ovn.org>
> > ---
> >  ovn/controller/binding.c | 5 +
> >  1 file changed, 5 insertions(+)
> >
> > diff --git a/ovn/controller/binding.c b/ovn/controller/binding.c
> > index 78ebec4..41165bc 100644
> > --- a/ovn/controller/binding.c
> > +++ b/ovn/controller/binding.c
> > @@ -103,6 +103,11 @@ get_local_iface_ids(const struct ovsrec_bridge
> *br_int,
> >   * that has been removed. */
> >  if (!changed && !sset_is_empty(_local_ids)) {
> >  changed = true;
> > +
> > +const char *cur_id;
> > +SSET_FOR_EACH(cur_id, _local_ids) {
> > +sset_find_and_delete(_ids, cur_id);
> > +}
> >  }
> >
> >  sset_destroy(_local_ids);
> > --
> > 2.7.4
> >
> > ___
> > dev mailing list
> > dev@openvswitch.org
> > http://openvswitch.org/mailman/listinfo/dev
>
> lgtm...
>
> Acked-by: Ryan Moats <rmo...@us.ibm.com>
>
> Thanks, I applied this to master.

-- 
Russell Bryant
___
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev


Re: [ovs-dev] [PATCH] ovn-controller: Remove old values from local_ids.

2016-07-28 Thread Ryan Moats
"dev" <dev-boun...@openvswitch.org> wrote on 07/28/2016 04:22:41 PM:

> From: Russell Bryant <russ...@ovn.org>
> To: dev@openvswitch.org
> Date: 07/28/2016 04:23 PM
> Subject: [ovs-dev] [PATCH] ovn-controller: Remove old values from
local_ids.
> Sent by: "dev" <dev-boun...@openvswitch.org>
>
> local_ids is supposed to be the set of interface iface-id values from
> this chassis that correspond to OVN logical ports.  We use this for
> detecting when an interface has been removed as well as if child-ports
> should be bound to this chassis.
>
> Old values were not being removed from local_ids.  The most immediate
> effect of this was that once an interface has been removed from a
> chassis, we would think a removal has occured *every* time through
> binding_run and trigger the full binding processing.  This was
> a performance problem.
>
> The second problem this would cause is if a port that had child ports
> was moved to another chassis.  We would end up with two chassis fighting
> over the binding of the child ports.
>
> Signed-off-by: Russell Bryant <russ...@ovn.org>
> ---
>  ovn/controller/binding.c | 5 +
>  1 file changed, 5 insertions(+)
>
> diff --git a/ovn/controller/binding.c b/ovn/controller/binding.c
> index 78ebec4..41165bc 100644
> --- a/ovn/controller/binding.c
> +++ b/ovn/controller/binding.c
> @@ -103,6 +103,11 @@ get_local_iface_ids(const struct ovsrec_bridge
*br_int,
>   * that has been removed. */
>  if (!changed && !sset_is_empty(_local_ids)) {
>  changed = true;
> +
> +const char *cur_id;
> +SSET_FOR_EACH(cur_id, _local_ids) {
> +sset_find_and_delete(_ids, cur_id);
> +}
>  }
>
>  sset_destroy(_local_ids);
> --
> 2.7.4
>
> ___
> dev mailing list
> dev@openvswitch.org
> http://openvswitch.org/mailman/listinfo/dev

lgtm...

Acked-by: Ryan Moats <rmo...@us.ibm.com>
___
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev


[ovs-dev] [PATCH] ovn-controller: Remove old values from local_ids.

2016-07-28 Thread Russell Bryant
local_ids is supposed to be the set of interface iface-id values from
this chassis that correspond to OVN logical ports.  We use this for
detecting when an interface has been removed as well as if child-ports
should be bound to this chassis.

Old values were not being removed from local_ids.  The most immediate
effect of this was that once an interface has been removed from a
chassis, we would think a removal has occured *every* time through
binding_run and trigger the full binding processing.  This was
a performance problem.

The second problem this would cause is if a port that had child ports
was moved to another chassis.  We would end up with two chassis fighting
over the binding of the child ports.

Signed-off-by: Russell Bryant 
---
 ovn/controller/binding.c | 5 +
 1 file changed, 5 insertions(+)

diff --git a/ovn/controller/binding.c b/ovn/controller/binding.c
index 78ebec4..41165bc 100644
--- a/ovn/controller/binding.c
+++ b/ovn/controller/binding.c
@@ -103,6 +103,11 @@ get_local_iface_ids(const struct ovsrec_bridge *br_int,
  * that has been removed. */
 if (!changed && !sset_is_empty(_local_ids)) {
 changed = true;
+
+const char *cur_id;
+SSET_FOR_EACH(cur_id, _local_ids) {
+sset_find_and_delete(_ids, cur_id);
+}
 }
 
 sset_destroy(_local_ids);
-- 
2.7.4

___
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev