diff mbox series

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

Message ID 20200916155647.1451193-1-mark.d.gray@redhat.com
State Accepted
Headers show
Series [ovs-dev] inc-proc: Rename EN_VALID to EN_UNCHANGED | expand

Commit Message

Mark Gray Sept. 16, 2020, 3:56 p.m. UTC
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@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(-)

Comments

Dumitru Ceara Sept. 16, 2020, 7:21 p.m. UTC | #1
On 9/16/20 5:56 PM, Mark Gray wrote:
> 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@redhat.com>
> ---

Hi Mark,

This looks better indeed!

Acked-by: Dumitru Ceara <dceara@redhat.com>

Thanks,
Dumitru
Numan Siddique Sept. 21, 2020, 12:26 p.m. UTC | #2
On Thu, Sep 17, 2020 at 12:51 AM Dumitru Ceara <dceara@redhat.com> wrote:

> On 9/16/20 5:56 PM, Mark Gray wrote:
> > 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@redhat.com>
> > ---
>
> Hi Mark,
>
> This looks better indeed!
>
> Acked-by: Dumitru Ceara <dceara@redhat.com>
>

Acked-by: Numan Siddique <numans@ovn.org>

@Han Zhou <hzhou@ovn.org>  If you could take a look at this ?

Thanks
Numan


>
> Thanks,
> Dumitru
>
> _______________________________________________
> dev mailing list
> dev@openvswitch.org
> https://mail.openvswitch.org/mailman/listinfo/ovs-dev
>
>
Han Zhou Sept. 21, 2020, 5:44 p.m. UTC | #3
On Mon, Sep 21, 2020 at 5:27 AM Numan Siddique <numans@ovn.org> wrote:
>
>
>
> On Thu, Sep 17, 2020 at 12:51 AM Dumitru Ceara <dceara@redhat.com> wrote:
>>
>> On 9/16/20 5:56 PM, Mark Gray wrote:
>> > 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@redhat.com>
>> > ---
>>
>> Hi Mark,
>>
>> This looks better indeed!
>>
>> Acked-by: Dumitru Ceara <dceara@redhat.com>
>
>
> Acked-by: Numan Siddique <numans@ovn.org>
>
> @Han Zhou  If you could take a look at this ?
>
> Thanks
> Numan
>
>>
>>
>> Thanks,
>> Dumitru
>>
>> _______________________________________________
>> dev mailing list
>> dev@openvswitch.org
>> https://mail.openvswitch.org/mailman/listinfo/ovs-dev
>>

Thanks Mark for the patch and thanks Dumitru and Numan for the review. I
applied this to master.

Han
diff mbox series

Patch

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, \