add libbpf getters for individual ringbuffers
Status from this message: This series was applied to bpf/bpf-next.git (master)
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v2 Latest14 patches 0 repliesApplied 14/14
- v114 patches 9 repliesSuperseded
Changes in v2 from the cover letter
- Addressed all feedback from Andrii Nakryiko
Patches in v2 All 14 applied
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/14 | libbpf: refactor cleanup in ring_buffer__addtools/ | +9 | 0 replies | Applied |
| 2/14 | libbpf: switch rings to array of pointerstools/ | +12 | 0 replies | Applied |
| 3/14 | libbpf: add ring_buffer__ringtools/ tools/ tools/ | +24 | 0 replies | Applied |
| 4/14 | selftests/bpf: add tests for ring_buffer__ringtools/ | +15 | 0 replies | Applied |
| 5/14 | libbpf: add ring__producer_pos, ring__consumer_postools/ tools/ tools/ | +34 | 0 replies | Applied |
| 6/14 | selftests/bpf: add tests for ring__*_postools/ | +14 | 0 replies | Applied |
| 7/14 | libbpf: add ring__avail_data_sizetools/ tools/ tools/ | +21 | 0 replies | Applied |
| 8/14 | selftests/bpf: add tests for ring__avail_data_sizetools/ | +3 | 0 replies | Applied |
| 9/14 | libbpf: add ring__sizetools/ tools/ tools/ | +16 | 0 replies | Applied |
| 10/14 | selftests/bpf: add tests for ring__sizetools/ | +3 | 0 replies | Applied |
| 11/14 | libbpf: add ring__map_fdtools/ tools/ tools/ | +15 | 0 replies | Applied |
| 12/14 | selftests/bpf: add tests for ring__map_fdtools/ | +4 | 0 replies | Applied |
| 13/14 | libbpf: add ring__consumetools/ tools/ tools/ | +22 | 0 replies | Applied |
| 14/14 | selftests/bpf: add tests for ring__consumetools/ | +4 | 0 replies | Applied |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.
Cover letter [PATCH bpf-next v2 00/14] add libbpf getters for individual ringbuffers
This patch series adds a new ring__ API to libbpf exposing getters for accessing the individual ringbuffers inside a struct ring_buffer. This is useful for polling individually, getting available data, or similar use cases. The API looks like this, and was roughly proposed by Andrii Nakryiko in another thread:
Getting a ring struct:
struct ring *ring_buffer__ring(struct ring_buffer *rb, unsigned int idx);
Using the ring struct:
unsigned long ring__consumer_pos(const struct ring *r); unsigned long ring__producer_pos(const struct ring *r); size_t ring__avail_data_size(const struct ring *r); size_t ring__size(const struct ring *r);
int ring__map_fd(const struct ring *r);
int ring__consume(struct ring *r);
Changes in v2:
- Addressed all feedback from Andrii Nakryiko
Martin Kelly (14):
libbpf: refactor cleanup in ring_buffer__add
libbpf: switch rings to array of pointers
libbpf: add ring_buffer__ring selftests/bpf: add tests for ring_buffer__ring
libbpf: add ring__producer_pos, ring__consumer_pos selftests/bpf: add tests for ring__*_pos
libbpf: add ring__avail_data_size selftests/bpf: add tests for ring__avail_data_size
libbpf: add ring__size
selftests/bpf: add tests for ring__size
libbpf: add ring__map_fd
selftests/bpf: add tests for ring__map_fd
libbpf: add ring__consume
selftests/bpf: add tests for ring__consume
tools/lib/bpf/libbpf.h | 73 ++++++++++++++++ tools/lib/bpf/libbpf.map | 7 ++ tools/lib/bpf/ringbuf.c | 85 ++++++++++++++++--- .../selftests/bpf/prog_tests/ringbuf.c | 26 ++++++ .../selftests/bpf/prog_tests/ringbuf_multi.c | 15 ++++ 5 files changed, 193 insertions(+), 13 deletions(-)
Signature · 1 line
2.34.1