Delete an entry/key in the map while the entries are being looked up.
Problem:
The bpf_map_lookup_batch API fails to retrieve all the hash map entries during iteration when one of the next key is deleted. And also, returns ENOENT in the next iteration, when there are more entries.
OS information
Windows 11 or above.
Steps taken to reproduce bug
To retrieve entries in batches,
Set the batch size to be small.
Iterate until ENOENT.
Delete the next_key entry, before the next iteration, and continue.
Expected behavior
All the entries in the hash map should be retrieved.
Describe the bug
Concurrent test case:
Problem: The bpf_map_lookup_batch API fails to retrieve all the hash map entries during iteration when one of the next key is deleted. And also, returns ENOENT in the next iteration, when there are more entries.
OS information
Windows 11 or above.
Steps taken to reproduce bug
To retrieve entries in batches,
Expected behavior
All the entries in the hash map should be retrieved.
Actual outcome
Please add below test case to https://github.com/microsoft/ebpf-for-windows/pull/3563. TEST_CASE("libbpf hash map del batch", "[libbpf]") { _test_maps_batch(BPF_MAP_TYPE_HASH, true); }
Additional details
No response