Skip to content

T8426: FRR support for EVPN Anycast - #1199

Merged
c-po merged 1 commit into
vyos:rollingfrom
hedrok:T8426-evpn-anycast-arp
Jun 10, 2026
Merged

T8426: FRR support for EVPN Anycast#1199
c-po merged 1 commit into
vyos:rollingfrom
hedrok:T8426-evpn-anycast-arp

Conversation

@hedrok

@hedrok hedrok commented May 27, 2026

Copy link
Copy Markdown
Contributor

Change summary

Add FRR patch for better MACVLAN support in FRR code.

This version creates NOARP entry on both VLAN and MACVLAN, this is in line with other places in FRR + works.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes)
  • Migration from an old Vyatta component to vyos-1x, please link to related PR inside obsoleted component
  • Other (please describe):

Related Task(s)

Related PR(s)

How to test / Smoketest result

Test as described in related task.

Checklist:

  • I have read the CONTRIBUTING document
  • I have linked this PR to one or more Phabricator Task(s)
  • My commit headlines contain a valid Task id
  • My change requires a change to the documentation
  • I have updated the documentation accordingly

Add FRR patch for better MACVLAN support in FRR code.
@hedrok
hedrok marked this pull request as draft May 27, 2026 17:45
@coderabbitai

coderabbitai Bot commented May 27, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Summary by CodeRabbit

  • New Features
    • Enhanced EVPN support for MACVLAN interfaces with improved neighbor and MAC-IP entry programming
    • Extended VRR (Virtual Router Redundancy) interface handling in EVPN neighbor operations for redundancy scenarios
    • Improved kernel neighbor processing that correctly manages MACVLAN-linked interfaces as Switch Virtual Interfaces
    • Better VLAN context tracking and interface linking for more accurate neighbor entry management

Walkthrough

This patch enhances FRR's zebra daemon to properly handle MACVLAN interfaces and VRR (Virtual Router Redundancy) in EVPN neighbor and MAC-IP programming. It preprocesses MACVLAN input to establish SVI context, extends EVPN neighbor dataplane programming to VRR interfaces, and conditions MAC-IP reading on VRR availability and advertise settings.

Changes

MACVLAN and VRR EVPN Neighbor Support

Layer / File(s) Summary
MACVLAN kernel neighbor handling with SVI context
scripts/package-build/frr/patches/frr/0024-zebra-enhance-MACVLAN-support-in-EVPN.patch
zebra_neigh_ipaddr_update detects MACVLAN input, looks up the linked interface, and uses it as SVI context (svi_ifp/zsvi_if) for subsequent VLAN/bridge link selection and VXLAN kernel neighbor update/delete operations.
EVPN neighbor dataplane programming for VRR
scripts/package-build/frr/patches/frr/0024-zebra-enhance-MACVLAN-support-in-EVPN.patch
EVPN neighbor removal/install logic in zebra_evpn_neigh.c now programs or removes the same neighbor entry in the dataplane for the VRR interface associated with the SVI/VLAN interface via vrr_if lookup and conditional dplane_rem_neigh_add/dplane_rem_neigh_delete calls.
VRR MAC-IP and EVPN neighbor VLAN reading
scripts/package-build/frr/patches/frr/0024-zebra-enhance-MACVLAN-support-in-EVPN.patch
zebra_evpn_read_mac_neigh gates VRR MAC-IP programming by both VRR interface existence and advertise_gw_macip_enabled(), and triggers neigh_read_for_vlan for both VLAN interface and corresponding VRR interface when present.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive Title references T8426 task but is vague about the actual change—'FRR support for EVPN Anycast' doesn't clearly convey that this adds a MACVLAN enhancement patch. Consider a more specific title like 'T8426: Add FRR patch enhancing MACVLAN support in EVPN' to better reflect the actual changeset.
✅ Passed checks (4 passed)
Check name Status Explanation
Description check ✅ Passed Description clearly explains the purpose: adding an FRR patch for better MACVLAN support in EVPN with NOARP entry creation on both VLAN and MACVLAN, directly related to the changeset.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
✨ Simplify code
  • Create PR with simplified code

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions

github-actions Bot commented May 27, 2026

Copy link
Copy Markdown

👍
No issues in PR Title / Commit Title

