Re: [PATCH v3 3/4] libbpf: add bpf_prog_test_run_xattr

2018-11-28 Thread Lorenz Bauer
On Wed, 28 Nov 2018 at 05:05, Alexei Starovoitov wrote: > > On Mon, Nov 26, 2018 at 4:45 AM Lorenz Bauer wrote: > > > > That's what I had initially, but that makes re-using test_attr really > > awkward. Either > > you need to reset data_out_size before every call because it is used > > to return

Re: [PATCH v3 3/4] libbpf: add bpf_prog_test_run_xattr

2018-11-27 Thread Alexei Starovoitov
On Mon, Nov 26, 2018 at 4:45 AM Lorenz Bauer wrote: > > That's what I had initially, but that makes re-using test_attr really > awkward. Either > you need to reset data_out_size before every call because it is used > to return the > buffer size, I think that is exactly what the user of the interf

Re: [PATCH v3 3/4] libbpf: add bpf_prog_test_run_xattr

2018-11-26 Thread Daniel Borkmann
On 11/26/2018 01:45 PM, Lorenz Bauer wrote: > On Sat, 24 Nov 2018 at 22:20, Alexei Starovoitov > wrote: >> On Fri, Nov 23, 2018 at 11:25:11PM +0100, Daniel Borkmann wrote: >>> On 11/22/2018 03:09 PM, Lorenz Bauer wrote: [...] LIBBPF_API int bpf_prog_test_run(int prog_fd, int repeat, void *da

Re: [PATCH v3 3/4] libbpf: add bpf_prog_test_run_xattr

2018-11-26 Thread Lorenz Bauer
On Sat, 24 Nov 2018 at 22:20, Alexei Starovoitov wrote: > > On Fri, Nov 23, 2018 at 11:25:11PM +0100, Daniel Borkmann wrote: > > On 11/22/2018 03:09 PM, Lorenz Bauer wrote: > > > Add a new function, which encourages safe usage of the test interface. > > > bpf_prog_test_run continues to work as bef

Re: [PATCH v3 3/4] libbpf: add bpf_prog_test_run_xattr

2018-11-24 Thread Alexei Starovoitov
On Fri, Nov 23, 2018 at 11:25:11PM +0100, Daniel Borkmann wrote: > On 11/22/2018 03:09 PM, Lorenz Bauer wrote: > > Add a new function, which encourages safe usage of the test interface. > > bpf_prog_test_run continues to work as before, but should be considered > > unsafe. > > > > Signed-off-by: L

Re: [PATCH v3 3/4] libbpf: add bpf_prog_test_run_xattr

2018-11-23 Thread Daniel Borkmann
On 11/22/2018 03:09 PM, Lorenz Bauer wrote: > Add a new function, which encourages safe usage of the test interface. > bpf_prog_test_run continues to work as before, but should be considered > unsafe. > > Signed-off-by: Lorenz Bauer Set looks good to me, thanks! Three small things below: > ---

[PATCH v3 3/4] libbpf: add bpf_prog_test_run_xattr

2018-11-22 Thread Lorenz Bauer
Add a new function, which encourages safe usage of the test interface. bpf_prog_test_run continues to work as before, but should be considered unsafe. Signed-off-by: Lorenz Bauer --- tools/lib/bpf/bpf.c | 27 +++ tools/lib/bpf/bpf.h | 13 + 2 files changed, 40