Consolidate the feature flags by removing the unused features "port-up-notif", "ct-no-masked-label" nad "ovn-ct-lb-related". At the same time make sure the debug command reports all the features that are currently supported. And update the feature testing to test all features that do not depend on OvS detection.
Signed-off-by: Ales Musil <[email protected]> --- controller/chassis.c | 24 ------------------------ include/ovn/features.h | 3 --- northd/inc-proc-northd.c | 17 +++++++++++++++++ tests/ovn-controller.at | 25 +++++++++++++++++++------ tests/ovn-northd.at | 4 ++-- 5 files changed, 38 insertions(+), 35 deletions(-) diff --git a/controller/chassis.c b/controller/chassis.c index 30382803d..118e60748 100644 --- a/controller/chassis.c +++ b/controller/chassis.c @@ -408,10 +408,7 @@ chassis_build_other_config(const struct ovs_chassis_cfg *ovs_cfg, smap_replace(config, "ovn-evpn-local-ip", ovs_cfg->evpn_local_ip); smap_replace(config, "is-interconn", ovs_cfg->is_interconn ? "true" : "false"); - smap_replace(config, OVN_FEATURE_PORT_UP_NOTIF, "true"); - 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"); smap_replace(config, OVN_FEATURE_LS_DPG_COLUMN, "true"); smap_replace(config, OVN_FEATURE_CT_COMMIT_NAT_V2, "true"); @@ -538,30 +535,12 @@ chassis_other_config_changed(const struct ovs_chassis_cfg *ovs_cfg, return true; } - - if (!smap_get_bool(&chassis_rec->other_config, OVN_FEATURE_PORT_UP_NOTIF, - false)) { - return true; - } - - if (!smap_get_bool(&chassis_rec->other_config, - OVN_FEATURE_CT_NO_MASKED_LABEL, - false)) { - return true; - } - if (!smap_get_bool(&chassis_rec->other_config, OVN_FEATURE_MAC_BINDING_TIMESTAMP, false)) { return true; } - if (!smap_get_bool(&chassis_rec->other_config, - OVN_FEATURE_CT_LB_RELATED, - false)) { - return true; - } - if (!smap_get_bool(&chassis_rec->other_config, OVN_FEATURE_FDB_TIMESTAMP, false)) { @@ -763,10 +742,7 @@ update_supported_sset(struct sset *supported) /* Internal options. */ sset_add(supported, "is-vtep"); sset_add(supported, "is-remote"); - sset_add(supported, OVN_FEATURE_PORT_UP_NOTIF); - 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); sset_add(supported, OVN_FEATURE_LS_DPG_COLUMN); sset_add(supported, OVN_FEATURE_CT_COMMIT_NAT_V2); diff --git a/include/ovn/features.h b/include/ovn/features.h index df24f6c06..d5828a7e5 100644 --- a/include/ovn/features.h +++ b/include/ovn/features.h @@ -21,10 +21,7 @@ #include "smap.h" /* ovn-controller supported feature names. */ -#define OVN_FEATURE_PORT_UP_NOTIF "port-up-notif" -#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" #define OVN_FEATURE_LS_DPG_COLUMN "ls-dpg-column" #define OVN_FEATURE_CT_COMMIT_NAT_V2 "ct-commit-nat-v2" diff --git a/northd/inc-proc-northd.c b/northd/inc-proc-northd.c index bfb893a1a..e579f7787 100644 --- a/northd/inc-proc-northd.c +++ b/northd/inc-proc-northd.c @@ -629,6 +629,23 @@ chassis_features_list(struct unixctl_conn *conn, int argc OVS_UNUSED, ds_put_format(&ds, "mac_binding_timestamp: %s\n", features->mac_binding_timestamp ? "true" : "false"); + ds_put_format(&ds, "fdb_timestamp: %s\n", + features->fdb_timestamp ? "true" : "false"); + ds_put_format(&ds, "ls_dpg_column: %s\n", + features->ls_dpg_column ? "true" : "false"); + ds_put_format(&ds, "ct_commit_nat_v2: %s\n", + features->ct_commit_nat_v2 ? "true" : "false"); + ds_put_format(&ds, "ct_commit_to_zone: %s\n", + features->ct_commit_to_zone ? "true" : "false"); + ds_put_format(&ds, "sample_with_reg: %s\n", + features->sample_with_reg ? "true" : "false"); + ds_put_format(&ds, "ct_next_zone: %s\n", + features->ct_next_zone ? "true" : "false"); + ds_put_format(&ds, "ct_label_flush: %s\n", + features->ct_label_flush ? "true" : "false"); + ds_put_format(&ds, "ct_state_save: %s\n", + features->ct_state_save ? "true" : "false"); + unixctl_command_reply(conn, ds_cstr(&ds)); ds_destroy(&ds); } diff --git a/tests/ovn-controller.at b/tests/ovn-controller.at index c5d8cb5c1..17ec3c5d9 100644 --- a/tests/ovn-controller.at +++ b/tests/ovn-controller.at @@ -641,12 +641,25 @@ ovs-vsctl add-br br-phys ovn_attach n1 br-phys 192.168.0.1 # Wait for ovn-controller to register in the SB. -OVS_WAIT_UNTIL([ - test "$(ovn-sbctl get chassis hv1 other_config:port-up-notif)" = '"true"' -]) - -OVS_WAIT_UNTIL([ - test "$(ovn-sbctl get chassis hv1 other_config:ls-dpg-column)" = '"true"' +wait_row_count Chassis 1 name=hv1 other_config:mac-binding-timestamp="true" +check_row_count Chassis 1 name=hv1 other_config:fdb-timestamp="true" +check_row_count Chassis 1 name=hv1 other_config:ls-dpg-column="true" +check_row_count Chassis 1 name=hv1 other_config:ct-commit-nat-v2="true" +check_row_count Chassis 1 name=hv1 other_config:ct-commit-to-zone="true" +check_row_count Chassis 1 name=hv1 other_config:fdb-timestamp="true" +check_row_count Chassis 1 name=hv1 other_config:ct-next-zone="true" +check_row_count Chassis 1 name=hv1 other_config:ct-state-save="true" + +# Check the features reported by northd without features that are detected from ovs. +AT_CHECK([as northd ovn-appctl -t ovn-northd debug/chassis-features-list | sort | \ + grep -v "sample_with_reg" | grep -v "ct_label_flush"], [0], [dnl +ct_commit_nat_v2: true +ct_commit_to_zone: true +ct_next_zone: true +ct_state_save: true +fdb_timestamp: true +ls_dpg_column: true +mac_binding_timestamp: true ]) OVN_CLEANUP([hv1]) diff --git a/tests/ovn-northd.at b/tests/ovn-northd.at index b2b9f092c..43d29e52d 100644 --- a/tests/ovn-northd.at +++ b/tests/ovn-northd.at @@ -10517,7 +10517,7 @@ check ovn-sbctl chassis-add hv1 geneve 127.0.0.1 \ check ovn-nbctl --wait=sb sync -AT_CHECK([as northd ovn-appctl -t ovn-northd debug/chassis-features-list], [0], [dnl +AT_CHECK([as northd ovn-appctl -t ovn-northd debug/chassis-features-list | grep "mac_binding_timestamp"], [0], [dnl mac_binding_timestamp: true ]) @@ -10528,7 +10528,7 @@ check ovn-sbctl chassis-add hv2 geneve 127.0.0.2 \ check ovn-nbctl --wait=sb sync -AT_CHECK([as northd ovn-appctl -t ovn-northd debug/chassis-features-list], [0], [dnl +AT_CHECK([as northd ovn-appctl -t ovn-northd debug/chassis-features-list | grep "mac_binding_timestamp"], [0], [dnl mac_binding_timestamp: true ]) -- 2.50.1 _______________________________________________ dev mailing list [email protected] https://mail.openvswitch.org/mailman/listinfo/ovs-dev
