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

Rev netlink to pick up RouteListIter #8979

Merged
merged 3 commits into from
Jul 12, 2024
Merged

Conversation

fasaxc
Copy link
Member

@fasaxc fasaxc commented Jul 4, 2024

Description

I made a PR to the upstream netlink repo that was just merged. It changes the library's internal read loop to use an iterator, which avoid a lot of allocations (10% speedup + lower allocs in my benchmarks). There's also a new, more efficient API but I'll tackle that once the dust settles on #8418 .

Related issues/PRs

vishvananda/netlink#940

Todos

  • Tests
  • Documentation
  • Release note

Release Note

Felix now uses less CPU and memory when listing routes from the kernel.

Reminder for the reviewer

Make sure that this PR has the correct labels and milestone set.

Every PR needs one docs-* label.

  • docs-pr-required: This change requires a change to the documentation that has not been completed yet.
  • docs-completed: This change has all necessary documentation completed.
  • docs-not-required: This change has no user-facing impact and requires no docs.

Every PR needs one release-note-* label.

  • release-note-required: This PR has user-facing changes. Most PRs should have this label.
  • release-note-not-required: This PR has no user-facing changes.

Other optional labels:

  • cherry-pick-candidate: This PR should be cherry-picked to an earlier release. For bug fixes only.
  • needs-operator-pr: This PR is related to install and requires a corresponding change to the operator.

@fasaxc fasaxc requested a review from a team as a code owner July 4, 2024 12:54
@marvin-tigera marvin-tigera added this to the Calico v3.29.0 milestone Jul 4, 2024
@marvin-tigera marvin-tigera added release-note-required Change has user-facing impact (no matter how small) docs-pr-required Change is not yet documented labels Jul 4, 2024
@fasaxc fasaxc added docs-not-required Docs not required for this change and removed docs-pr-required Change is not yet documented labels Jul 4, 2024
Allows for listing large numbers of routes without
buffering the whole list in memory at once.
This used to get filtered out by the nil check, but
the netlink library now synthesizes a zero CIDR when reading
the default route.
Copy link
Contributor

@aaaaaaaalex aaaaaaaalex left a comment

Choose a reason for hiding this comment

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

LGTM, ignoring CI failure 😄

@fasaxc fasaxc marked this pull request as draft July 12, 2024 10:27
@fasaxc
Copy link
Member Author

fasaxc commented Jul 12, 2024

Converting to draft since the upstream repo has a critical bug that affects the commit I tried to rev to: vishvananda/netlink#959

@fasaxc
Copy link
Member Author

fasaxc commented Jul 12, 2024

Bad commit was reverted again, my bad

@fasaxc fasaxc marked this pull request as ready for review July 12, 2024 10:30
@fasaxc
Copy link
Member Author

fasaxc commented Jul 12, 2024

@aaaaaaaalex CI fail is an nftables flake; it's with Casey.

@fasaxc fasaxc merged commit fac858f into projectcalico:master Jul 12, 2024
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs-not-required Docs not required for this change release-note-required Change has user-facing impact (no matter how small)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants