Skip to content

Conversation

@chiragshah6
Copy link
Member

When a VNI is moved from the L3VNI to the L2VNI, the VxLAN interface associated with the L3VNI continues to retain this VNI in its internal table. Later, when that VxLAN interface is assigned a new VNI, it attempts to remove the old VNI from its table. During this removal, an assertion is triggered because the VNI now references the L2VNI's VxLAN interface instead of the original L3VNI interface.

Fix: when the vni is transition from l3 to l2, remove the vni binging from the vxlan interface belong to the l3.

  1. removing the vni info from the hash which is primarily maintain to have cache of netlink notification for SVD to vlan-vni mapping. The hash values should only be removed when vni mapping is removed for vxlan device or vxlan interface is removed by Kernel.
    The vni info removal lead to an issue where when the same vni is transition back to L3VNI, all the info is lost hence L3VNI does not come up properly.

  2. while the vni info removed from hash, the vni info was not freed lead to memory leak.

To ensure a correct VNI transition, avoid removing the VNI entry from the hash. Instead, simply dereference it from the VxLAN VLAN information. When the VNI is later re‑added as an L3VNI, restore the VLAN information reference.

Before fix:

torm-21(config)# vrf vrf1
torm-21(config-vrf)# no vni 4000

torm-21(config-vrf)# do show evpn vni
4000       L2   vxlan99               10       34       4               vrf1            0       br_l3vni

After fix:

   torm-21(config-vrf)# do show evpn vni
   4000       L3   vxlan99               0        0        n/a             vrf1            2501       br_l3vni

   torm-21(config)# vrf vrf1
   torm-21(config-vrf)# no vni 4000

   torm-21(config-vrf)# do show evpn vni
   4000       L2   vxlan99               10       34       4               vrf1            2501       br_l3vni

   torm-21(config-vrf)# vni 4000
   torm-21(config-vrf)# do show evpn vni
   4000       L3   vxlan99               4        4        n/a             vrf1            2501       br_l3vni

   Detail output after vni transition:
   torm-21(config-vrf)# do show evpn vni  4000
   VNI: 4000
    Type: L2
    Vlan: 2501
    Bridge: br_l3vni
    Tenant VRF: vrf1
    VxLAN interface: vxlan99
    VxLAN ifIndex: 27
    SVI interface: vlan2501_l3
    SVI ifIndex: 29
    Local VTEP IP: 2001:c001:ff:f00d::6
    Mcast group: 0.0.0.0
    Remote VTEPs for this VNI:
     2001:c001:ff:f00d::7 flood: -
     2001:c001:ff:f00d::5 flood: -
     2001:c001:ff:f00d::4 flood: -
     2001:cf11:ff:f00d::3 flood: -
    Number of MACs (local and remote) known for this VNI: 10
    Number of ARPs (IPv4 and IPv6, local and remote) known for this VNI: 31
    Advertise-gw-macip: No
    Advertise-svi-macip: No

   torm-21(config-vrf)# vni 4000
   torm-21(config-vrf)# do show evpn vni  4000
   VNI: 4000
     Type: L3
     Tenant VRF: vrf1
     Vlan: 2501
     Bridge: br_l3vni
     Local Vtep Ip: 2001:c001:ff:f00d::6
     Vxlan-Intf: vxlan99
     SVI-If: vlan2501_l3
     State: Up
     VNI Filter: none
     System MAC: 44:38:39:ff:ff:18
     Router MAC: 44:38:39:ff:ff:18
     Number of MACs (local and remote) known for this VNI: 4
     Number of ARPs (IPv4 and IPv6, local and remote) known for this VNI: 4
     L2 VNIs: 1000 1001 1002 1003

Vijayalaxmi Basavaraj [email protected]
Signed-off-by: Chirag Shah [email protected]

when the vni is moved from l3 to l2vni, the vxlan interface belonging to
the l3 was still holding this vni in its table. when this vxlan interfae
is assigned new vni, it would go ahead remove the old vni from its
table. while removing it asserts beacuse the vxaln interface belonging
to this vni is now pointing to l2vni vxlan interface.

Fix: when the vni is transition from l3 to l2, remove the vni binging
from the vxlan interface belong to the l3.

1. removing the vni info from the hash which is primarly
maintain to have cache of netlink notification for SVD to
vlan-vni mapping.
The hash values should only be removed when vni mapping
is removed for vxlan device or vxlan interface is removed
by Kernel.
The vni info removal lead to an issue where when the same
vni is transition back to L3VNI, all the info is lost hence
L3VNI does not come up properly.

2. while the vni info removed from hash, the vni info
was not freed lead to memory leak.

To have proper vni transition, instead of removing vni info
from hash, simply dereference from vxlan vlan infomration
and when readded as L3VNI restore the referecen for vlan vlan
information.

Related Ticket: #4404076

Ticket: #4667654

Testing:

Before fix:
torm-21(config)# vrf vrf1
torm-21(config-vrf)# no vni 4000

torm-21(config-vrf)# do show evpn vni
4000       L2   vxlan99               10       34       4               vrf1            0       br_l3vni

After fix:
torm-21(config-vrf)# do show evpn vni
4000       L3   vxlan99               0        0        n/a             vrf1            2501       br_l3vni

torm-21(config)# vrf vrf1
torm-21(config-vrf)# no vni 4000

torm-21(config-vrf)# do show evpn vni
4000       L2   vxlan99               10       34       4               vrf1            2501       br_l3vni

torm-21(config-vrf)# vni 4000
torm-21(config-vrf)# do show evpn vni
4000       L3   vxlan99               4        4        n/a             vrf1            2501       br_l3vni

Detail output after vni transition:
torm-21(config-vrf)# do show evpn vni  4000
VNI: 4000
 Type: L2
 Vlan: 2501
 Bridge: br_l3vni
 Tenant VRF: vrf1
 VxLAN interface: vxlan99
 VxLAN ifIndex: 27
 SVI interface: vlan2501_l3
 SVI ifIndex: 29
 Local VTEP IP: 2001:c001:ff:f00d::6
 Mcast group: 0.0.0.0
 Remote VTEPs for this VNI:
  2001:c001:ff:f00d::7 flood: -
  2001:c001:ff:f00d::5 flood: -
  2001:c001:ff:f00d::4 flood: -
  2001:cf11:ff:f00d::3 flood: -
 Number of MACs (local and remote) known for this VNI: 10
 Number of ARPs (IPv4 and IPv6, local and remote) known for this VNI: 31
 Advertise-gw-macip: No
 Advertise-svi-macip: No
torm-21(config-vrf)# vni 4000
torm-21(config-vrf)# do show evpn vni  4000
VNI: 4000
  Type: L3
  Tenant VRF: vrf1
  Vlan: 2501
  Bridge: br_l3vni
  Local Vtep Ip: 2001:c001:ff:f00d::6
  Vxlan-Intf: vxlan99
  SVI-If: vlan2501_l3
  State: Up
  VNI Filter: none
  System MAC: 44:38:39:ff:ff:18
  Router MAC: 44:38:39:ff:ff:18
  Number of MACs (local and remote) known for this VNI: 4
  Number of ARPs (IPv4 and IPv6, local and remote) known for this VNI: 4
  L2 VNIs: 1000 1001 1002 1003

Signed-off-by: Chirag Shah <[email protected]>
@ton31337
Copy link
Member

ton31337 commented Jan 4, 2026

@Mergifyio backport stable/10.5

@mergify
Copy link

mergify bot commented Jan 4, 2026

backport stable/10.5

🟠 Waiting for conditions to match

Details
  • merged [📌 backport requirement]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants