microsoft / microsoft/ebpf-for-windows
eBPF custom maps should support find/lookup from BPF programs
- Dominant language
- C
- Stars
- 3.6k
- Forks
- 311
- Avg merge
- 6d 10h
- Merged PRs (30d)
- 21
Description
### Describe the feature you'd like supported
eBPF extensible maps should support find/lookup from BPF programs.
On Linux, for example, it is idiomatic for BPF programs to do this:
```
SEC("xdp")
int xsk_redir_prog(struct xdp_md *ctx)
{
__u32 index = ctx->rx_queue_index;
if (bpf_map_lookup_elem(&xsks_map, &index))
return bpf_redirect_map(&xsks_map, index, 0);
return XDP_PASS;
}
```
### Proposed solution
Allow the find postprocessing routine to observe usage with `EBPF_MAP_OPERATION_HELPER`. This should be opt-in by each extension, as it would otherwise be a breaking change from today's eBPF runtime behavior.
### Additional context
_No response_
Contributor guide
Assessment
This issue has not been assessed yet.