[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190826224724.edxfxbkv6r5wkg6o@ast-mbp>
Date: Mon, 26 Aug 2019 15:47:25 -0700
From: Alexei Starovoitov <alexei.starovoitov@...il.com>
To: Song Liu <liu.song.a23@...il.com>
Cc: Alexei Starovoitov <ast@...nel.org>,
"David S . Miller" <davem@...emloft.net>,
Daniel Borkmann <daniel@...earbox.net>,
Networking <netdev@...r.kernel.org>, bpf <bpf@...r.kernel.org>,
Kernel Team <kernel-team@...com>
Subject: Re: [PATCH bpf-next 3/4] selftests/bpf: verifier precise tests
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@...nel.org> 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@...nel.org>
> >
> > +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.
Powered by blists - more mailing lists