Re: [PATCH 1/3] bpf: allow zero-initializing hash map seed

2018-10-08 Thread Lorenz Bauer
On Fri, 5 Oct 2018 at 22:07, Alexei Starovoitov wrote: > > On Fri, Oct 05, 2018 at 04:27:58PM +0200, Jann Horn wrote: > > > > Can you please describe exactly why something that is not a kernel > > unit test needs deterministic BPF hash map behavior? > > my use case for deterministic hashing is per

Re: [PATCH 1/3] bpf: allow zero-initializing hash map seed

2018-10-05 Thread Alexei Starovoitov
On Fri, Oct 05, 2018 at 04:27:58PM +0200, Jann Horn wrote: > > Can you please describe exactly why something that is not a kernel > unit test needs deterministic BPF hash map behavior? my use case for deterministic hashing is performance analysis. Both while developing and tuning bpf program and

Re: [PATCH 1/3] bpf: allow zero-initializing hash map seed

2018-10-05 Thread Jann Horn
On Fri, Oct 5, 2018 at 4:21 PM Lorenz Bauer wrote: > On Fri, 5 Oct 2018 at 15:12, Jann Horn wrote: > > On Fri, Oct 5, 2018 at 9:42 AM Lorenz Bauer wrote: > > > On Tue, 2 Oct 2018 at 21:00, Jann Horn wrote: > > > > If this is for testing only, you can slap a capable(CAP_SYS_ADMIN) > > > > check

Re: [PATCH 1/3] bpf: allow zero-initializing hash map seed

2018-10-05 Thread Lorenz Bauer
On Fri, 5 Oct 2018 at 15:12, Jann Horn wrote: > > On Fri, Oct 5, 2018 at 9:42 AM Lorenz Bauer wrote: > > On Tue, 2 Oct 2018 at 21:00, Jann Horn wrote: > > > > > > If this is for testing only, you can slap a capable(CAP_SYS_ADMIN) > > > check in here, right? I doubt it matters, but I don't really

Re: [PATCH 1/3] bpf: allow zero-initializing hash map seed

2018-10-05 Thread Jann Horn
On Fri, Oct 5, 2018 at 9:42 AM Lorenz Bauer wrote: > On Tue, 2 Oct 2018 at 21:00, Jann Horn wrote: > > > > If this is for testing only, you can slap a capable(CAP_SYS_ADMIN) > > check in here, right? I doubt it matters, but I don't really like > > seeing something like this exposed to unprivilege

Re: [PATCH 1/3] bpf: allow zero-initializing hash map seed

2018-10-05 Thread Lorenz Bauer
On Tue, 2 Oct 2018 at 21:00, Jann Horn wrote: > > If this is for testing only, you can slap a capable(CAP_SYS_ADMIN) > check in here, right? I doubt it matters, but I don't really like > seeing something like this exposed to unprivileged userspace just > because you need it for kernel testing. Th

Re: [PATCH 1/3] bpf: allow zero-initializing hash map seed

2018-10-02 Thread Jann Horn
On Mon, Oct 1, 2018 at 12:47 PM Lorenz Bauer wrote: > > Add a new flag BPF_F_ZERO_SEED, which forces a hash map > to initialize the seed to zero. > --- > include/uapi/linux/bpf.h | 2 ++ > kernel/bpf/hashtab.c | 8 ++-- > 2 files changed, 8 insertions(+), 2 deletions(-) > > diff --git a/i

[PATCH 1/3] bpf: allow zero-initializing hash map seed

2018-10-01 Thread Lorenz Bauer
Add a new flag BPF_F_ZERO_SEED, which forces a hash map to initialize the seed to zero. --- include/uapi/linux/bpf.h | 2 ++ kernel/bpf/hashtab.c | 8 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/include/uapi/linux/bpf.h b/include/uapi/linux/bpf.h index aa5ccd2385ed.