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

pr/christarazi/expand batch testing #1242

Closed

Conversation

christarazi
Copy link
Member

  • Add unit test for batch lookup with chunking
  • Clarify BatchLookup() API
  • Additional test for batch lookups

Provide an example of how to use the batch lookup API when chunking,
i.e. when the buffer is smaller than the full map.

Signed-off-by: Chris Tarazi <[email protected]>
In the kernel documentation for `BPF_MAP_LOOKUP_BATCH`, it explains the
semantics of `prevKey`.[1] In this code, the API semantics were not clear
which can lead to confusion for users.

This commit clarifies the API for BatchLookup() to align closer to the
official kernel documentation for `BPF_MAP_LOOKUP_BATCH`.

[1]:
https://elixir.bootlin.com/linux/v6.6/source/include/uapi/linux/bpf.h#L615

Signed-off-by: Chris Tarazi <[email protected]>
Attempt at more thoroughly testing the batch lookups while deleting /
adding elements to the map to assert on the proper iteration of the map.

Signed-off-by: Chris Tarazi <[email protected]>
@lmb
Copy link
Collaborator

lmb commented Dec 1, 2023

Closing this since #1223 went in with better tests.

@lmb lmb closed this Dec 1, 2023
@christarazi christarazi deleted the pr/christarazi/expand-batch-testing branch December 1, 2023 22:30
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