libbpf: complete list of strings for guessing program type
authorQuentin Monnet <quentin.monnet@netronome.com>
Thu, 8 Feb 2018 04:27:13 +0000 (20:27 -0800)
committerDaniel Borkmann <daniel@iogearbox.net>
Thu, 8 Feb 2018 10:59:50 +0000 (11:59 +0100)
commit0badd331491097cc3702d05a6dd0264a434712b2
tree8f140f765f8f637fed5fea1573b208b0563c9fe6
parentb7d99235473ad3a550f8eb05bd4469edadf1c8e6
libbpf: complete list of strings for guessing program type

It seems that the type guessing feature for libbpf, based on the name of
the ELF section the program is located in, was inspired from
samples/bpf/prog_load.c, which was not used by any sample for loading
programs of certain types such as TC actions and classifiers, or
LWT-related types. As a consequence, libbpf is not able to guess the
type of such programs and to load them automatically if type is not
provided to the `bpf_load_prog()` function.

Add ELF section names associated to those eBPF program types so that
they can be loaded with e.g. bpftool as well.

Signed-off-by: Quentin Monnet <quentin.monnet@netronome.com>
Reviewed-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
tools/lib/bpf/libbpf.c