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

aya: add BpfLoader::set_max_entries #393

Merged
merged 1 commit into from
Sep 20, 2022

Conversation

aztecher
Copy link
Contributor

Fixes the issue #308.

Add BpfLoader::set_max_entries so that the max_entries of any map on the ebpf component
can be set at the load-time on the userspace component.
The max_entries of the map that matches the map name given in the first argument is overwritten
by the value of the second argument.

Fixes: #308
Refs: #292

@netlify
Copy link

netlify bot commented Sep 18, 2022

Deploy Preview for aya-rs-docs ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 2eccf1d
🔍 Latest deploy log https://app.netlify.com/sites/aya-rs-docs/deploys/63288e591f43dc0009b009eb
😎 Deploy Preview https://deploy-preview-393--aya-rs-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@vadorovsky
Copy link
Member

Lint errors are unrelated to your changes, let me fix them.

Copy link
Member

@vadorovsky vadorovsky left a comment

Choose a reason for hiding this comment

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

Thank you for your contribution! :)

Just one doc nit (we always finish sentences with periods).

Also, you will need to rebase once #394 gets merged.

aya/src/bpf.rs Outdated Show resolved Hide resolved
Add BpfLoader::set_max_entries, which sets the max_entries for the
specified map, as the load-time option.
The max_entries set at map initialization in the ebpf component can be
overwritten by this method called on the userspace component.
If you want to set max_entries for multiple maps in an ebpf component,
you can do so by calling set_max_entries in the form of a method chain.

Fixes: aya-rs#308
Refs: aya-rs#292
Copy link
Member

@vadorovsky vadorovsky left a comment

Choose a reason for hiding this comment

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

LGTM

@alessandrod PTAL

@alessandrod
Copy link
Collaborator

LGTM

@alessandrod PTAL

Looks good! Thanks @aztecher and thank you for reviewing Michal!

@alessandrod alessandrod merged commit a93a975 into aya-rs:main Sep 20, 2022
@aztecher aztecher deleted the impl-set_max_entries branch September 20, 2022 09:27
@dave-tucker dave-tucker added feature A PR that implements a new feature or enhancement aya This is about aya (userspace) labels Feb 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
aya This is about aya (userspace) feature A PR that implements a new feature or enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add BpfLoader::set_max_entries("map_name", 64)
4 participants