Skip to content

zebra: fix bgp_evpn_mac_move_back CI failure from unnecessary MAC churn - #24604

Open
nsoma26 wants to merge 2 commits into
FRRouting:masterfrom
nsoma26:nsoma_zebra_svd_vlan_update
Open

nsoma26 wants to merge 2 commits into
FRRouting:masterfrom
nsoma26:nsoma_zebra_svd_vlan_update

Conversation

@nsoma26

@nsoma26 nsoma26 commented Nov 28, 2026 •

Copy link
Copy Markdown
Contributor

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

--memleaks was enabled for every complete suite run.

Name Pass Fail Skip Error
bgp_evpn_mac_move_back 20 0 0 0
bgp_evpn_vxlan_svd_topo1 14 0 0 0
bgp_evpn_svi_anycast_gw 4 0 0 0
bgp_evpn_three_tier_clos_topo1 45 0 5 0
bgp_evpn_mh_v4_v6_num 16 0 0 0

Related Issue

Components

zebra, tests

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>
@frrbot frrbot Bot added bugfix tests Topotests, make check, etc zebra labels Nov 28, 2026
@greptile-apps

greptile-apps Bot commented Nov 28, 2026 •

Copy link
Copy Markdown
Contributor

Confidence Score: 5/5 · The PR appears safe to merge; no actionable issues remain.RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no actionable issues remain.

Summary

Zebra now skips repeated SVD mapping updates when the VLAN is unchanged and the access-BD is already bound to the expected VNI.

  • SVD mapping refreshes keep state when the VLAN and VNI still match.

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
Loading

Reviews (3) · Last reviewed commit: "tests: cover unchanged SVD mapping notif..." · Reviewed by Greptile

_, 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")

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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.

@donaldsharp

Copy link
Copy Markdown
Member

@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>
@nsoma26
nsoma26 force-pushed the nsoma_zebra_svd_vlan_update branch from dd513b4 to 7f26d45 Compare December 1, 2026 00:14
@github-actions github-actions Bot added the rebase PR needs rebase label Dec 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix master rebase PR needs rebase size/L tests Topotests, make check, etc zebra

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants