Re: [PATCH bpf-next 3/4] selftests/bpf: verifier precise tests

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, Aug 25, 2019 at 10:22:13PM -0700, Song Liu wrote:
> On Fri, Aug 23, 2019 at 2:59 AM Alexei Starovoitov <ast@xxxxxxxxxx> wrote:
> >
> > Use BPF_F_TEST_STATE_FREQ flag to check that precision
> > tracking works as expected by comparing every step it takes.
> >
> > Signed-off-by: Alexei Starovoitov <ast@xxxxxxxxxx>
> >
> > +static bool cmp_str_seq(const char *log, const char *exp)
> 
> Maybe call it str_str_seq()?

imo cmp*() returns the result of comparison.
Which is either boolean or -1,0,1.
Whereas str*() should return the address, index, or offset.
Hence I used cmp_ prefix here.

> >  static void do_test_single(struct bpf_test *test, bool unpriv,
> >                            int *passes, int *errors)
> >  {
> > @@ -897,14 +929,20 @@ static void do_test_single(struct bpf_test *test, bool unpriv,
> >                 pflags |= BPF_F_STRICT_ALIGNMENT;
> >         if (test->flags & F_NEEDS_EFFICIENT_UNALIGNED_ACCESS)
> >                 pflags |= BPF_F_ANY_ALIGNMENT;
> > +       if (test->flags & ~3)
> > +               pflags |= test->flags;
> ^^^^^^ why do we need these two lines?

To pass flags from test into attr.prog_flags.
Older F_NEEDS_* and F_LOAD_* may use some cleanup and can be removed,
but it would be a different patch.




[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux