Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update EVPN prefix routes properly instead of withdraw/install #18158

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

chdxD1
Copy link

@chdxD1 chdxD1 commented Feb 14, 2025

Today bgpd sends down withdraw and install to zebra when a EVPN prefix route is updated. There was no mechanism in zebra to track such changes and references to prefixes on EVPN nexthops.

The commits implement the respective tracking in zebra and stops sending withdraws for updates from bgpd.

Previously bgpd needed to send a withdraw followed by an install
to update an EVPN prefix route. With refcount tracking in zebra
this is no longer needed

Signed-off-by: Christopher Dziomba <[email protected]>
@chdxD1
Copy link
Author

chdxD1 commented Feb 15, 2025

There is one caveat after looking at this again - EVPN MH uses the same functions but slightly different, doing reference counting already in bgpd.

@chdxD1 chdxD1 force-pushed the evpn-no-withdraw-for-update branch from de9f8c7 to ea2dd4f Compare February 15, 2025 13:18
With bgpd no longer sending withdraws for EVPN prefix routes
zebra needs to track the path/ref count of prefixes for an EVPN
nexthop. When a route is updated the count is first increased
with the new paths and then decreased with the paths of the
existing/"same" route entry.
However the same evpn route methods are used for EVPN MH as well,
where bgpd already tracks the references. It is expected that an
ADD operation for the respective A-D routes is handled as an
upsert, a DEL operation should really remove the respective A-D
reference on a next-hop. For this the old behaviour (no path/ref
counting in zebra) is preserved.

Signed-off-by: Christopher Dziomba <[email protected]>
@chdxD1 chdxD1 force-pushed the evpn-no-withdraw-for-update branch from ea2dd4f to f451ea1 Compare February 17, 2025 11:37
@chdxD1
Copy link
Author

chdxD1 commented Feb 17, 2025

The behaviour for EVPN MH / A-D routes should now be the same again. I've also squashed the zebra commits into one now and fixed the code style issues hinted by CI.

@donaldsharp
Copy link
Member

donaldsharp commented Feb 18, 2025

Why is zebra responsible for the refcounting? This seems like a bgp problem not a zebra problem. As a note -> the typical pattern in zebra is to just do what it is told. This breaks that pattern.

@chdxD1
Copy link
Author

chdxD1 commented Feb 18, 2025

As far as I understood zebra is already "refcounting" today, it tracks the prefixes for a given EVPN VTEP / nexthop. zebra is being told to add / update or withdraw a route, not an evpn nexthop, therefore it has to take care of managing the references for it.
With this change it tracks the count of individual nexthops per route, making the add / update action actually working without having to know about the specifics for EVPN in e.g. bgpd that EVPN routes have to be withdrawn first.

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