]> git.ipfire.org Git - thirdparty/iproute2.git/commit
tc, bpf: improve verifier logging
authorDaniel Borkmann <daniel@iogearbox.net>
Sun, 7 Feb 2016 01:11:51 +0000 (02:11 +0100)
committerStephen Hemminger <stephen@networkplumber.org>
Sun, 7 Feb 2016 19:27:38 +0000 (11:27 -0800)
commitf31645d138b754b5b15705d80936e1e047a84c04
treeef41f1b367cd27f44c170a607f3e75b03af722bb
parent92a36995b3ceb4de4ebd43d9358e0edebce67615
tc, bpf: improve verifier logging

With a bit larger, branchy eBPF programs f.e. already ~BPF_MAXINSNS/7 in
size, it happens rather quickly that bpf(2) rejects also valid programs
when only the verifier log buffer size we have in tc is too small.

Change that, so by default we don't do any logging, and only in error
case we retry with logging enabled. If we should fail providing a
reasonable dump of the verifier analysis, retry few times with a larger
log buffer so that we can at least give the user a chance to debug the
program.

Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: John Fastabend <john.r.fastabend@intel.com>
tc/tc_bpf.c
tc/tc_bpf.h