bpf: net: Use precomputed btf_id for bpf iterators
authorYonghong Song <yhs@fb.com>
Mon, 20 Jul 2020 16:34:03 +0000 (09:34 -0700)
committerAlexei Starovoitov <ast@kernel.org>
Tue, 21 Jul 2020 20:26:26 +0000 (13:26 -0700)
commit951cf368bcb11d6f817709660cf5cd914072c36f
tree521419b293f6fd3b2e1d201bbb4ca49f9e9e5ce5
parentfce557bcef119a1bc5ab3cb02678cf454bcaf424
bpf: net: Use precomputed btf_id for bpf iterators

One additional field btf_id is added to struct
bpf_ctx_arg_aux to store the precomputed btf_ids.
The btf_id is computed at build time with
BTF_ID_LIST or BTF_ID_LIST_GLOBAL macro definitions.
All existing bpf iterators are changed to used
pre-compute btf_ids.

Signed-off-by: Yonghong Song <yhs@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://lore.kernel.org/bpf/20200720163403.1393551-1-yhs@fb.com
include/linux/bpf.h
kernel/bpf/btf.c
kernel/bpf/map_iter.c
kernel/bpf/task_iter.c
net/ipv4/tcp_ipv4.c
net/ipv4/udp.c
net/ipv6/route.c
net/netlink/af_netlink.c