ioctl: allow common operations without allocations #3726
Labels
optimization
Affects perf but not correctness or applicability
P2
triaged
Discussed in a triage meeting
Milestone
Describe the feature you'd like supported
Operations like looking up a map value via EBPF_OPERATION_MAP_FIND_ELEMENT are currently forced to allocate a buffer because of the way that the request structure is defined:
ebpf-for-windows/libs/execution_context/ebpf_protocol.h
Lines 145 to 151 in 2448139
The key is appended to the request buffer. This means that the caller has to allocate memory and perform copying. This is especially bad for batch operations where the amount if memory to be allocated and copied is larger:
ebpf-for-windows/libs/execution_context/ebpf_protocol.h
Lines 481 to 489 in 2448139
It would be nice if common performance critical map operations could be implemented without allocations.
Proposed solution
This could be achieved by making map keys and values pointers, like it is done for
struct bpf_prog_info
:ebpf-for-windows/include/ebpf_structs.h
Line 397 in 2448139
Additional context
No response
The text was updated successfully, but these errors were encountered: