diff options
| author | Dave Marchevsky <[email protected]> | 2022-10-20 16:07:18 +0000 |
|---|---|---|
| committer | Alexei Starovoitov <[email protected]> | 2022-10-22 02:22:42 +0000 |
| commit | 9ef40974a82a474321a4c2dd75d395943930c638 (patch) | |
| tree | cc77dc523a1ca75655d34f68fecf65e1ad926724 /scripts/bpf_doc.py | |
| parent | Merge branch 'Add support for aarch64 to selftests/bpf/vmtest.sh' (diff) | |
| download | kernel-9ef40974a82a474321a4c2dd75d395943930c638.tar.gz kernel-9ef40974a82a474321a4c2dd75d395943930c638.zip | |
bpf: Allow ringbuf memory to be used as map key
This patch adds support for the following pattern:
struct some_data *data = bpf_ringbuf_reserve(&ringbuf, sizeof(struct some_data, 0));
if (!data)
return;
bpf_map_lookup_elem(&another_map, &data->some_field);
bpf_ringbuf_submit(data);
Currently the verifier does not consider bpf_ringbuf_reserve's
PTR_TO_MEM | MEM_ALLOC ret type a valid key input to bpf_map_lookup_elem.
Since PTR_TO_MEM is by definition a valid region of memory, it is safe
to use it as a key for lookups.
Signed-off-by: Dave Marchevsky <[email protected]>
Acked-by: Yonghong Song <[email protected]>
Acked-by: Andrii Nakryiko <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Alexei Starovoitov <[email protected]>
Diffstat (limited to 'scripts/bpf_doc.py')
0 files changed, 0 insertions, 0 deletions
