Repository navigation
Conversation
Repeated SVD mapping notifications can mark an unchanged VLAN-to-VNI mapping as a VLAN change. This enters the destructive path, withdrawing local MACs and reinstalling remote MACs. L3VNIs go down and back up. During EVPN MAC move-back, cleanup for VNI 100 completes before a link notification rebuilds both VNIs. The rebuild deletes and reinstalls the same MAC in VNI 200, producing an unrelated FDB deletion. Skip only when the access VLAN is unchanged and the bridge mapping is bound to this VNI. If lookup finds no exact binding, keep the existing update path, including when two VXLAN devices share a VLAN. An ES-capable bond can retain the access-BD after an L3-to-L2 transition, with its VNI binding cleared. The next SVD notification follows the existing update path and restores the binding. The matching-only skip leaves that behavior unchanged. Free the old VNI record on unchanged-mapping and lookup-error paths. It has already been released from the hash table. Signed-off-by: Nageswara Soma <nsoma@cisco.com>
[Medium impact] The PR appears safe to merge; no actionable issues remain. SummaryZebra now skips repeated SVD mapping updates when the VLAN is unchanged and the access-BD is already bound to the expected VNI.
Diagram%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[SVD mapping notification] --> B{VLAN unchanged?}
B -->|No| E[Run existing update path]
B -->|Yes| C{Access-BD bound to expected VNI?}
C -->|No| E
C -->|Yes| D[Keep MAC and L3VNI state]
D --> F[Free old mapping entry]
E --> F
Reviews (3) · Last reviewed commit: "tests: cover unchanged SVD mapping notif..." · Reviewed by Greptile |
2d0e54c to
dd513b4
Compare
| _, result = topotest.run_and_expect(l3_state, None, count=30, wait=1) | ||
| assert result is None, f"Initial L3VNI state: {result}" | ||
| mark = len(pe1.net.getLog("log", "zebra")) | ||
| pe1.cmd_raises("bridge vlan add dev vxlan0 vid 600") |
There was a problem hiding this comment.
Haven't we had discussions about how we should not be directly calling linux specific commands? Please use a function in tests/topotests/lib if it exists, if it does not please add one that provides the right functionality.
There was a problem hiding this comment.
@donaldsharp Thanks for the suggestion. I have updated the test code to reuse existing utils where it can and created new utils for some kernel commands. I have done same for some vtysh config and hope it's okay.
|
@chiragshah6 can you examine this for correctness from an evpn perspective? |
Add an unrelated VNI to the EVPN MAC move-back SVD setup while its existing mappings remain unchanged. Check local and remote MAC state, MACIP withdrawals, and kernel FDB deletion history so a transient delete and reinstall cannot pass on final state alone. Exercise the same notification with an operational L3VNI and a peer type-5 route. Require its remote next-hop, RMAC, and kernel FDB entry to survive, and reject L3VNI withdrawal messages during the update. Also convert an L3VNI back to L2 while a bond member retains its access-BD. Confirm the next SVD notification restores the cleared binding through the existing update path. This checks the skip is limited to a matching VNI. Use bounded polling and remove temporary mappings and interfaces after each check. Add SVD mapping and access-bond helpers to lib/evpn.py. Use shared config and debug utilities with checked results. Clear the L3VNI before deleting its BGP VRF. With the prior update path, unchanged mappings show MAC and L3VNI churn, while the cleared-binding case passes. The tests ensure the conditional skip suppresses churn only for an exact VNI match and preserves the existing update path when no matching binding exists. Signed-off-by: Nageswara Soma <nsoma@cisco.com>
dd513b4 to
7f26d45
Compare
Summary
Problem
Repeated SVD mapping notifications can process unchanged VLAN-to-VNI mappings as VLAN changes, even when the access-BD is already bound to the expected VNI. Zebra then withdraws and reinstalls MAC state; for L3VNIs, it sends the VNI down and back up. In
bgp_evpn_mac_move_back, a link notification after VNI 100 cleanup causes the same VNI 200 MAC to be deleted and reinstalled, producing an unexpected FDB deletion in CI.Fix
Skip the destructive update only when the access VLAN is unchanged and the bridge mapping is bound to that VNI. When lookup returns 0—including when two VXLAN devices share a VLAN or an L3-to-L2 transition cleared the binding—the existing update path remains active. This preserves the existing shared-VLAN and binding-restoration behavior. Release the old VNI record on both skipped and lookup-error paths.
Commits
zebra: fix MAC churn on unchanged SVD mappings
Skip the destructive update only for an unchanged mapping whose access-BD is bound to that VNI. Other notifications continue through the existing update path. Free the old VNI record on the skipped and lookup-error paths.
tests: cover unchanged SVD mapping notifications
Add coverage for L2 MAC and L3VNI preservation, including FDB deletion and MACIP withdrawal history. Verify that a mapping refresh restores an access-BD whose bond member survived an L3-to-L2 transition, after asserting that its VNI binding is cleared. Add SVD mapping and access-bond helpers to
lib/evpn.py, and reuse shared configuration and debug utilities with checked results. During L3VNI cleanup, clear the VNI and wait for BGP to observe it before deleting the BGP instance.Testing
--memleakswas enabled for every complete suite run.Related Issue
Components
zebra, tests