diff mbox series

[ovs-dev,v4,03/14] northd: Read ic-vxlan_mode as a boolean value, not key presence.

Message ID 20260902211744.2159261-4-guilherme.paulo@magalu.cloud
State New
Headers show
Series ic: Incremental processing for ovn-ic. | 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

Paulo Guilherme Silva Sept. 2, 2026, 9:17 p.m. UTC
en-global-config.c decided IC VXLAN mode (and therefore the datapath
tunnel-id range) using smap_get(), which is true whenever the key EXISTS.
ovn-ic stamps other_config:ic-vxlan_mode on every transit switch,
including the literal value "false".  As a result northd treated plain
Geneve deployments as VXLAN-IC and capped max_dp_tunnel_id at
OVN_MAX_DP_VXLAN_KEY_LOCAL (1023); past ~1023 local datapaths northd
fails datapath tunnel-id allocation and the SB never converges.

Read the boolean value with smap_get_bool() instead.

Fixes: 059763e8683d ("ic: Fix vxlan encap mode.")
Assisted-by: Claude Opus 4.8, Claude Code
Signed-off-by: Paulo Guilherme Silva <guilherme.paulo@magalu.cloud>
---
 northd/en-global-config.c |  4 ++--
 tests/ovn-northd.at       | 18 ++++++++++++++++++
 2 files changed, 20 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/northd/en-global-config.c b/northd/en-global-config.c
index 4e6b07ebe..f31e7d3f2 100644
--- a/northd/en-global-config.c
+++ b/northd/en-global-config.c
@@ -187,7 +187,7 @@  en_global_config_run(struct engine_node *node , void *data)
     bool ic_vxlan_mode = false;
     const struct nbrec_logical_switch *nbs;
     NBREC_LOGICAL_SWITCH_TABLE_FOR_EACH (nbs, nbrec_ls_table) {
-        if (smap_get(&nbs->other_config, "ic-vxlan_mode")) {
+        if (smap_get_bool(&nbs->other_config, "ic-vxlan_mode", false)) {
             ic_vxlan_mode = true;
             break;
         }
@@ -478,7 +478,7 @@  global_config_nb_logical_switch_handler(struct engine_node *node,
     bool ic_vxlan_mode = false;
     const struct nbrec_logical_switch *nbs;
     NBREC_LOGICAL_SWITCH_TABLE_FOR_EACH (nbs, nbrec_ls_table) {
-        if (smap_get(&nbs->other_config, "ic-vxlan_mode")) {
+        if (smap_get_bool(&nbs->other_config, "ic-vxlan_mode", false)) {
             ic_vxlan_mode = true;
             break;
         }
diff --git a/tests/ovn-northd.at b/tests/ovn-northd.at
index 1e567704d..48dac8512 100644
--- a/tests/ovn-northd.at
+++ b/tests/ovn-northd.at
@@ -3392,6 +3392,24 @@  check ovn-nbctl --wait=sb set logical-switch LS other-config:interconn-ts=LS
 check ovn-nbctl --wait=sb set logical-switch LS other-config:ic-vxlan_mode=true
 AT_CHECK([test "$(get_max_tunid)" -eq 1023])
 
+dnl ovn-ic stamps ic-vxlan_mode on every transit switch, including with the
+dnl value "false".  Only a true value must restrict the tunnel key range.
+check ovn-nbctl --wait=sb set logical-switch LS other-config:ic-vxlan_mode=false
+AT_CHECK([test "$(get_max_tunid)" -eq 4095])
+
+dnl Anything that is not a boolean true is treated as false.
+check ovn-nbctl --wait=sb set logical-switch LS other-config:ic-vxlan_mode=foo
+AT_CHECK([test "$(get_max_tunid)" -eq 4095])
+
+dnl The same must hold on a full recompute, not only on the incremental path.
+check ovn-appctl -t northd/ovn-northd inc-engine/recompute
+check ovn-nbctl --wait=sb sync
+AT_CHECK([test "$(get_max_tunid)" -eq 4095])
+
+dnl Setting it back to true restricts the range again.
+check ovn-nbctl --wait=sb set logical-switch LS other-config:ic-vxlan_mode=true
+AT_CHECK([test "$(get_max_tunid)" -eq 1023])
+
 check ovn-nbctl --wait=sb clear logical-switch LS other-config
 AT_CHECK([test "$(get_max_tunid)" -eq 4095])