[ovs-dev] [PATCH ovn] inc-proc: Rename EN_VALID to EN_UNCHANGED

Mark Gray mark.d.gray at redhat.com
Wed Sep 16 15:56:47 UTC 2020


EN_VALID does not reflect the meaning of this state. For
example, EN_UPDATED is also "valid".

Signed-off-by: Mark Gray <mark.d.gray at redhat.com>
---
 controller/ovn-controller.c |  8 ++++----
 lib/inc-proc-eng.c          | 12 ++++++------
 lib/inc-proc-eng.h          |  4 ++--
 3 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/controller/ovn-controller.c b/controller/ovn-controller.c
index 8d8c678e5..066e31f62 100644
--- a/controller/ovn-controller.c
+++ b/controller/ovn-controller.c
@@ -849,7 +849,7 @@ en_ofctrl_is_connected_run(struct engine_node *node, void *data)
         engine_set_node_state(node, EN_UPDATED);
         return;
     }
-    engine_set_node_state(node, EN_VALID);
+    engine_set_node_state(node, EN_UNCHANGED);
 }
 
 struct ed_type_addr_sets {
@@ -925,7 +925,7 @@ addr_sets_sb_address_set_handler(struct engine_node *node, void *data)
             !sset_is_empty(&as->updated)) {
         engine_set_node_state(node, EN_UPDATED);
     } else {
-        engine_set_node_state(node, EN_VALID);
+        engine_set_node_state(node, EN_UNCHANGED);
     }
 
     as->change_tracked = true;
@@ -1005,7 +1005,7 @@ port_groups_sb_port_group_handler(struct engine_node *node, void *data)
             !sset_is_empty(&pg->updated)) {
         engine_set_node_state(node, EN_UPDATED);
     } else {
-        engine_set_node_state(node, EN_VALID);
+        engine_set_node_state(node, EN_UNCHANGED);
     }
 
     pg->change_tracked = true;
@@ -1468,7 +1468,7 @@ en_mff_ovn_geneve_run(struct engine_node *node, void *data)
         engine_set_node_state(node, EN_UPDATED);
         return;
     }
-    engine_set_node_state(node, EN_VALID);
+    engine_set_node_state(node, EN_UNCHANGED);
 }
 
 /* Engine node en_physical_flow_changes indicates whether
diff --git a/lib/inc-proc-eng.c b/lib/inc-proc-eng.c
index 8b56cbaec..916dbbe39 100644
--- a/lib/inc-proc-eng.c
+++ b/lib/inc-proc-eng.c
@@ -38,10 +38,10 @@ static struct engine_node **engine_nodes;
 static size_t engine_n_nodes;
 
 static const char *engine_node_state_name[EN_STATE_MAX] = {
-    [EN_STALE]   = "Stale",
-    [EN_UPDATED] = "Updated",
-    [EN_VALID]   = "Valid",
-    [EN_ABORTED] = "Aborted",
+    [EN_STALE]     = "Stale",
+    [EN_UPDATED]   = "Updated",
+    [EN_UNCHANGED] = "Unchanged",
+    [EN_ABORTED]   = "Aborted",
 };
 
 void
@@ -210,7 +210,7 @@ engine_set_node_state_at(struct engine_node *node,
 static bool
 engine_node_valid(struct engine_node *node)
 {
-    if (node->state == EN_UPDATED || node->state == EN_VALID) {
+    if (node->state == EN_UPDATED || node->state == EN_UNCHANGED) {
         return true;
     }
 
@@ -358,7 +358,7 @@ engine_run_node(struct engine_node *node, bool recompute_allowed)
      * still valid.
      */
     if (!engine_node_changed(node)) {
-        engine_set_node_state(node, EN_VALID);
+        engine_set_node_state(node, EN_UNCHANGED);
     }
 }
 
diff --git a/lib/inc-proc-eng.h b/lib/inc-proc-eng.h
index 80de75029..857234677 100644
--- a/lib/inc-proc-eng.h
+++ b/lib/inc-proc-eng.h
@@ -98,7 +98,7 @@ enum engine_node_state {
     EN_UPDATED,   /* Data in the node is valid but was updated during the
                    * last run.
                    */
-    EN_VALID,     /* Data in the node is valid and didn't change during the
+    EN_UNCHANGED, /* Data in the node is valid and didn't change during the
                    * last run.
                    */
     EN_ABORTED,   /* During the last run, processing was aborted for
@@ -314,7 +314,7 @@ en_##DB_NAME##_##TBL_NAME##_run(struct engine_node *node, \
         engine_set_node_state(node, EN_UPDATED); \
         return; \
     } \
-    engine_set_node_state(node, EN_VALID); \
+    engine_set_node_state(node, EN_UNCHANGED); \
 } \
 static void *en_##DB_NAME##_##TBL_NAME##_init( \
     struct engine_node *node OVS_UNUSED, \
-- 
2.26.2



More information about the dev mailing list