Re: [LKP] [tools/bpf] f6f3bac08f: stderr.failed_to_prepare_for_bpf

From: Yonghong Song
Date: Tue Nov 06 2018 - 18:33:34 EST




On 11/6/18 2:04 AM, Li Zhijian wrote:
>
> On 11/6/2018 9:47 AM, Yonghong Song wrote:
>> I cannot reproduce in my local fc28 system with the attached steps.
>>
>> The netlink_dumper.c file, could you confirm whether the following
>> header files are missing form you rhel-7.2 host?
>>
>> #include <linux/rtnetlink.h>
>> #include <linux/tc_act/tc_bpf.h>
>>
>> I suspect you probably miss linux/tc_act/tc_bpf.h. But could you confirm
>> it? If this is the case, I can fix the problem by adding tc_bpf.h into
>> tools/include/uapi directory.
>
> we have installed <linux/tc_act/tc_bpf.h>, but it's a bit old
>
> root@lkp-bdw-ep3 ~/linux-f6f3bac08f# diff
> /usr/include/linux/tc_act/tc_bpf.h ./include/uapi/linux/tc_act/tc_bpf.h -u
> --- /usr/include/linux/tc_act/tc_bpf.hÂÂÂ 2018-03-02 07:52:22.000000000
> +0000
> +++ ./include/uapi/linux/tc_act/tc_bpf.hÂÂÂ 2018-09-07
> 05:34:08.000000000 +0000
> @@ -1,3 +1,4 @@
> +/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
> Â/*
> Â * Copyright (c) 2015 Jiri Pirko <jiri@xxxxxxxxxxx>
> Â *
> @@ -27,6 +28,8 @@
> ÂÂÂÂ TCA_ACT_BPF_FD,
> ÂÂÂÂ TCA_ACT_BPF_NAME,
> ÂÂÂÂ TCA_ACT_BPF_PAD,
> +ÂÂÂ TCA_ACT_BPF_TAG,
> +ÂÂÂ TCA_ACT_BPF_ID,
> ÂÂÂÂ __TCA_ACT_BPF_MAX,
> Â};
> Â#define TCA_ACT_BPF_MAX (__TCA_ACT_BPF_MAX - 1)
>
> and beside linux/tc_act/tc_bpf.h, it also requires a newer
> linux/pkt_cls.h to avoid:
> root@lkp-bdw-ep3 ~/linux-f6f3bac08f/tools/bpf/bpftool# make V=1
> [...snip...]
> gcc -O2 -W -Wall -Wextra -Wno-unused-parameter -Wshadow
> -Wno-missing-field-initializers -DPACKAGE='"bpftool"'
> -D__EXPORTED_HEADERS__ -I/root/linux-f6f3bac08f/kernel/bpf/
> -I/root/linux-f6f3bac08f/tools/include
> -I/root/linux-f6f3bac08f/tools/include/uapi
> -I/root/linux-f6f3bac08f/tools/lib/bpf
> -I/root/linux-f6f3bac08f/tools/perf -DBPFTOOL_VERSION='"4.19.0-rc2"'
> -DCOMPAT_NEED_REALLOCARRAYÂÂ -c -MMD -o netlink_dumper.o netlink_dumper.c
> make -C /root/linux-f6f3bac08f/tools/lib/bpf/ OUTPUT= libbpf.a
> make[1]: Entering directory '/root/linux-f6f3bac08f/tools/lib/bpf'
> netlink_dumper.c: In function 'do_bpf_filter_dump':
> netlink_dumper.c:153:9: error: 'TCA_BPF_ID' undeclared (first use in
> this function)
> Â if (tb[TCA_BPF_ID])
> ÂÂÂÂÂÂÂÂ ^~~~~~~~~~
> netlink_dumper.c:153:9: note: each undeclared identifier is reported
> only once for each function it appears in
> netlink_dumper.c:155:9: error: 'TCA_BPF_TAG' undeclared (first use in
> this function)
> Â if (tb[TCA_BPF_TAG])
> ÂÂÂÂÂÂÂÂ ^~~~~~~~~~~
> Makefile:96: recipe for target 'netlink_dumper.o' failed
> make: *** [netlink_dumper.o] Error 1
> make: *** Waiting for unfinished jobs....
> make -f /root/linux-f6f3bac08f/tools/build/Makefile.build dir=. obj=libbpf
> make[1]: Leaving directory '/root/linux-f6f3bac08f/tools/lib/bpf'
>
>
> In this case, i'm not clear either i should upgrade system's linux
> header by myself or fix the tools on you side.

I will send out a patch to fix the linux/tools. Thanks!

Yonghong

>
>
> Thanks
> Zhijian
>
>
>
>>
>> Thanks,
>>
>> Yonghong
>>
>>
>> On 11/4/18 9:36 PM, kernel test robot wrote:
>>> FYI, we noticed the following commit (built with gcc-7):
>>>
>>> commit: f6f3bac08ff9855d803081a353a1fafaa8845739 ("tools/bpf:
>>> bpftool: add net support")
>>> https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git master
>>>
>>> in testcase: bpf_offload
>>> with following parameters:
>>>
>>> ÂÂÂÂucode: 0xb00002e
>>>
>>>
>>>
>>> on test machine: 88 threads Intel(R) Xeon(R) CPU E5-2699 v4 @ 2.20GHz
>>> with 64G memory
>>>
>>> caused below changes (please refer to attached dmesg/kmsg for entire
>>> log/backtrace):
>>>
>>>
>>>
>>>
>>> KERNEL SELFTESTS: linux_headers_dir is
>>> /usr/src/linux-headers-x86_64-rhel-7.2-f6f3bac08ff9855d803081a353a1fafaa8845739
>>>
>>> 2018-11-03 10:11:02 cd
>>> /usr/src/linux-selftests-x86_64-rhel-7.2-f6f3bac08ff9855d803081a353a1fafaa8845739/tools/testing/selftests
>>>
>>> 2018-11-03 10:11:02 ln -sf /usr/bin/clang-7 /usr/bin/clang
>>> 2018-11-03 10:11:02 ln -sf /usr/bin/llc-7 /usr/bin/llc
>>> make: Entering directory
>>> '/usr/src/perf_selftests-x86_64-rhel-7.2-f6f3bac08ff9855d803081a353a1fafaa8845739/tools/bpf'
>>>
>>>
>>> Auto-detecting system features:
>>> ...ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ libbfd: [ OFF ]
>>> ...ÂÂÂÂÂÂÂ disassembler-four-args: [ OFF ]
>>>
>>> ÂÂÂ CCÂÂÂÂÂÂ bpf_jit_disasm.o
>>> ÂÂÂ LINKÂÂÂÂ bpf_jit_disasm
>>> ÂÂÂ CCÂÂÂÂÂÂ bpf_dbg.o
>>> ÂÂÂ LINKÂÂÂÂ bpf_dbg
>>> ÂÂÂ CCÂÂÂÂÂÂ bpf_asm.o
>>> ÂÂÂ BISONÂÂÂ bpf_exp.yacc.c
>>> ÂÂÂ CCÂÂÂÂÂÂ bpf_exp.yacc.o
>>> ÂÂÂ FLEXÂÂÂÂ bpf_exp.lex.c
>>> ÂÂÂ CCÂÂÂÂÂÂ bpf_exp.lex.o
>>> ÂÂÂ LINKÂÂÂÂ bpf_asm
>>> ÂÂÂ DESCENDÂ bpftool
>>> make[1]: Entering directory
>>> '/usr/src/perf_selftests-x86_64-rhel-7.2-f6f3bac08ff9855d803081a353a1fafaa8845739/tools/bpf/bpftool'
>>>
>>>
>>> Auto-detecting system features:
>>> ...ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ libbfd: [ OFF ]
>>> ...ÂÂÂÂÂÂÂ disassembler-four-args: [ OFF ]
>>>
>>> ÂÂÂ CCÂÂÂÂÂÂ map_perf_ring.o
>>> ÂÂÂ CCÂÂÂÂÂÂ xlated_dumper.o
>>> ÂÂÂ CCÂÂÂÂÂÂ perf.o
>>> ÂÂÂ CCÂÂÂÂÂÂ prog.o
>>> ÂÂÂ CCÂÂÂÂÂÂ btf_dumper.o
>>> ÂÂÂ CCÂÂÂÂÂÂ net.o
>>> ÂÂÂ CCÂÂÂÂÂÂ netlink_dumper.o
>>> Makefile:96: recipe for target 'netlink_dumper.o' failed
>>> make[1]: Leaving directory
>>> '/usr/src/perf_selftests-x86_64-rhel-7.2-f6f3bac08ff9855d803081a353a1fafaa8845739/tools/bpf/bpftool'
>>>
>>> Makefile:99: recipe for target 'bpftool' failed
>>> make: Leaving directory
>>> '/usr/src/perf_selftests-x86_64-rhel-7.2-f6f3bac08ff9855d803081a353a1fafaa8845739/tools/bpf'
>>>
>>>
>>>
>>>
>>> To reproduce:
>>>
>>> ÂÂÂÂÂÂÂÂÂ git clone https://github.com/intel/lkp-tests.git
>>> ÂÂÂÂÂÂÂÂÂ cd lkp-tests
>>>  bin/lkp install job.yaml # job file is attached in this email
>>> ÂÂÂÂÂÂÂÂÂ bin/lkp runÂÂÂÂ job.yaml
>>>
>>>
>>>
>>> Thanks,
>>> Rong Chen
>>>
>> _______________________________________________
>> LKP mailing list
>> LKP@xxxxxxxxxxxx
>> https://urldefense.proofpoint.com/v2/url?u=https-3A__lists.01.org_mailman_listinfo_lkp&d=DwICaQ&c=5VD0RTtNlTh3ycd41b3MUw&r=DA8e1B5r073vIqRrFz7MRA&m=i-U02mQoRDr-xyq3FJ8tEDa1ZmiDy-Igc5W5JAQVtO8&s=YI-mc76fJVQbNj367iCD2avQgWoFkb-z1zZhjg7liD8&e=
>>