BPF List
 help / color / mirror / Atom feed
From: Eduard Zingerman <eddyz87@gmail.com>
To: Andrii Nakryiko <andrii.nakryiko@gmail.com>,
	Mykyta Yatsenko <mykyta.yatsenko5@gmail.com>
Cc: bpf@vger.kernel.org, ast@kernel.org, andrii@kernel.org,
	daniel@iogearbox.net, 	kafai@meta.com, kernel-team@meta.com,
	Mykyta Yatsenko <yatsenko@meta.com>
Subject: Re: [PATCH bpf-next 3/3] selftests/bpf: add tests for bpf_dynptr_copy
Date: Thu, 20 Feb 2025 16:56:24 -0800	[thread overview]
Message-ID: <e65f6a87ca81fd92dec31575e917f9cd4af94c14.camel@gmail.com> (raw)
In-Reply-To: <CAEf4BzaxYL1y4wR0KuSouDzmrt610CBwtv0dKp4xbO9LD-t9qg@mail.gmail.com>

On Thu, 2025-02-20 at 16:52 -0800, Andrii Nakryiko wrote:
> On Tue, Feb 18, 2025 at 11:01 AM Mykyta Yatsenko
> <mykyta.yatsenko5@gmail.com> wrote:
> > 
> > From: Mykyta Yatsenko <yatsenko@meta.com>
> > 
> > Add XDP setup type for dynptr tests, enabling testing for
> > non-contiguous buffer.
> > Add 2 tests:
> >  - test_dynptr_copy - verify correctness for the fast (contiguous
> >  buffer) code path.
> >  - test_dynptr_copy_xdp - verifies code paths that handle
> >  non-contiguous buffer.
> > 
> > Signed-off-by: Mykyta Yatsenko <yatsenko@meta.com>
> > ---
> >  tools/testing/selftests/bpf/bpf_kfuncs.h      |  8 ++
> >  .../testing/selftests/bpf/prog_tests/dynptr.c | 25 ++++++
> >  .../selftests/bpf/progs/dynptr_success.c      | 77 +++++++++++++++++++
> >  3 files changed, 110 insertions(+)
> > 
> > diff --git a/tools/testing/selftests/bpf/bpf_kfuncs.h b/tools/testing/selftests/bpf/bpf_kfuncs.h
> > index 8215c9b3115e..e9c193036c82 100644
> > --- a/tools/testing/selftests/bpf/bpf_kfuncs.h
> > +++ b/tools/testing/selftests/bpf/bpf_kfuncs.h
> > @@ -43,6 +43,14 @@ extern bool bpf_dynptr_is_rdonly(const struct bpf_dynptr *ptr) __ksym __weak;
> >  extern __u32 bpf_dynptr_size(const struct bpf_dynptr *ptr) __ksym __weak;
> >  extern int bpf_dynptr_clone(const struct bpf_dynptr *ptr, struct bpf_dynptr *clone__init) __ksym __weak;
> > 
> > +/* Description
> > + *  Copy data from one dynptr to another
> > + * Returns
> > + *  Error code
> > + */
> > +extern int bpf_dynptr_copy(struct bpf_dynptr *dst, __u32 dst_off,
> > +                          struct bpf_dynptr *src, __u32 src_off, __u32 size) __ksym __weak;
> > +
> 
> Do we *need* this? Doesn't all this come from vmlinux.h nowadays?

It does come from vmlinux.h, but this test does not include vmlinux.h
(and compiles a bit faster because of that).

[...]


  reply	other threads:[~2025-02-21  0:56 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-18 19:00 [PATCH bpf-next 0/3] introduce bpf_dynptr_copy kfunc Mykyta Yatsenko
2025-02-18 19:00 ` [PATCH bpf-next 1/3] bpf/helpers: refactor bpf_dynptr_read and bpf_dynptr_write Mykyta Yatsenko
2025-02-18 19:00 ` [PATCH bpf-next 2/3] bpf/helpers: introduce bpf_dynptr_copy kfunc Mykyta Yatsenko
2025-02-19  1:01   ` Eduard Zingerman
2025-02-21  0:42   ` Andrii Nakryiko
2025-02-18 19:00 ` [PATCH bpf-next 3/3] selftests/bpf: add tests for bpf_dynptr_copy Mykyta Yatsenko
2025-02-19  1:04   ` Eduard Zingerman
2025-02-21  0:52   ` Andrii Nakryiko
2025-02-21  0:56     ` Eduard Zingerman [this message]
2025-02-21  1:03       ` Andrii Nakryiko
2025-02-21 12:08     ` Mykyta Yatsenko
2025-02-21 17:16       ` Andrii Nakryiko

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=e65f6a87ca81fd92dec31575e917f9cd4af94c14.camel@gmail.com \
    --to=eddyz87@gmail.com \
    --cc=andrii.nakryiko@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=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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox