All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eduard Zingerman <eddyz87@gmail.com>
To: Mykyta Yatsenko <mykyta.yatsenko5@gmail.com>,
	bpf@vger.kernel.org,  ast@kernel.org, andrii@kernel.org,
	daniel@iogearbox.net, kafai@meta.com,  kernel-team@meta.com,
	memxor@gmail.com
Cc: Mykyta Yatsenko <yatsenko@meta.com>
Subject: Re: [PATCH bpf-next v3 10/10] selftests/bpf: add file dynptr tests
Date: Mon, 20 Oct 2025 17:45:38 -0700	[thread overview]
Message-ID: <006a3fe8ca7072ac35e083ee070408d9a12eadfc.camel@gmail.com> (raw)
In-Reply-To: <20251020222538.932915-11-mykyta.yatsenko5@gmail.com>

On Mon, 2025-10-20 at 23:25 +0100, Mykyta Yatsenko wrote:
> From: Mykyta Yatsenko <yatsenko@meta.com>
> 
> Introducing selftests for validating file-backed dynptr works as
> expected.
>  * validate implementation supports dynptr slice and read operations
>  * validate destructors should be paired with initializers
>  * validate sleepable progs can page in.
> 
> Signed-off-by: Mykyta Yatsenko <yatsenko@meta.com>
> ---

[...]

> diff --git a/tools/testing/selftests/bpf/progs/file_reader.c b/tools/testing/selftests/bpf/progs/file_reader.c
> new file mode 100644
> index 000000000000..695ef6392771
> --- /dev/null
> +++ b/tools/testing/selftests/bpf/progs/file_reader.c
> @@ -0,0 +1,178 @@
> +// SPDX-License-Identifier: GPL-2.0
> +/* Copyright (c) 2025 Meta Platforms, Inc. and affiliates. */
> +
> +#include <vmlinux.h>
> +#include <string.h>
> +#include <stdbool.h>
> +#include <bpf/bpf_tracing.h>
> +#include "bpf_misc.h"
> +#include "errno.h"
> +
> +char _license[] SEC("license") = "GPL";
> +
> +struct {
> +	__uint(type, BPF_MAP_TYPE_ARRAY);
> +	__uint(max_entries, 1);
> +	__type(key, int);
> +	__type(value, struct elem);
> +} arrmap SEC(".maps");
> +
> +struct {
> +	__uint(type, BPF_MAP_TYPE_RINGBUF);
> +	__uint(max_entries, 10000000);
> +} ringbuf SEC(".maps");

The test case lgtm, but a question: will it be possible to use an
array map instead of a ringbuf?  Just to avoid the need to allocate
and discard the pointer.

[...]

> diff --git a/tools/testing/selftests/bpf/progs/file_reader_fail.c b/tools/testing/selftests/bpf/progs/file_reader_fail.c
> new file mode 100644
> index 000000000000..32fe28ed2439
> --- /dev/null
> +++ b/tools/testing/selftests/bpf/progs/file_reader_fail.c

Thank you for adding these.

[...]

  reply	other threads:[~2025-10-21  0:45 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-20 22:25 [PATCH bpf-next v3 00/10] bpf: Introduce file dynptr Mykyta Yatsenko
2025-10-20 22:25 ` [PATCH bpf-next v3 01/10] selftests/bpf: remove unnecessary kfunc prototypes Mykyta Yatsenko
2025-10-20 22:25 ` [PATCH bpf-next v3 02/10] bpf: widen dynptr size/offset to 64 bit Mykyta Yatsenko
2025-10-20 23:01   ` Eduard Zingerman
2025-10-21 11:59     ` Mykyta Yatsenko
2025-10-20 22:25 ` [PATCH bpf-next v3 03/10] lib: move freader into buildid.h Mykyta Yatsenko
2025-10-20 22:25 ` [PATCH bpf-next v3 04/10] lib/freader: support reading more than 2 folios Mykyta Yatsenko
2025-10-20 22:25 ` [PATCH bpf-next v3 05/10] bpf: verifier: centralize const dynptr check in unmark_stack_slots_dynptr() Mykyta Yatsenko
2025-10-20 22:25 ` [PATCH bpf-next v3 06/10] bpf: add plumbing for file-backed dynptr Mykyta Yatsenko
2025-10-20 23:08   ` Eduard Zingerman
2025-10-20 22:25 ` [PATCH bpf-next v3 07/10] bpf: add kfuncs and helpers support for file dynptrs Mykyta Yatsenko
2025-10-20 22:25 ` [PATCH bpf-next v3 08/10] bpf: verifier: refactor kfunc specialization Mykyta Yatsenko
2025-10-20 23:38   ` Eduard Zingerman
2025-10-21 13:03     ` Mykyta Yatsenko
2025-10-20 22:25 ` [PATCH bpf-next v3 09/10] bpf: dispatch to sleepable file dynptr Mykyta Yatsenko
2025-10-20 22:25 ` [PATCH bpf-next v3 10/10] selftests/bpf: add file dynptr tests Mykyta Yatsenko
2025-10-21  0:45   ` Eduard Zingerman [this message]
2025-10-21 13:55     ` Mykyta Yatsenko
2025-10-21 16:40       ` Eduard Zingerman

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=006a3fe8ca7072ac35e083ee070408d9a12eadfc.camel@gmail.com \
    --to=eddyz87@gmail.com \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=kafai@meta.com \
    --cc=kernel-team@meta.com \
    --cc=memxor@gmail.com \
    --cc=mykyta.yatsenko5@gmail.com \
    --cc=yatsenko@meta.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.