public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] Allow bpf_user_ringbuf_drain() callbacks to return 1
@ 2022-10-12 23:20 David Vernet
  2022-10-12 23:20 ` [PATCH 1/2] bpf: " David Vernet
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: David Vernet @ 2022-10-12 23:20 UTC (permalink / raw)
  To: bpf
  Cc: andrii, ast, martin.lau, daniel, song, yhs, john.fastabend,
	kpsingh, sdf, haoluo, jolsa, linux-kernel, kernel-team

The bpf_user_ringbuf_drain() helper function allows a BPF program to
specify a callback that is invoked when draining entries from a
BPF_MAP_TYPE_USER_RINGBUF ring buffer map. The API is meant to allow the
callback to return 0 if it wants to continue draining samples, and 1 if
it's done draining. Unfortunately, bpf_user_ringbuf_drain() landed shortly
after commit 1bfe26fb0827 ("bpf: Add verifier support for custom
callback return range"), which changed the default behavior of callbacks
to only support returning 0, and the corresponding necessary change to
bpf_user_ringbuf_drain() callbacks was missed.

This patch set fixes this oversight, and updates the user_ringbuf
selftests to return 1 in a callback to catch future instances of
regression.

This patch set should be merged to the bpf tree.

David Vernet (2):
  bpf: Allow bpf_user_ringbuf_drain() callbacks to return 1
  selftests/bpf: Make bpf_user_ringbuf_drain() selftest callback return
    1

 kernel/bpf/verifier.c                                    | 1 +
 tools/testing/selftests/bpf/progs/user_ringbuf_success.c | 4 ++--
 2 files changed, 3 insertions(+), 2 deletions(-)

-- 
2.38.0


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-10-13 15:42 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-10-12 23:20 [PATCH 0/2] Allow bpf_user_ringbuf_drain() callbacks to return 1 David Vernet
2022-10-12 23:20 ` [PATCH 1/2] bpf: " David Vernet
2022-10-12 23:20 ` [PATCH 2/2] selftests/bpf: Make bpf_user_ringbuf_drain() selftest callback " David Vernet
2022-10-13 15:32 ` [PATCH 0/2] Allow bpf_user_ringbuf_drain() callbacks to " Andrii Nakryiko
2022-10-13 15:40 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox