On Thu, Apr 10, 2025 at 11:42 AM Dumitru Ceara <[email protected]> wrote:

> This feature flag informs ovn-northd whether all hypervisors that are
> part of the OVN cluster support the new ct_state_save() logical action.
>
> A subsequent patch will use this new action to avoid generating OpenFlow
> rules that cannot be offloaded to hardware on specific NICs.  This flag
> is needed in order to avoid minor-version upgrade issues (if
> ovn-controller is upgraded after ovn-northd).
>
> Signed-off-by: Dumitru Ceara <[email protected]>
> ---
>  controller/chassis.c      |  7 +++++++
>  include/ovn/features.h    |  1 +
>  northd/en-global-config.c | 10 ++++++++++
>  northd/en-global-config.h |  1 +
>  4 files changed, 19 insertions(+)
>
> diff --git a/controller/chassis.c b/controller/chassis.c
> index c28a26a970..7616069b72 100644
> --- a/controller/chassis.c
> +++ b/controller/chassis.c
> @@ -399,6 +399,7 @@ chassis_build_other_config(const struct
> ovs_chassis_cfg *ovs_cfg,
>      smap_replace(config, OVN_FEATURE_CT_NEXT_ZONE, "true");
>      smap_replace(config, OVN_FEATURE_CT_LABEL_FLUSH,
>                   ovs_cfg->ct_label_flush ? "true" :"false");
> +    smap_replace(config, OVN_FEATURE_CT_STATE_SAVE, "true");
>  }
>
>  /*
> @@ -572,6 +573,11 @@ chassis_other_config_changed(const struct
> ovs_chassis_cfg *ovs_cfg,
>          return true;
>      }
>
> +    if (!smap_get_bool(&chassis_rec->other_config,
> OVN_FEATURE_CT_STATE_SAVE,
> +                       false)) {
> +        return true;
> +    }
> +
>      return false;
>  }
>
> @@ -731,6 +737,7 @@ update_supported_sset(struct sset *supported)
>      sset_add(supported, OVN_FEATURE_SAMPLE_WITH_REGISTERS);
>      sset_add(supported, OVN_FEATURE_CT_NEXT_ZONE);
>      sset_add(supported, OVN_FEATURE_CT_LABEL_FLUSH);
> +    sset_add(supported, OVN_FEATURE_CT_STATE_SAVE);
>  }
>
>  static void
> diff --git a/include/ovn/features.h b/include/ovn/features.h
> index 24c72c2211..6e9c05e80b 100644
> --- a/include/ovn/features.h
> +++ b/include/ovn/features.h
> @@ -32,6 +32,7 @@
>  #define OVN_FEATURE_SAMPLE_WITH_REGISTERS "ovn-sample-with-registers"
>  #define OVN_FEATURE_CT_NEXT_ZONE "ct-next-zone"
>  #define OVN_FEATURE_CT_LABEL_FLUSH "ct-label-flush"
> +#define OVN_FEATURE_CT_STATE_SAVE "ct-state-save"
>
>  /* OVS datapath supported features.  Based on availability OVN might
> generate
>   * different types of openflows.
> diff --git a/northd/en-global-config.c b/northd/en-global-config.c
> index c103b137f6..f08c612962 100644
> --- a/northd/en-global-config.c
> +++ b/northd/en-global-config.c
> @@ -442,6 +442,7 @@ northd_enable_all_features(struct
> ed_type_global_config *data)
>          .sample_with_reg = true,
>          .ct_next_zone = true,
>          .ct_label_flush = true,
> +        .ct_state_save = true,
>      };
>  }
>
> @@ -530,6 +531,15 @@ build_chassis_features(const struct
> sbrec_chassis_table *sbrec_chassis_table,
>              chassis_features->ct_label_flush) {
>              chassis_features->ct_label_flush = false;
>          }
> +
> +        bool ct_state_save =
> +                smap_get_bool(&chassis->other_config,
> +                              OVN_FEATURE_CT_STATE_SAVE,
> +                              false);
> +        if (!ct_state_save &&
> +            chassis_features->ct_state_save) {
> +            chassis_features->ct_state_save = false;
> +        }
>      }
>  }
>
> diff --git a/northd/en-global-config.h b/northd/en-global-config.h
> index de88db18b5..1ec02cac5e 100644
> --- a/northd/en-global-config.h
> +++ b/northd/en-global-config.h
> @@ -22,6 +22,7 @@ struct chassis_features {
>      bool sample_with_reg;
>      bool ct_next_zone;
>      bool ct_label_flush;
> +    bool ct_state_save;
>  };
>
>  struct global_config_tracked_data {
> --
> 2.48.1
>
>
Looks good to me, thanks.

Acked-by: Ales Musil <[email protected]>
_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to