diff mbox series

[ovs-dev,2/3] northd, controller: Add feature flag for the updated ct_commit_nat

Message ID 20231206101951.93483-3-amusil@redhat.com
State Changes Requested
Headers show
Series Keep track of SNAT status for ICMP need frag | 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 Dec. 6, 2023, 10:19 a.m. UTC
Add feature flag for the updated ct_commit_nat action. In case there
is an update of northd to newer version before all controllers are updated.

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(+)

Comments

Dumitru Ceara Jan. 9, 2024, 11:25 a.m. UTC | #1
On 12/6/23 11:19, Ales Musil wrote:
> Add feature flag for the updated ct_commit_nat action. In case there
> is an update of northd to newer version before all controllers are updated.
> 
> Signed-off-by: Ales Musil <amusil@redhat.com>
> ---

We don't use this new flag in this patch.  I'd prefer if patches 2/3 and
3/3 are squashed.  There's no risk of ending up with a "dangling feature
flag" if we ever revert 3/3.

Otherwise both patches 2/3 and 3/3 look OK to me.

Thanks,
Dumitru
diff mbox series

Patch

diff --git a/controller/chassis.c b/controller/chassis.c
index a6f13ccc4..ba2e57238 100644
--- a/controller/chassis.c
+++ b/controller/chassis.c
@@ -370,6 +370,7 @@  chassis_build_other_config(const struct ovs_chassis_cfg *ovs_cfg,
     smap_replace(config, OVN_FEATURE_CT_LB_RELATED, "true");
     smap_replace(config, OVN_FEATURE_FDB_TIMESTAMP, "true");
     smap_replace(config, OVN_FEATURE_LS_DPG_COLUMN, "true");
+    smap_replace(config, OVN_FEATURE_CT_COMMIT_NAT_V2, "true");
 }
 
 /*
@@ -509,6 +510,12 @@  chassis_other_config_changed(const struct ovs_chassis_cfg *ovs_cfg,
         return true;
     }
 
+    if (!smap_get_bool(&chassis_rec->other_config,
+                       OVN_FEATURE_CT_COMMIT_NAT_V2,
+                       false)) {
+        return true;
+    }
+
     return false;
 }
 
@@ -640,6 +647,7 @@  update_supported_sset(struct sset *supported)
     sset_add(supported, OVN_FEATURE_CT_LB_RELATED);
     sset_add(supported, OVN_FEATURE_FDB_TIMESTAMP);
     sset_add(supported, OVN_FEATURE_LS_DPG_COLUMN);
+    sset_add(supported, OVN_FEATURE_CT_COMMIT_NAT_V2);
 }
 
 static void
diff --git a/include/ovn/features.h b/include/ovn/features.h
index 2c47ab766..08f1d8288 100644
--- a/include/ovn/features.h
+++ b/include/ovn/features.h
@@ -27,6 +27,7 @@ 
 #define OVN_FEATURE_CT_LB_RELATED "ovn-ct-lb-related"
 #define OVN_FEATURE_FDB_TIMESTAMP "fdb-timestamp"
 #define OVN_FEATURE_LS_DPG_COLUMN "ls-dpg-column"
+#define OVN_FEATURE_CT_COMMIT_NAT_V2 "ct-commit-nat-v2"
 
 /* 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 07dffb15a..35d9b11d3 100644
--- a/northd/northd.c
+++ b/northd/northd.c
@@ -500,6 +500,15 @@  build_chassis_features(const struct sbrec_chassis_table *sbrec_chassis_table,
             chassis_features->ls_dpg_column) {
             chassis_features->ls_dpg_column = false;
         }
+
+        bool ct_commit_nat_v2 =
+                smap_get_bool(&chassis->other_config,
+                              OVN_FEATURE_CT_COMMIT_NAT_V2,
+                              false);
+        if (!ct_commit_nat_v2 &&
+            chassis_features->ct_commit_nat_v2) {
+            chassis_features->ct_commit_nat_v2 = false;
+        }
     }
 }
 
@@ -17774,6 +17783,7 @@  northd_enable_all_features(struct northd_data *data)
         .ct_lb_related = true,
         .fdb_timestamp = true,
         .ls_dpg_column = true,
+        .ct_commit_nat_v2 = true,
     };
 }
 
diff --git a/northd/northd.h b/northd/northd.h
index 5be7b5384..20010c9d9 100644
--- a/northd/northd.h
+++ b/northd/northd.h
@@ -71,6 +71,7 @@  struct chassis_features {
     bool ct_lb_related;
     bool fdb_timestamp;
     bool ls_dpg_column;
+    bool ct_commit_nat_v2;
 };
 
 /* A collection of datapaths. E.g. all logical switch datapaths, or all