libbpf: deprecate bpf_program__is_<type>() and bpf_program__set_<type>() APIs
authorAndrii Nakryiko <andrii@kernel.org>
Mon, 24 Jan 2022 19:42:50 +0000 (11:42 -0800)
committerAlexei Starovoitov <ast@kernel.org>
Wed, 26 Jan 2022 01:59:06 +0000 (17:59 -0800)
commit5d98fce86e12a4d4c23f82ffbd320f853f1f3f1f
treed1a4afb3844b5477772860668e8ad03b003e1b0d
parentc5023b8f2693035d7ce2cf8153298002182049ff
libbpf: deprecate bpf_program__is_<type>() and bpf_program__set_<type>() APIs

Not sure why these APIs were added in the first place instead of
a completely generic (and not requiring constantly adding new APIs with
each new BPF program type) bpf_program__type() and
bpf_program__set_type() APIs. But as it is right now, there are 13 such
specialized is_type/set_type APIs, while latest kernel is already at 30+
BPF program types.

Instead of completing the set of APIs and keep chasing kernel's
bpf_prog_type enum, deprecate existing subset and recommend generic
bpf_program__type() and bpf_program__set_type() APIs.

Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/r/20220124194254.2051434-4-andrii@kernel.org
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
tools/lib/bpf/libbpf.h