]> git.baikalelectronics.ru Git - kernel.git/commit
bpftool: Refactor misc. feature probe
authorPaul Chaignon <paul@isovalent.com>
Tue, 4 Jan 2022 17:59:29 +0000 (18:59 +0100)
committerDaniel Borkmann <daniel@iogearbox.net>
Wed, 5 Jan 2022 12:31:40 +0000 (13:31 +0100)
commitee0e1deec32d145e8348741c7da1855c0ca12871
tree46d030949e346310c58fb749ae6fb02f0ec2b9c0
parent38a9d005d9baf04b3f44cec6fe5060a56f9cc97f
bpftool: Refactor misc. feature probe

There is currently a single miscellaneous feature probe,
HAVE_LARGE_INSN_LIMIT, to check for the 1M instructions limit in the
verifier. Subsequent patches will add additional miscellaneous probes,
which follow the same pattern at the existing probe. This patch
therefore refactors the probe to avoid code duplication in subsequent
patches.

The BPF program type and the checked error numbers in the
HAVE_LARGE_INSN_LIMIT probe are changed to better generalize to other
probes. The feature probe retains its current behavior despite those
changes.

Signed-off-by: Paul Chaignon <paul@isovalent.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Reviewed-by: Quentin Monnet <quentin@isovalent.com>
Link: https://lore.kernel.org/bpf/956c9329a932c75941194f91790d01f31dfbe01b.1641314075.git.paul@isovalent.com
tools/bpf/bpftool/feature.c