Commit 3b2930c
committed
zebra: fix l3vni to l2vni transition
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]>1 parent aa677ff commit 3b2930c
3 files changed
+89
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2434 | 2434 | | |
2435 | 2435 | | |
2436 | 2436 | | |
| 2437 | + | |
2437 | 2438 | | |
2438 | 2439 | | |
2439 | 2440 | | |
| |||
2514 | 2515 | | |
2515 | 2516 | | |
2516 | 2517 | | |
2517 | | - | |
2518 | | - | |
2519 | | - | |
| 2518 | + | |
| 2519 | + | |
| 2520 | + | |
| 2521 | + | |
| 2522 | + | |
| 2523 | + | |
| 2524 | + | |
| 2525 | + | |
| 2526 | + | |
| 2527 | + | |
| 2528 | + | |
| 2529 | + | |
| 2530 | + | |
| 2531 | + | |
| 2532 | + | |
2520 | 2533 | | |
2521 | | - | |
2522 | | - | |
| 2534 | + | |
| 2535 | + | |
| 2536 | + | |
| 2537 | + | |
| 2538 | + | |
2523 | 2539 | | |
2524 | 2540 | | |
2525 | 2541 | | |
| |||
2532 | 2548 | | |
2533 | 2549 | | |
2534 | 2550 | | |
| 2551 | + | |
| 2552 | + | |
| 2553 | + | |
| 2554 | + | |
| 2555 | + | |
| 2556 | + | |
2535 | 2557 | | |
2536 | 2558 | | |
2537 | 2559 | | |
| |||
5330 | 5352 | | |
5331 | 5353 | | |
5332 | 5354 | | |
5333 | | - | |
| 5355 | + | |
5334 | 5356 | | |
5335 | 5357 | | |
| 5358 | + | |
| 5359 | + | |
| 5360 | + | |
| 5361 | + | |
| 5362 | + | |
| 5363 | + | |
| 5364 | + | |
| 5365 | + | |
| 5366 | + | |
| 5367 | + | |
| 5368 | + | |
| 5369 | + | |
| 5370 | + | |
| 5371 | + | |
5336 | 5372 | | |
5337 | 5373 | | |
5338 | 5374 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
90 | 90 | | |
91 | 91 | | |
92 | 92 | | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
93 | 139 | | |
94 | 140 | | |
95 | 141 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
| 63 | + | |
63 | 64 | | |
64 | 65 | | |
65 | 66 | | |
| |||
0 commit comments