Re: [PATCH v4 1/4] bpf: Make the bpf_prog_array_map more generic

2015-07-31 Thread Alexei Starovoitov
On 7/31/15 1:50 AM, xiakaixu wrote: 于 2015/7/30 9:44, Alexei Starovoitov 写道: On 7/29/15 4:17 PM, Daniel Borkmann wrote: -if (map->map_type == BPF_MAP_TYPE_PROG_ARRAY) +if (map->map_type >= BPF_MAP_TYPE_PROG_ARRAY) /* prog_array stores refcnt-ed bpf_prog pointers *

Re: [PATCH v4 1/4] bpf: Make the bpf_prog_array_map more generic

2015-07-31 Thread xiakaixu
于 2015/7/30 9:44, Alexei Starovoitov 写道: > On 7/29/15 4:17 PM, Daniel Borkmann wrote: >>> -if (map->map_type == BPF_MAP_TYPE_PROG_ARRAY) >>> +if (map->map_type >= BPF_MAP_TYPE_PROG_ARRAY) >>> /* prog_array stores refcnt-ed bpf_prog pointers >>>* release them all when u

Re: [PATCH v4 1/4] bpf: Make the bpf_prog_array_map more generic

2015-07-29 Thread Alexei Starovoitov
On 7/29/15 4:17 PM, Daniel Borkmann wrote: -if (map->map_type == BPF_MAP_TYPE_PROG_ARRAY) +if (map->map_type >= BPF_MAP_TYPE_PROG_ARRAY) /* prog_array stores refcnt-ed bpf_prog pointers * release them all when user space closes prog_array_fd */ -bpf

Re: [PATCH v4 1/4] bpf: Make the bpf_prog_array_map more generic

2015-07-29 Thread Daniel Borkmann
On 07/28/2015 01:17 PM, Kaixu Xia wrote: From: Wang Nan According to the comments from Daniel, rewrite part of the bpf_prog_array map code and make it more generic. So the new perf_event_array map type can reuse most of code with bpf_prog_array map and add fewer lines of special code. Tested t

[PATCH v4 1/4] bpf: Make the bpf_prog_array_map more generic

2015-07-28 Thread Kaixu Xia
From: Wang Nan According to the comments from Daniel, rewrite part of the bpf_prog_array map code and make it more generic. So the new perf_event_array map type can reuse most of code with bpf_prog_array map and add fewer lines of special code. Tested the samples/bpf/tracex5 after this patch: