Skip to content

map: Add max_entries() for Map objects #1064

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

Merged
merged 1 commit into from
Jan 21, 2025

Conversation

Jongy
Copy link
Contributor

@Jongy Jongy commented Jan 18, 2025

My use case is:

  1. Read map's max_entries before loading, and resize max_entries according to some logic.
  2. After map is loaded, access resized max_entries for logging etc.

For the sake of completeness I added max_entries on MapCore and implemented on MapHandle too, although I don't use this flow (I can add just on Map instead, or instead implement it with bpf_obj_get_info_by_fd to avoid increasing the struct's size)

Signed-off-by: Yonatan Goldschmidt <[email protected]>
Copy link
Collaborator

@danielocfb danielocfb left a comment

Choose a reason for hiding this comment

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

Seems fine to me, thanks.

@danielocfb danielocfb merged commit b59be14 into libbpf:master Jan 21, 2025
13 checks passed
danielocfb pushed a commit to d-e-s-o/libbpf-rs that referenced this pull request Jan 21, 2025
Add a CHANGELOG entry for pull request libbpf#1064, which added the
max_entries() getter to various map types. Also improve on a few minor
details that did not justify another round trip.

Signed-off-by: Daniel Müller <[email protected]>
danielocfb pushed a commit that referenced this pull request Jan 21, 2025
Add a CHANGELOG entry for pull request #1064, which added the
max_entries() getter to various map types. Also improve on a few minor
details that did not justify another round trip.

Signed-off-by: Daniel Müller <[email protected]>
@Jongy Jongy deleted the add-max-entries-upstream branch January 21, 2025 18:29
@Jongy
Copy link
Contributor Author

Jongy commented Jan 21, 2025

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