Interface.update() in python/vyos/ifconfig/interface.py deletes a VLAN interface and creates it again when the QoS mappings of the kernel differ from the configuration. The QoS mappings are only set when the interface is created (VLANIf._create(), ip link add).
Found on rolling 2026.11.22 (VLAN eth0.77 with ingress-qos and egress-qos):
- The kernel value was compared as a string with a trailing space, so it never matched. Every commit that reaches the parent interface (for example only a description) deletes and creates every VLAN with a QoS mapping again, the ifindex changes, traffic on it stops for a moment. A smoketest that commits a description change and compares the ifindex fails with 35 != 23.
- When both mappings are removed from the configuration, the old mappings stay in the kernel (ingress [(2, 7)], egress [(1, 6)], same ifindex), because nothing is compared when the configuration has no mapping.
- A mapping that is added to a running VLAN while the other direction does not change is not applied, because the interface is not created again and the mapping is only set at creation.
- The comparison must read a mapping the way the kernel lists it, otherwise values like 01:6, 010, a pair that maps to 0 or the same source twice are different forever: numbers are read like iproute2 does (a leading zero is octal), the VLAN priority has 3 bits (ingress source, egress target), the last pair of a source wins, a pair that maps to 0 is not listed. Checked with 150 random mappings against the kernel, no difference.
Proposed fix: one function vlan_qos_changed() compares both directions with this model. Interface.update() and other code that has to know if a VLAN will be recreated use it. The task of VPP MPLS (T9518) needs it: MPLS in VPP is switched off on a VLAN before it is recreated.