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

evpn: fix quadratic evpn mac-mobility handling #2750

Merged
merged 1 commit into from
Dec 20, 2023
Merged

Conversation

Tuetuopay
Copy link
Contributor

@Tuetuopay Tuetuopay commented Nov 30, 2023

Description

This patch adds a special case in the destination hashmap for EVPN Type-2 routes, to index them by MAC address. This allows for direct access to the destination struct, instead of iterating over all destination and all paths. Such an access is performed for every EVPN Type-2 route received for EVPN MAC mobility handling.

In effect, this replaces an iteration over all known paths by a quick lookup to the MAC, leaving only an iteration to multiple paths to the same MAC (e.g. multihoming or through multiple VNIs).

The practical effect is a reasonable convergence time for large EVPN instances.

  • before: 6m 7s
  • after: 11s

The comparison was performed on a Xeon Silver 4209T, and an EVPN instance comprising of 13k EVPN type-2 routes. The time is measured by comparing the timestamp of the first and the last routes logged by the cli's monitor mode.

Given the extreme difference, no further work was done for a more accurate measurment.

Discussion

From the short testing done, I have seen no adverse effect conflating routes with the same MAC address to the same Destination struct. However, this is the point I want to attract attention to as I am not familiar enough with the GoBGP internals.

After more testing, such a conflating resulted in incorrect ListPath behavior and most importantly route propagation, as only the best path between all of them to the same MAC were OK. It was then an issue as a MAC present in multiple VNIs led to only a single path.

The implementation was changed to use RD+MAC as the destination key. For the MAC mobility usecase, an index was added mapping a MAC address to the set of RDs that announced this MAC, allowing to build the set of destination keys for listing the paths related to a MAC.

Thanks!

@Tuetuopay Tuetuopay changed the title evpn: fix quadratic evpn mac-mobility handling Draft: evpn: fix quadratic evpn mac-mobility handling Nov 30, 2023
@Tuetuopay
Copy link
Contributor Author

Hi! The force push was to rebase atop the current master branch. However, I see that CI is failing, but it does not look to by my fault.

@fujita
Copy link
Member

fujita commented Dec 16, 2023

I fixed the lint errors.

This patch adds a special case in the destination hashmap for EVPN
Type-2 routes, to index them by MAC address. This allows for direct
access to the destination struct, instead of iterating over all
destination and all paths.

In effect, this replaces an iteration over all known paths by a quick
lookup to the MAC, leaving only an iteration to multiple paths to the
same MAC (e.g. multihoming or through multiple VNIs).

The practical effect is a reasonable convergence time for large EVPN
instances.

- before: 6m 7s
- after: 11s

The comparison was performed on a Xeon Silver 4209T, and an EVPN
instance comprising of 13k EVPN type-2 routes. The time is measured
by comparing the timestamp of the first and the last routes logged by
the cli's monitor mode.

Given the extreme difference, no further work was done for a more
accurate measurment.
@Tuetuopay
Copy link
Contributor Author

Thanks, rebased. Oh, and noticed I forgot to remove the draft status.

@Tuetuopay Tuetuopay changed the title Draft: evpn: fix quadratic evpn mac-mobility handling evpn: fix quadratic evpn mac-mobility handling Dec 17, 2023
@fujita fujita merged commit c393f43 into osrg:master Dec 20, 2023
39 checks passed
@fujita
Copy link
Member

fujita commented Dec 20, 2023

thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants