All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrii Nakryiko <andrii.nakryiko@gmail.com>
To: Ilya Leoshkevich <iii@linux.ibm.com>
Cc: Alexei Starovoitov <ast@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>, bpf <bpf@vger.kernel.org>,
	Heiko Carstens <hca@linux.ibm.com>,
	Vasily Gorbik <gor@linux.ibm.com>,
	John Fastabend <john.fastabend@gmail.com>
Subject: Re: [PATCH bpf-next 1/2] selftests/bpf: Add BTF_KIND_FLOAT to test_core_reloc_size
Date: Sat, 6 Mar 2021 19:21:20 -0800	[thread overview]
Message-ID: <CAEf4Bzb8LdOq1oX0jCKM9RyejUSJtciwdku+c0bEtyvW0jCzwg@mail.gmail.com> (raw)
In-Reply-To: <20210305170844.151594-2-iii@linux.ibm.com>

On Fri, Mar 5, 2021 at 9:12 AM Ilya Leoshkevich <iii@linux.ibm.com> wrote:
>
> Verify that bpf_core_field_size() is working correctly with floats.
> Also document the required clang version.
>
> Suggested-by: John Fastabend <john.fastabend@gmail.com>
> Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com>
> ---
>  tools/testing/selftests/bpf/README.rst                   | 9 +++++++++
>  tools/testing/selftests/bpf/prog_tests/core_reloc.c      | 1 +
>  tools/testing/selftests/bpf/progs/core_reloc_types.h     | 5 +++++
>  tools/testing/selftests/bpf/progs/test_core_reloc_size.c | 3 +++
>  4 files changed, 18 insertions(+)
>

[...]

> diff --git a/tools/testing/selftests/bpf/progs/core_reloc_types.h b/tools/testing/selftests/bpf/progs/core_reloc_types.h
> index 9a2850850121..3a2149c5863c 100644
> --- a/tools/testing/selftests/bpf/progs/core_reloc_types.h
> +++ b/tools/testing/selftests/bpf/progs/core_reloc_types.h
> @@ -807,6 +807,7 @@ struct core_reloc_size_output {
>         int arr_elem_sz;
>         int ptr_sz;
>         int enum_sz;
> +       int float_sz;
>  };
>
>  struct core_reloc_size {
> @@ -816,6 +817,7 @@ struct core_reloc_size {
>         int arr_field[4];
>         void *ptr_field;
>         enum { VALUE = 123 } enum_field;
> +       float float_field;
>  };
>
>  struct core_reloc_size___diff_sz {
> @@ -825,6 +827,7 @@ struct core_reloc_size___diff_sz {
>         char arr_field[10];
>         void *ptr_field;
>         enum { OTHER_VALUE = 0xFFFFFFFFFFFFFFFF } enum_field;
> +       float float_field;

here the point is to test differently sized field, so it would be good
to have `double float_field;` instead

>  };
>
>  /* Error case of two candidates with the fields (int_field) at the same
> @@ -839,6 +842,7 @@ struct core_reloc_size___err_ambiguous1 {
>         int arr_field[4];
>         void *ptr_field;
>         enum { VALUE___1 = 123 } enum_field;
> +       float float_field;
>  };
>
>  struct core_reloc_size___err_ambiguous2 {
> @@ -850,6 +854,7 @@ struct core_reloc_size___err_ambiguous2 {
>         int arr_field[4];
>         void *ptr_field;
>         enum { VALUE___2 = 123 } enum_field;
> +       float float_field;
>  };
>
>  /*

[...]

  parent reply	other threads:[~2021-03-07  3:22 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-05 17:08 [PATCH bpf-next 0/2] selftests/bpf: Add clang-based BTF_KIND_FLOAT tests Ilya Leoshkevich
2021-03-05 17:08 ` [PATCH bpf-next 1/2] selftests/bpf: Add BTF_KIND_FLOAT to test_core_reloc_size Ilya Leoshkevich
2021-03-05 21:30   ` Yonghong Song
2021-03-07  3:21   ` Andrii Nakryiko [this message]
2021-03-05 17:08 ` [PATCH bpf-next 2/2] selftests/bpf: Add BTF_KIND_FLOAT to btf_dump_test_case_syntax Ilya Leoshkevich
2021-03-05 21:31   ` Yonghong Song
2021-03-07  3:23   ` Andrii Nakryiko
2021-03-09 19:10 ` [PATCH bpf-next 0/2] selftests/bpf: Add clang-based BTF_KIND_FLOAT tests Alexei Starovoitov

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=CAEf4Bzb8LdOq1oX0jCKM9RyejUSJtciwdku+c0bEtyvW0jCzwg@mail.gmail.com \
    --to=andrii.nakryiko@gmail.com \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=gor@linux.ibm.com \
    --cc=hca@linux.ibm.com \
    --cc=iii@linux.ibm.com \
    --cc=john.fastabend@gmail.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.