From: "Kumar Kartikeya Dwivedi" <memxor@gmail.com>
To: "Tamir Duberstein" <tamird@kernel.org>,
"Alexei Starovoitov" <ast@kernel.org>,
"Daniel Borkmann" <daniel@iogearbox.net>,
"Andrii Nakryiko" <andrii@kernel.org>,
"Eduard Zingerman" <eddyz87@gmail.com>,
"Martin KaFai Lau" <martin.lau@linux.dev>,
"Song Liu" <song@kernel.org>,
"Yonghong Song" <yonghong.song@linux.dev>,
"Jiri Olsa" <jolsa@kernel.org>,
"Emil Tsalapatis" <emil@etsalapatis.com>,
"Shuah Khan" <shuah@kernel.org>,
"Andrea Righi" <arighi@nvidia.com>,
"Xu Kuohai" <xukuohai@huawei.com>,
"Andrea Righi" <andrea.righi@canonical.com>,
"Bing-Jhong Billy Jheng" <billy@starlabs.sg>,
"David Vernet" <void@manifault.com>,
"Ihor Solodrai" <ihor.solodrai@linux.dev>
Cc: <bpf@vger.kernel.org>, <linux-kselftest@vger.kernel.org>,
<linux-kernel@vger.kernel.org>,
"Andrew Werner" <awerner32@gmail.com>,
"Zvi Effron" <zeffron@riotgames.com>,
"Andrii Nakryiko" <andriin@fb.com>
Subject: Re: [PATCH bpf-next v3 4/8] libbpf: ringbuf: Add a caller-owned iterator
Date: Mon, 23 Nov 2026 22:18:48 +0100 [thread overview]
Message-ID: <DN2WJMWD5G0R.27OOI2IBOXA6M@gmail.com> (raw)
In-Reply-To: <20261120-bpf-ringbuf-fixes-v3-4-ff7ca15d6c37@kernel.org>
On Fri Nov 20, 2026 at 9:33 PM CET, Tamir Duberstein wrote:
> Ring buffer records are exposed only through callbacks. Callers that
> need to stop at an operation-specific condition have no non-error way to
> end consumption early.
>
> Add a caller-owned iterator that returns borrowed records one at a time.
> Each next call ends the borrow and can publish consumed records before
> inspecting another one, allowing callers to batch consumer updates.
> Implement callback consumption on the same internal iterator core so
> both paths share the record traversal and publication protocol. Allow
> iterator-only rings to omit the setup callback.
>
> Preserve callback validation, so callback-based consumption of an
> iterator-only ring still returns -EINVAL. Keep the consumer-publication
> barrier on early destruction, including bounded and callback-error
> returns.
>
> Keep overwrite maps out of the public iterator; handling a stale
> consumer position requires a separate resynchronization protocol.
> Require iterator users to observe exhaustion before waiting for another
> readiness notification.
>
> Signed-off-by: Tamir Duberstein <tamird@kernel.org>
> ---
Hi Tamir,
I had a similar patch set in flight, to ressurect your older changes (which
explains why I sent out some your fixes which were landable).
We can compare notes on the API design and decide on the path forward here.
Feel free to provide feedback on [0], I have put you in the Cc list.
Thanks.
[0]: https://lore.kernel.org/bpf/cover.1795467315.git.memxor@gmail.com
> [...]
next prev parent reply other threads:[~2026-11-23 21:18 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-20 20:33 [PATCH bpf-next v3 0/8] bpf: Fix ring buffers and add a libbpf iterator Tamir Duberstein
2026-11-20 20:33 ` [PATCH bpf-next v3 1/8] bpf: user_ringbuf: Handle position wrap Tamir Duberstein
2026-11-20 20:33 ` [PATCH bpf-next v3 2/8] libbpf: ringbuf: Use compiler atomics Tamir Duberstein
2026-11-20 21:34 ` bot+bpf-ci
2026-11-20 22:38 ` Tamir Duberstein
2026-11-20 20:33 ` [PATCH bpf-next v3 3/8] libbpf: ringbuf: Prevent missed wakeups Tamir Duberstein
2026-11-20 20:33 ` [PATCH bpf-next v3 4/8] libbpf: ringbuf: Add a caller-owned iterator Tamir Duberstein
2026-11-20 21:34 ` bot+bpf-ci
2026-11-20 22:38 ` Tamir Duberstein
2026-11-21 10:01 ` Andrea Righi
2026-11-21 11:58 ` Tamir Duberstein
2026-11-23 21:18 ` Kumar Kartikeya Dwivedi [this message]
2026-11-20 20:33 ` [PATCH bpf-next v3 5/8] libbpf: ringbuf: Simplify iterator implementation Tamir Duberstein
2026-11-20 20:33 ` [PATCH bpf-next v3 6/8] selftests/bpf: Refactor lifetimes and test wakeups Tamir Duberstein
2026-11-20 21:34 ` bot+bpf-ci
2026-11-20 22:38 ` Tamir Duberstein
2026-11-20 20:33 ` [PATCH bpf-next v3 7/8] selftests/bpf: Verify ringbuf callback semantics Tamir Duberstein
2026-11-20 20:33 ` [PATCH bpf-next v3 8/8] selftests/bpf: Test caller-owned ring iterators Tamir Duberstein
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=DN2WJMWD5G0R.27OOI2IBOXA6M@gmail.com \
--to=memxor@gmail.com \
--cc=andrea.righi@canonical.com \
--cc=andrii@kernel.org \
--cc=andriin@fb.com \
--cc=arighi@nvidia.com \
--cc=ast@kernel.org \
--cc=awerner32@gmail.com \
--cc=billy@starlabs.sg \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=eddyz87@gmail.com \
--cc=emil@etsalapatis.com \
--cc=ihor.solodrai@linux.dev \
--cc=jolsa@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=martin.lau@linux.dev \
--cc=shuah@kernel.org \
--cc=song@kernel.org \
--cc=tamird@kernel.org \
--cc=void@manifault.com \
--cc=xukuohai@huawei.com \
--cc=yonghong.song@linux.dev \
--cc=zeffron@riotgames.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox