From: Numan Siddique <num...@ovn.org>

en_northd engine nodes provides the created or updated logical switches
in its tracked data and en_ls_stateful node handles these changes.

Signed-off-by: Numan Siddique <num...@ovn.org>
---
 northd/en-ls-stateful.c | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)

diff --git a/northd/en-ls-stateful.c b/northd/en-ls-stateful.c
index 448ccc3c4..eb86d21f0 100644
--- a/northd/en-ls-stateful.c
+++ b/northd/en-ls-stateful.c
@@ -131,12 +131,9 @@ ls_stateful_northd_handler(struct engine_node *node, void 
*data_)
         return EN_UNHANDLED;
     }
 
-    if (northd_has_lswitchs_in_tracked_data(&northd_data->trk_data)) {
-        return EN_UNHANDLED;
-    }
-
     if (!northd_has_ls_lbs_in_tracked_data(&northd_data->trk_data) &&
-        !northd_has_ls_acls_in_tracked_data(&northd_data->trk_data)) {
+        !northd_has_ls_acls_in_tracked_data(&northd_data->trk_data) &&
+        !northd_has_lswitchs_in_tracked_data(&northd_data->trk_data)) {
         return EN_HANDLED_UNCHANGED;
     }
 
@@ -145,6 +142,15 @@ ls_stateful_northd_handler(struct engine_node *node, void 
*data_)
     struct ed_type_ls_stateful *data = data_;
     struct hmapx_node *hmapx_node;
 
+    HMAPX_FOR_EACH (hmapx_node, &nd_changes->trk_switches.crupdated) {
+        const struct ovn_datapath *od = hmapx_node->data;
+
+        if (!ls_stateful_table_find_(&data->table, od->nbs)) {
+            ls_stateful_record_create(&data->table, od,
+                                      input_data.ls_port_groups);
+        }
+    }
+
     HMAPX_FOR_EACH (hmapx_node, &nd_changes->ls_with_changed_lbs) {
         const struct ovn_datapath *od = hmapx_node->data;
 
-- 
2.50.1

_______________________________________________
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to