]> git.ipfire.org Git - thirdparty/iproute2.git/commit
lib/bpf: Fix btf_load error lead to enable debug log
authorFeng Zhou <zhoufeng.zf@bytedance.com>
Sun, 1 Aug 2021 06:07:09 +0000 (14:07 +0800)
committerStephen Hemminger <stephen@networkplumber.org>
Wed, 11 Aug 2021 02:53:54 +0000 (19:53 -0700)
commitbe99929d60436d131aad1cf09b9216971846e32e
treecf5132959bd0a0ce26626a47e675121b8e06223e
parentc06d313d86c1acb8dd72589816301853ff5a4ac4
lib/bpf: Fix btf_load error lead to enable debug log

Use tc with no verbose, when bpf_btf_attach fail,
the conditions:
"if (fd < 0 && (errno == ENOSPC || !ctx->log_size))"
will make ctx->log_size != 0. And then, bpf_prog_attach,
ctx->log_size != 0. so enable debug log.
The verifier log sometimes is so chatty on larger programs.
bpf_prog_attach is failed.
"Log buffer too small to dump verifier log 16777215 bytes (9 tries)!"

BTF load failure does not affect prog load. prog still work.
So when BTF/PROG load fail, enlarge log_size and re-fail with
having verbose.

Signed-off-by: Feng Zhou <zhoufeng.zf@bytedance.com>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
lib/bpf_legacy.c