-
Notifications
You must be signed in to change notification settings - Fork 95
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
Simplify GetMapsIDsByName #384
Conversation
Hello @aymericDD. Could you please explain this weird behaviour so we can provide more context for this change. |
When I was using a BPF_MAP_TYPE_HASH with a struct key and struct value, the map was not returned in the list of IDs. I take a look at the bpftool and I notice the ID was not re-incremented manually. |
I added a unit test to cover this case. I don't have a local dev environment because I have a Macbook pro M1 and vagrant with virtualbox is not supported for now with the ARM architecture. |
It retrieves the next available map ID after the given startID.
Remove custom error to reduce maintenance toil. Just return the syscall error is enough and does not ask to create custom error for each kind of syscall errors.
The startId was not a pointer, so its value was never updated for the caller of the GetMapsIDsByName function.
af36d23
to
09f8e66
Compare
@aymericDD is it waiting review? |
Yes 👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@aymericDD thanks again for your contribution! |
The
id
is incremented byC.bpf_map_get_next_id
so no need to define thestartId
andnextId
. I encounter some weird behavior in my project when I was using map with a BPF_MAP_TYPE_HASH type.