[ovs-dev] [RFC v2 ovn 4/6] ovn-controller: I-P for datapath binding

numans at ovn.org numans at ovn.org
Tue Mar 3 17:20:49 UTC 2020


From: Numan Siddique <numans at ovn.org>

This patch adds partial support of incremental processing of datapath binding.
If a datapath is deleted, then a full recompute is triggered.

Signed-off-by: Numan Siddique <numans at ovn.org>
---
 controller/ovn-controller.c | 26 +++++++++++++++++++++++++-
 1 file changed, 25 insertions(+), 1 deletion(-)

diff --git a/controller/ovn-controller.c b/controller/ovn-controller.c
index 8502b17ed..ec365dd74 100644
--- a/controller/ovn-controller.c
+++ b/controller/ovn-controller.c
@@ -1189,6 +1189,29 @@ runtime_data_sb_port_binding_handler(struct engine_node *node, void *data)
     return binding_handle_port_binding_changes(&b_ctx_in, &b_ctx_out);
 }
 
+static bool
+runtime_data_sb_datapath_binding_handler(struct engine_node *node OVS_UNUSED,
+                                         void *data OVS_UNUSED)
+{
+    struct sbrec_datapath_binding_table *dp_table =
+        (struct sbrec_datapath_binding_table *)EN_OVSDB_GET(
+            engine_get_input("SB_datapath_binding", node));
+    const struct sbrec_datapath_binding *dp;
+    struct ed_type_runtime_data *rt_data = data;
+
+    SBREC_DATAPATH_BINDING_TABLE_FOR_EACH_TRACKED (dp, dp_table) {
+        if (sbrec_datapath_binding_is_deleted(dp)) {
+            if (get_local_datapath(&rt_data->local_datapaths,
+                                   dp->tunnel_key)) {
+                return false;
+            }
+        }
+    }
+
+    engine_set_node_state(node, EN_VALID);
+    return true;
+}
+
 /* Connection tracking zones. */
 struct ed_type_ct_zones {
     unsigned long bitmap[BITMAP_N_LONGS(MAX_CT_ZONES)];
@@ -1935,7 +1958,8 @@ main(int argc, char *argv[])
     engine_add_input(&en_runtime_data, &en_ovs_qos, NULL);
 
     engine_add_input(&en_runtime_data, &en_sb_chassis, NULL);
-    engine_add_input(&en_runtime_data, &en_sb_datapath_binding, NULL);
+    engine_add_input(&en_runtime_data, &en_sb_datapath_binding,
+                     runtime_data_sb_datapath_binding_handler);
     engine_add_input(&en_runtime_data, &en_sb_port_binding,
                      runtime_data_sb_port_binding_handler);
 
-- 
2.24.1



More information about the dev mailing list