diff mbox series

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

Message ID 20210713215618.249218-1-numans@ovn.org
State Superseded
Headers show
Series pflow_output and ct_zone engine improvements. | expand

Commit Message

Numan Siddique July 13, 2021, 9:56 p.m. UTC
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 mbox series

Patch

diff --git a/controller/binding.c b/controller/binding.c
index 585f0271e..395450c3e 100644
--- a/controller/binding.c
+++ b/controller/binding.c
@@ -1228,6 +1228,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);