summaryrefslogtreecommitdiff
path: root/src/conf_mode
diff options
context:
space:
mode:
authorNataliia Solomko <natalirs1985@gmail.com>2026-06-03 12:50:07 +0300
committerNataliia Solomko <natalirs1985@gmail.com>2026-06-05 11:25:25 +0300
commit5b654e5b2847cb87e7ac0366fbd4954673be1943 (patch)
tree724fa206eb9a178658fc09a49cfa122403b6c908 /src/conf_mode
parente6f189da269ca50cfe322daaa79ae0493119cf33 (diff)
downloadvyos-1x-5b654e5b2847cb87e7ac0366fbd4954673be1943.tar.gz
vyos-1x-5b654e5b2847cb87e7ac0366fbd4954673be1943.zip
vpp: T8913: Skip bond teardown for non-structural config changes
VPP bond teardown was triggered on every commit regardless of what changed, dropping all subinterfaces and BGP sessions even for trivial changes like descriptions or IP addresses. Only mode, hash-policy and mac_address require full recreation since VPP has no in-place update API for these; all other changes are now applied incrementally.
Diffstat (limited to 'src/conf_mode')
-rw-r--r--src/conf_mode/vpp_interfaces_bonding.py13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/conf_mode/vpp_interfaces_bonding.py b/src/conf_mode/vpp_interfaces_bonding.py
index c7fd43bb4..932287a03 100644
--- a/src/conf_mode/vpp_interfaces_bonding.py
+++ b/src/conf_mode/vpp_interfaces_bonding.py
@@ -18,6 +18,7 @@
from vyos.config import Config
from vyos.configdict import get_interface_dict
+from vyos.configdict import is_node_changed
from vyos.configdep import set_dependents, call_dependents
from vyos.configverify import verify_mtu_ipv6
from vyos import ConfigError
@@ -108,6 +109,12 @@ def get_config(config=None) -> dict:
no_tag_node_value_mangle=True,
)
+ iface_path = ['interfaces', 'vpp', 'bonding', ifname]
+ rebuild_required_nodes = ['mode', 'hash-policy', 'mac']
+ for node in rebuild_required_nodes:
+ if is_node_changed(conf, iface_path + [node]):
+ config.update({'rebuild_required': {}})
+
config['bond_members'] = deps_bond_dict(conf)
# Dependency
@@ -225,10 +232,12 @@ def apply(config):
ifname = config.get('ifname')
bond = VPPBondInterface(ifname, config)
- bond.remove()
+
+ if 'deleted' in config or 'rebuild_required' in config:
+ bond.remove()
if 'deleted' in config:
- return
+ return None
bond.update(config)