Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1195678

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

From Alexei Starovoitov <ast@plumgrid.com>
Newsgroups linux.kernel
Subject Re: [PATCH v4 1/4] bpf: Make the bpf_prog_array_map more generic
Date 2015-07-30 03:50 +0200
Message-ID <pRL8S-wR-17@gated-at.bofh.it> (permalink)
References <pRb5o-7Bt-33@gated-at.bofh.it> <pRb5o-7Bt-31@gated-at.bofh.it> <pRINH-5Km-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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_prog_array_map_clear(map);
>> +        bpf_fd_array_map_clear(map);
>
> When we are going to add a new map type to the eBPF framework that is not
> an fd_array_map thing, this assumption of map->map_type >=
> BPF_MAP_TYPE_PROG_ARRAY
> might not hold then ...

Also I think here changing == to >= is probably unnecessary.
prog_array needs to do it because of circular dependency
whereas perf_event_array cannot have it.
Even when we attach bpf prog to perf_event and then add it to
perf_event_array used by the same prog, right?
Please test such scenario just in case.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v4 1/4] bpf: Make the bpf_prog_array_map more generic Kaixu Xia <xiakaixu@huawei.com> - 2015-07-28 13:20 +0200
  Re: [PATCH v4 1/4] bpf: Make the bpf_prog_array_map more generic Alexei Starovoitov <ast@plumgrid.com> - 2015-07-30 03:50 +0200
    Re: [PATCH v4 1/4] bpf: Make the bpf_prog_array_map more generic Alexei Starovoitov <ast@plumgrid.com> - 2015-07-31 17:50 +0200

csiph-web