Re: [PATCH v2 net-next 1/6] bpf: introduce BPF_PROG_TEST_RUN command

2017-04-01 Thread Jesper Dangaard Brouer
On Sat, 1 Apr 2017 08:45:01 -0700 Alexei Starovoitov wrote: > On 4/1/17 12:14 AM, Jesper Dangaard Brouer wrote: > > On Thu, 30 Mar 2017 21:45:38 -0700 > > Alexei Starovoitov wrote: > > > >> static u32 bpf_test_run(struct bpf_prog *prog, void *ctx, u32 repeat, u32 > >> *time) > >> +{ > >> + u

Re: [PATCH v2 net-next 1/6] bpf: introduce BPF_PROG_TEST_RUN command

2017-04-01 Thread Alexei Starovoitov
On 4/1/17 12:14 AM, Jesper Dangaard Brouer wrote: On Thu, 30 Mar 2017 21:45:38 -0700 Alexei Starovoitov wrote: static u32 bpf_test_run(struct bpf_prog *prog, void *ctx, u32 repeat, u32 *time) +{ + u64 time_start, time_spent = 0; + u32 ret = 0, i; + + if (!repeat) +

Re: [PATCH v2 net-next 1/6] bpf: introduce BPF_PROG_TEST_RUN command

2017-04-01 Thread Jesper Dangaard Brouer
On Thu, 30 Mar 2017 21:45:38 -0700 Alexei Starovoitov wrote: > static u32 bpf_test_run(struct bpf_prog *prog, void *ctx, u32 repeat, u32 > *time) > +{ > + u64 time_start, time_spent = 0; > + u32 ret = 0, i; > + > + if (!repeat) > + repeat = 1; > + time_start = ktime_g

[PATCH v2 net-next 1/6] bpf: introduce BPF_PROG_TEST_RUN command

2017-03-30 Thread Alexei Starovoitov
development and testing of networking bpf programs is quite cumbersome. Despite availability of user space bpf interpreters the kernel is the ultimate authority and execution environment. Current test frameworks for TC include creation of netns, veth, qdiscs and use of various packet generators jus