lkml.org 
[lkml]   [2021]   [Mar]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH bpf-next] bpf: add 'BPF_RB_MAY_WAKEUP' flag
On Sun, Mar 28, 2021 at 9:11 AM Pedro Tammela <pctammela@gmail.com> wrote:
>
> The current way to provide a no-op flag to 'bpf_ringbuf_submit()',
> 'bpf_ringbuf_discard()' and 'bpf_ringbuf_output()' is to provide a '0'
> value.
>
> A '0' value might notify the consumer if it already caught up in processing,
> so let's provide a more descriptive notation for this value.
>
> Signed-off-by: Pedro Tammela <pctammela@mojatatu.com>
> ---

flags == 0 means "no extra modifiers of behavior". That's default
adaptive notification. If you want to adjust default behavior, only
then you specify non-zero flags. I don't think anyone will bother
typing BPF_RB_MAY_WAKEUP for this, nor I think it's really needed. The
documentation update is nice (if no flags are specified notification
will be sent if needed), but the new "pseudo-flag" seems like an
overkill to me.

> include/uapi/linux/bpf.h | 8 ++++++++
> tools/include/uapi/linux/bpf.h | 8 ++++++++
> tools/testing/selftests/bpf/progs/ima.c | 2 +-
> tools/testing/selftests/bpf/progs/ringbuf_bench.c | 2 +-
> tools/testing/selftests/bpf/progs/test_ringbuf.c | 2 +-
> tools/testing/selftests/bpf/progs/test_ringbuf_multi.c | 2 +-
> 6 files changed, 20 insertions(+), 4 deletions(-)
>

[...]

\
 
 \ /
  Last update: 2021-03-31 08:55    [W:0.162 / U:1.280 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site