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

numans at ovn.org numans at ovn.org
Mon Aug 2 20:49:02 UTC 2021


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.

Acked-by: Han Zhou <hzhou at ovn.org>
Reviewed-by: Mark Michelson <mmichels at redhat.com>
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 f9b4a626d..2acbec701 100644
--- a/controller/binding.c
+++ b/controller/binding.c
@@ -1204,6 +1204,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



More information about the dev mailing list