On Tue, Sep 8, 2020 at 10:58 AM Yonghong Song <y...@fb.com> wrote:
>
> Change selftest map_ptr_kern.c with disabling inlining for
> one of subtests, which will fail the test without previous
> verifier change. Also added to verifier test for both
> "map_ptr += scalar" and "scalar += map_ptr" arithmetic.
>
> Signed-off-by: Yonghong Song <y...@fb.com>
> ---

Acked-by: Andrii Nakryiko <andr...@fb.com>

>  .../selftests/bpf/progs/map_ptr_kern.c        | 10 +++++-
>  .../testing/selftests/bpf/verifier/map_ptr.c  | 32 +++++++++++++++++++
>  2 files changed, 41 insertions(+), 1 deletion(-)
>
> diff --git a/tools/testing/selftests/bpf/progs/map_ptr_kern.c 
> b/tools/testing/selftests/bpf/progs/map_ptr_kern.c
> index 982a2d8aa844..0b754106407d 100644
> --- a/tools/testing/selftests/bpf/progs/map_ptr_kern.c
> +++ b/tools/testing/selftests/bpf/progs/map_ptr_kern.c
> @@ -82,6 +82,14 @@ static inline int check_default(struct bpf_map *indirect,
>         return 1;
>  }
>
> +static __attribute__ ((noinline)) int

just fyi: there is now __noinline defined in bpf_helpers.h, saving a
bunch of typing

> +check_default_noinline(struct bpf_map *indirect, struct bpf_map *direct)
> +{
> +       VERIFY(check(indirect, direct, sizeof(__u32), sizeof(__u32),
> +                    MAX_ENTRIES));
> +       return 1;
> +}
> +
>  typedef struct {
>         int counter;
>  } atomic_t;

[...]

Reply via email to