libbpf: Add ring__consume_n / ring_buffer__consume_n
authorAndrea Righi <andrea.righi@canonical.com>
Sat, 6 Apr 2024 09:15:43 +0000 (11:15 +0200)
committerAndrii Nakryiko <andrii@kernel.org>
Sat, 6 Apr 2024 16:11:55 +0000 (09:11 -0700)
commit4d22ea94ea33550538b3b14429d52cb9f96ad2c3
treebe1f6764f6ef5a655bb0d2e5d60bf7c99659a9ae
parent13e8125a22763557d719db996f70c71f77c9509c
libbpf: Add ring__consume_n / ring_buffer__consume_n

Introduce a new API to consume items from a ring buffer, limited to a
specified amount, and return to the caller the actual number of items
consumed.

Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/lkml/20240310154726.734289-1-andrea.righi@canonical.com/T
Link: https://lore.kernel.org/bpf/20240406092005.92399-4-andrea.righi@canonical.com
tools/lib/bpf/libbpf.h
tools/lib/bpf/libbpf.map
tools/lib/bpf/ringbuf.c