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 <[email protected]> --- controller/chassis.c | 8 ++++++++ include/ovn/features.h | 1 + northd/northd.c | 10 ++++++++++ northd/northd.h | 1 + 4 files changed, 20 insertions(+) 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 -- 2.43.0 _______________________________________________ dev mailing list [email protected] https://mail.openvswitch.org/mailman/listinfo/ovs-dev