@github-actions github-actions Bot added the current VyOS rolling release label May 27, 2026
@hedrok
hedrok marked this pull request as ready for review June 8, 2026 09:23
@mergify mergify Bot added rolling and removed current VyOS rolling release labels Jun 8, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
scripts/package-build/frr/patches/frr/0024-zebra-enhance-MACVLAN-support-in-EVPN.patch (1)

135-138: 💤 Low value

Misleading debug message: "ignoring" is imprecise.

When linked interface lookup fails, the function still processes the neighbor locally via zebra_neigh_add/zebra_neigh_del on ifp. Only VXLAN operations are skipped. Consider:

Suggested clarification
-				zlog_debug("    Neighbor Entry received on MACVLAN %s, but linked interface not found, ignoring",
+				zlog_debug("    Neighbor Entry received on MACVLAN %s, but linked interface not found, skipping EVPN processing",
 					   ifp->name);
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@scripts/package-build/frr/patches/frr/0024-zebra-enhance-MACVLAN-support-in-EVPN.patch`
around lines 135 - 138, The debug message logged when linked-interface lookup
fails is misleading because neighbor handling still continues locally via
zebra_neigh_add/zebra_neigh_del on ifp while only VXLAN-related operations are
skipped; update the zlog_debug call (guarded by IS_ZEBRA_DEBUG_KERNEL) to
clearly state that the linked interface was not found and VXLAN handling will be
skipped but the neighbor will still be processed on the MACVLAN (ifp) — e.g.
change the message string to mention "linked interface not found; skipping VXLAN
operations, processing neighbor on %s" so intent is explicit.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In
`@scripts/package-build/frr/patches/frr/0024-zebra-enhance-MACVLAN-support-in-EVPN.patch`:
- Around line 135-138: The debug message logged when linked-interface lookup
fails is misleading because neighbor handling still continues locally via
zebra_neigh_add/zebra_neigh_del on ifp while only VXLAN-related operations are
skipped; update the zlog_debug call (guarded by IS_ZEBRA_DEBUG_KERNEL) to
clearly state that the linked interface was not found and VXLAN handling will be
skipped but the neighbor will still be processed on the MACVLAN (ifp) — e.g.
change the message string to mention "linked interface not found; skipping VXLAN
operations, processing neighbor on %s" so intent is explicit.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Central YAML (inherited), Organization UI (inherited)

Review profile: CHILL

Plan: Pro

Run ID: c2c8c4aa-87f2-4af1-947a-b97fd9dfec94

📥 Commits

Reviewing files that changed from the base of the PR and between 4c0a579 and f67c560.

📒 Files selected for processing (1)
  • scripts/package-build/frr/patches/frr/0024-zebra-enhance-MACVLAN-support-in-EVPN.patch
📜 Review details
🧰 Additional context used
🔍 Remote MCP Context7

Summary of Relevant FRR/EVPN Context

Based on FRR documentation, here are the key architectural and operational context points relevant to reviewing this patch:

MACVLAN and VRRP Architecture in FRR

FRR's VRRP implementation relies on Linux macvlan devices to achieve the protocol's shared virtual MAC feature. These system interfaces must be configured externally before VRRP can be enabled on them, with each interface intended for VRRP requiring at least one macvlan device configured with the correct virtual MAC and set to bridge mode.

EVPN Anycast Gateway Configuration

L2VNI anycast gateways use a macvlan device created from the L2VNI with a shared MAC address across VTEPs, requiring a local FDB entry on the bridge for the anycast MAC to prevent it from traversing the overlay.

Neighbor Management and Kernel Interaction

The Zebra neighbor API includes functions for querying neighbor information from Zebra's cache via zclient_neigh_get() on a specific interface and address family, with Zebra responding asynchronously via ZEBRA_NEIGH_ADDED messages.

Key Technical Context for Review

The patch's modifications to zebra_evpn_read_mac_neigh, zebra_evpn_neigh.c, and zebra_neigh.c align with FRR's architecture where:

  • MACVLAN devices act as SVIs linked to their parent interfaces
  • Neighbor entries must be programmed through both the primary interface and any associated virtual interfaces (VRR/macvlan)
  • Kernel neighbor operations (dplane) need to use the correct SVI interface context for proper programming

This context supports the patch's objective of treating MACVLAN-linked interfaces as SVIs and extending neighbor/MAC-IP programming to VRR interfaces, which is essential for EVPN Anycast support.

🔇 Additional comments (3)
scripts/package-build/frr/patches/frr/0024-zebra-enhance-MACVLAN-support-in-EVPN.patch (3)

29-46: LGTM!


48-96: LGTM!


147-204: LGTM!

@aapostoliuk

aapostoliuk commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

I have checked this fix in lab and it works.

  1. ARP entries that are received from the peth interface are added to BGP as type 2 routes with IP/MAC.
  2. Received BGP type 2 routes (IP/MAC) are added as NOARP on peth and bridge interfaces.
  3. The output of the command show evpn arp-cache vni all is correct.
    R1
vyos@vyos:~$ show arp
Address       Interface    Link layer address    State
------------  -----------  --------------------  ---------
1.1.1.2       vxlan0       0a:61:b8:53:8f:82     NOARP
192.168.2.10  br0.200      00:50:79:66:68:1f     NOARP
1.1.1.2       br0.1000     0a:61:b8:53:8f:82     NOARP
10.0.0.2      eth0         0c:58:2b:c4:00:00     REACHABLE
192.168.1.20  br0.100      00:50:79:66:68:21     REACHABLE
vyos@vyos:~$ show bgp l2vpn evpn route type 2
BGP table version is 7, local router ID is 1.1.1.1
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal
Origin codes: i - IGP, e - EGP, ? - incomplete
EVPN type-1 prefix: [1]:[EthTag]:[ESI]:[IPlen]:[VTEP-IP]:[Frag-id]
EVPN type-2 prefix: [2]:[EthTag]:[MAClen]:[MAC]:[IPlen]:[IP]
EVPN type-3 prefix: [3]:[EthTag]:[IPlen]:[OrigIP]
EVPN type-4 prefix: [4]:[ESI]:[IPlen]:[OrigIP]
EVPN type-5 prefix: [5]:[EthTag]:[IPlen]:[IP]

   Network          Next Hop            Metric LocPrf Weight Path
                    Extended Community
Route Distinguisher: 1000:100
 *>  [2]:[0]:[48]:[00:50:79:66:68:21] RD 1000:100
                    1.1.1.1                            32768 i
                    ET:8 RT:1000:100
 *>  [2]:[0]:[48]:[00:50:79:66:68:21]:[32]:[192.168.1.20] RD 1000:100
                    1.1.1.1                            32768 i
                    ET:8 RT:1000:100 RT:1000:1000 Rmac:16:46:32:72:10:e4
Route Distinguisher: 1001:200
 *>  [2]:[0]:[48]:[00:50:79:66:68:1f] RD 1001:200
                    1.1.1.2                                0 65002 i
                    RT:1000:200 ET:8
 *>  [2]:[0]:[48]:[00:50:79:66:68:1f]:[32]:[192.168.2.10] RD 1001:200
                    1.1.1.2                                0 65002 i
                    RT:1000:200 RT:1000:1000 ET:8 Rmac:0a:61:b8:53:8f:82

Displayed 4 prefixes (4 paths) (of requested type)

vyos@vyos:~$ show evpn arp-cache vni all
VNI 200 #ARP (IPv4 and IPv6, local and remote) 1

Flags: I=local-inactive, P=peer-active, X=peer-proxy
Neighbor        Type   Flags State    MAC               Remote ES/VTEP                           Seq #'s
192.168.2.10    remote       active   00:50:79:66:68:1f 1.1.1.2                                  0/0

VNI 100 #ARP (IPv4 and IPv6, local and remote) 1

Flags: I=local-inactive, P=peer-active, X=peer-proxy
Neighbor        Type   Flags State    MAC               Remote ES/VTEP                           Seq #'s
192.168.1.20    local        active   00:50:79:66:68:21                                          0/0

R2 has the same results.

@sever-sever sever-sever left a comment

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.

Add the FRR patch for EVPN anycast feature

@robinchrist

Copy link
Copy Markdown
Contributor

The implications of this PR are nontrivial and it has not been reviewed in FRR mainline yet.

FRRouting/frr#22030

@c-po c-po left a comment

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.

Add patch for FRR which is pending upstream to add EVPN anycast gateway support to zebra

@c-po
c-po merged commit 705aa42 into vyos:rolling Jun 10, 2026
13 of 14 checks passed
@vyos-bot vyos-bot Bot added mirror-initiated This PR initiated for mirror sync workflow mirror-completed and removed mirror-initiated This PR initiated for mirror sync workflow labels Jun 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

5 participants