From 5b654e5b2847cb87e7ac0366fbd4954673be1943 Mon Sep 17 00:00:00 2001 From: Nataliia Solomko Date: Wed, 3 Jun 2026 12:50:07 +0300 Subject: 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. --- src/conf_mode/vpp_interfaces_bonding.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'src') 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) -- cgit v1.2.3