diff mbox series

[ovs-dev,4/5] northd, controller: Add FDB timestamp feature indication

Message ID 20230518113248.71715-5-amusil@redhat.com
State Superseded
Headers show
Series Add FDB aging mechanism | expand

Checks

Context Check Description
ovsrobot/apply-robot success apply and check: success
ovsrobot/github-robot-_Build_and_Test success github build: passed
ovsrobot/github-robot-_ovn-kubernetes success github build: passed

Commit Message

Ales Musil May 18, 2023, 11:32 a.m. UTC
Add feature indication to every chassis about FDB
timestamp support. In case the northd and SB DB is
updated before ovn-controller, which would trigger
aging loop as the new row would be added with timestamp
being 0. That would trigger constant aging mechanism.

Signed-off-by: Ales Musil <amusil@redhat.com>
---
 controller/chassis.c   |  8 ++++++++
 include/ovn/features.h |  1 +
 northd/northd.c        | 10 ++++++++++
 northd/northd.h        |  1 +
 4 files changed, 20 insertions(+)
diff mbox series

Patch

diff --git a/controller/chassis.c b/controller/chassis.c
index ed1f509c4..ce88541ba 100644
--- a/controller/chassis.c
+++ b/controller/chassis.c
@@ -368,6 +368,7 @@  chassis_build_other_config(const struct ovs_chassis_cfg *ovs_cfg,
     smap_replace(config, OVN_FEATURE_CT_NO_MASKED_LABEL, "true");
     smap_replace(config, OVN_FEATURE_MAC_BINDING_TIMESTAMP, "true");
     smap_replace(config, OVN_FEATURE_CT_LB_RELATED, "true");
+    smap_replace(config, OVN_FEATURE_FDB_TIMESTAMP, "true");
 }
 
 /*
@@ -495,6 +496,12 @@  chassis_other_config_changed(const struct ovs_chassis_cfg *ovs_cfg,
         return true;
     }
 
+    if (!smap_get_bool(&chassis_rec->other_config,
+                       OVN_FEATURE_FDB_TIMESTAMP,
+                       false)) {
+        return true;
+    }
+
     return false;
 }
 
@@ -624,6 +631,7 @@  update_supported_sset(struct sset *supported)
     sset_add(supported, OVN_FEATURE_CT_NO_MASKED_LABEL);
     sset_add(supported, OVN_FEATURE_MAC_BINDING_TIMESTAMP);
     sset_add(supported, OVN_FEATURE_CT_LB_RELATED);
+    sset_add(supported, OVN_FEATURE_FDB_TIMESTAMP);
 }
 
 static void
diff --git a/include/ovn/features.h b/include/ovn/features.h
index a37daa4c8..de8f1f548 100644
--- a/include/ovn/features.h
+++ b/include/ovn/features.h
@@ -25,6 +25,7 @@ 
 #define OVN_FEATURE_CT_NO_MASKED_LABEL "ct-no-masked-label"
 #define OVN_FEATURE_MAC_BINDING_TIMESTAMP "mac-binding-timestamp"
 #define OVN_FEATURE_CT_LB_RELATED "ovn-ct-lb-related"
+#define OVN_FEATURE_FDB_TIMESTAMP "fdb-timestamp"
 
 /* OVS datapath supported features.  Based on availability OVN might generate
  * different types of openflows.
diff --git a/northd/northd.c b/northd/northd.c
index 7190cd18f..506776b72 100644
--- a/northd/northd.c
+++ b/northd/northd.c
@@ -467,6 +467,15 @@  build_chassis_features(const struct sbrec_chassis_table *sbrec_chassis_table,
             chassis_features->ct_lb_related) {
             chassis_features->ct_lb_related = false;
         }
+
+        bool fdb_timestamp =
+            smap_get_bool(&chassis->other_config,
+                          OVN_FEATURE_FDB_TIMESTAMP,
+                          false);
+        if (!fdb_timestamp &&
+            chassis_features->fdb_timestamp) {
+            chassis_features->fdb_timestamp = false;
+        }
     }
 }
 
@@ -16444,6 +16453,7 @@  northd_init(struct northd_data *data)
         .ct_no_masked_label = true,
         .mac_binding_timestamp = true,
         .ct_lb_related = true,
+        .fdb_timestamp = true,
     };
     data->ovn_internal_version_changed = false;
 }
diff --git a/northd/northd.h b/northd/northd.h
index a503f4a66..47f07e657 100644
--- a/northd/northd.h
+++ b/northd/northd.h
@@ -71,6 +71,7 @@  struct chassis_features {
     bool ct_no_masked_label;
     bool mac_binding_timestamp;
     bool ct_lb_related;
+    bool fdb_timestamp;
 };
 
 /* A collection of datapaths. E.g. all logical switch datapaths, or all