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

Add verifier constraint for Helper function bpf_ringbuf_reserve #83

Merged
merged 8 commits into from
Nov 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/linux/concepts/maps.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ struct {

It is common for maps to be declared in the eBPF program, but maps are ultimately created from userspace. Most loader libraries pick up the map declarations from the compiled ELF file and create them automatically for the user.

However, it is also possible for users to manually create maps using the [BPF_MAP_CREATE](../syscall/BPF_MAP_CREATE.md) command of the BPF syscall or to use a loader library with such capabilities.
However, it is also possible for users to manually create maps using the [BPF_MAP_CREATE](../syscall/BPF_MAP_CREATE.md) command of the BPF syscall or to use a loader library with such capabilities. System wide there is no limit to the number of maps that can be created provided enough memory exists, however, a limit of 64 maps per program is enforced, that is, an eBPF program can interact with a maximum of 64 maps.

### Libbpf

Expand Down
2 changes: 1 addition & 1 deletion docs/linux/helper-function/bpf_ringbuf_reserve.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ The `rinfbuf` argument must be a pointer to a ring buffer definition. The `size`

This function is generally used in combination with a `struct` that defines the structure of the data stored in the ring buffer. Hence, in this case, the `size` argument would be set to the size of the struct. The function returns a pointer to the reserved memory, which can be used to write data to the ring buffer. See the example below for more details.

Also check [`bpf_ringbuf_submit`](./bpf_ringbuf_submit.md) and [`bpf_ringbuf_discard`](./bpf_ringbuf_discard.md) for more information on how to handle the reserved memory in the ring buffer.
The verifier enforces the constraint that for every call to `bpf_ringbuf_reserve`, a subsequent [`bpf_ringbuf_submit`](./bpf_ringbuf_submit.md) or [`bpf_ringbuf_discard`](./bpf_ringbuf_discard.md) must be called. Check [`bpf_ringbuf_submit`](./bpf_ringbuf_submit.md) and [`bpf_ringbuf_discard`](./bpf_ringbuf_discard.md) for more information.

### Program types

Expand Down
Loading