build_chassis_features() can only clear feature flags, but
en_global_config_run() called it without first enabling all features.
A feature disabled by a chassis therefore stayed disabled after that
chassis was deleted, since deletion triggers a full recompute.

Fixes: aed60eea33f2 ("northd:  Add I-P for NB_Global and SB_Global.")
Signed-off-by: Alexandra Rukomoinikova <[email protected]>
Assisted-by: Claude Opus 5.5
---
 northd/en-global-config.c |  7 ++++---
 tests/ovn-northd.at       | 32 ++++++++++++++++++++++++++++++++
 2 files changed, 36 insertions(+), 3 deletions(-)

diff --git a/northd/en-global-config.c b/northd/en-global-config.c
index 6dd5e0977..ecaf998b2 100644
--- a/northd/en-global-config.c
+++ b/northd/en-global-config.c
@@ -217,9 +217,10 @@ en_global_config_run(struct engine_node *node , void *data)
         nbrec_nb_global_set_options(nb, options);
     }
 
-    if (smap_get_bool(&nb->options, "ignore_chassis_features", false)) {
-        northd_enable_all_features(config_data);
-    } else {
+    /* Enable all features before calling build_chassis_features() as
+     * build_chassis_features() only sets the feature flags to false. */
+    northd_enable_all_features(config_data);
+    if (!smap_get_bool(&nb->options, "ignore_chassis_features", false)) {
         build_chassis_features(sbrec_chassis_table, &config_data->features);
     }
 
diff --git a/tests/ovn-northd.at b/tests/ovn-northd.at
index 6572b1318..431649425 100644
--- a/tests/ovn-northd.at
+++ b/tests/ovn-northd.at
@@ -11651,6 +11651,38 @@ OVN_CLEANUP_NORTHD
 AT_CLEANUP
 ])
 
+OVN_FOR_EACH_NORTHD_NO_HV([
+AT_SETUP([Chassis-feature compatibility - chassis deletion])
+ovn_start
+
+check ovn-sbctl chassis-add hv1 geneve 127.0.0.1 \
+  -- set chassis hv1 other_config:ct-state-save=true
+check ovn-nbctl --wait=sb sync
+
+AT_CHECK([as northd ovn-appctl -t ovn-northd debug/chassis-features-list | 
grep "ct_state_save"], [0], [dnl
+ct_state_save: true
+])
+
+AS_BOX([Add chassis without the feature])
+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 | 
grep "ct_state_save"], [0], [dnl
+ct_state_save: false
+])
+
+AS_BOX([Delete chassis without the feature])
+check ovn-sbctl chassis-del hv2
+check ovn-nbctl --wait=sb sync
+
+AT_CHECK([as northd ovn-appctl -t ovn-northd debug/chassis-features-list | 
grep "ct_state_save"], [0], [dnl
+ct_state_save: true
+])
+
+OVN_CLEANUP_NORTHD
+AT_CLEANUP
+])
+
 OVN_FOR_EACH_NORTHD_NO_HV([
 AT_SETUP([check OVN QoS])
 AT_KEYWORDS([OVN-QoS])
-- 
2.48.1

_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to