[ovs-dev] [PATCH ovn v2 3/5] binding: Track the changes of container lport when it's parent changes.

Han Zhou hzhou at ovn.org
Tue Jul 27 02:35:49 UTC 2021


On Fri, Jul 16, 2021 at 4:46 AM <numans at ovn.org> wrote:
>
> From: Numan Siddique <numans at 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 at 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 at openvswitch.org
> https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Thanks Numan.

Acked-by: Han Zhou <hzhou at ovn.org>


More information about the dev mailing list