Re: [PATCH bpf-next v2 2/4] selftests: bpf: Add helper to compare socket cookies

2020-10-02 Thread Lorenz Bauer
On Thu, 1 Oct 2020 at 18:11, Alexei Starovoitov wrote: > > > > I think this might be the same problem I fixed for libbpf with [0]. > > Turns out, GCC explicitly calls out (somewhere in their docs) that > > uninitialized variable warnings work only when compiled in optimized > > mode, because some

Re: [PATCH bpf-next v2 2/4] selftests: bpf: Add helper to compare socket cookies

2020-10-01 Thread Alexei Starovoitov
On Thu, Oct 1, 2020 at 10:09 AM Andrii Nakryiko wrote: > > On Thu, Oct 1, 2020 at 12:25 AM Alexei Starovoitov > wrote: > > > > On Wed, Sep 30, 2020 at 10:28:33AM +0100, Lorenz Bauer wrote: > > > On Tue, 29 Sep 2020 at 16:48, Alexei Starovoitov > > > wrote: > > > > > > ... > > > > > > > There was

Re: [PATCH bpf-next v2 2/4] selftests: bpf: Add helper to compare socket cookies

2020-10-01 Thread Andrii Nakryiko
On Thu, Oct 1, 2020 at 12:25 AM Alexei Starovoitov wrote: > > On Wed, Sep 30, 2020 at 10:28:33AM +0100, Lorenz Bauer wrote: > > On Tue, 29 Sep 2020 at 16:48, Alexei Starovoitov > > wrote: > > > > ... > > > > > There was a warning. I noticed it while applying and fixed it up. > > > Lorenz, please

Re: [PATCH bpf-next v2 2/4] selftests: bpf: Add helper to compare socket cookies

2020-10-01 Thread Alexei Starovoitov
On Wed, Sep 30, 2020 at 10:28:33AM +0100, Lorenz Bauer wrote: > On Tue, 29 Sep 2020 at 16:48, Alexei Starovoitov > wrote: > > ... > > > There was a warning. I noticed it while applying and fixed it up. > > Lorenz, please upgrade your compiler. This is not the first time such > > warning has been

Re: [PATCH bpf-next v2 2/4] selftests: bpf: Add helper to compare socket cookies

2020-09-30 Thread Lorenz Bauer
On Tue, 29 Sep 2020 at 16:48, Alexei Starovoitov wrote: ... > There was a warning. I noticed it while applying and fixed it up. > Lorenz, please upgrade your compiler. This is not the first time such > warning has been missed. I tried reproducing this on latest bpf-next (b0efc216f577997) with g

Re: [PATCH bpf-next v2 2/4] selftests: bpf: Add helper to compare socket cookies

2020-09-29 Thread Alexei Starovoitov
On Mon, Sep 28, 2020 at 10:59 PM Martin KaFai Lau wrote: > > > > +static void compare_cookies(struct bpf_map *src, struct bpf_map *dst) > > +{ > > + __u32 i, max_entries = bpf_map__max_entries(src); > > + int err, duration, src_fd, dst_fd; > This should have a compiler warning. "duration"

Re: [PATCH bpf-next v2 2/4] selftests: bpf: Add helper to compare socket cookies

2020-09-28 Thread Martin KaFai Lau
On Mon, Sep 28, 2020 at 10:08:03AM +0100, Lorenz Bauer wrote: > We compare socket cookies to ensure that insertion into a sockmap worked. > Pull this out into a helper function for use in other tests. > > Signed-off-by: Lorenz Bauer > --- > .../selftests/bpf/prog_tests/sockmap_basic.c | 50

[PATCH bpf-next v2 2/4] selftests: bpf: Add helper to compare socket cookies

2020-09-28 Thread Lorenz Bauer
We compare socket cookies to ensure that insertion into a sockmap worked. Pull this out into a helper function for use in other tests. Signed-off-by: Lorenz Bauer --- .../selftests/bpf/prog_tests/sockmap_basic.c | 50 +-- 1 file changed, 36 insertions(+), 14 deletions(-) diff -