Message ID | 20210716114540.1895900-1-numans@ovn.org |
---|---|
State | Superseded |
Delegated to: | Han Zhou |
Headers | show |
Series | pflow_output and ct_zone engine improvements. | expand |
Context | Check | Description |
---|---|---|
ovsrobot/apply-robot | success | apply and check: success |
On Fri, Jul 16, 2021 at 4:46 AM <numans@ovn.org> wrote: > > From: Numan Siddique <numans@ovn.org> > > When a container logical port's parent changes and if the parent logical > port resides in the same chassis as the old parent, ovn-controller doesn't > track that change in the 'tracked_dp_bindings'. At present this is not > an issue because pflow_output engine handles this in the port_binding > change handler. However, it is better to track this in the > runtime_data. > > Signed-off-by: Numan Siddique <numans@ovn.org> > --- > controller/binding.c | 9 +++++++++ > 1 file changed, 9 insertions(+) > > diff --git a/controller/binding.c b/controller/binding.c > index 39119c0c3..0fd951ad7 100644 > --- a/controller/binding.c > +++ b/controller/binding.c > @@ -1240,6 +1240,15 @@ consider_container_lport(const struct sbrec_port_binding *pb, > } > > struct shash *binding_lports = &b_ctx_out->lbinding_data->lports; > + struct binding_lport *b_lport = > + binding_lport_find(binding_lports, pb->logical_port); > + > + if (b_lport && b_lport->lbinding != parent_lbinding) { > + /* The container lport's parent has changed. So remove it from > + * the related_lports so that it is tracked. */ > + remove_related_lport(b_lport->pb, b_ctx_out); > + } > + > struct binding_lport *container_b_lport = > local_binding_add_lport(binding_lports, parent_lbinding, pb, > LP_CONTAINER); > -- > 2.31.1 > > _______________________________________________ > dev mailing list > dev@openvswitch.org > https://mail.openvswitch.org/mailman/listinfo/ovs-dev Thanks Numan. Acked-by: Han Zhou <hzhou@ovn.org>
diff --git a/controller/binding.c b/controller/binding.c index 39119c0c3..0fd951ad7 100644 --- a/controller/binding.c +++ b/controller/binding.c @@ -1240,6 +1240,15 @@ consider_container_lport(const struct sbrec_port_binding *pb, } struct shash *binding_lports = &b_ctx_out->lbinding_data->lports; + struct binding_lport *b_lport = + binding_lport_find(binding_lports, pb->logical_port); + + if (b_lport && b_lport->lbinding != parent_lbinding) { + /* The container lport's parent has changed. So remove it from + * the related_lports so that it is tracked. */ + remove_related_lport(b_lport->pb, b_ctx_out); + } + struct binding_lport *container_b_lport = local_binding_add_lport(binding_lports, parent_lbinding, pb, LP_CONTAINER);