Re: [selftests/bpf] 6135bdd95f: kernel_selftests.bpf.test_offload.py.fail

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Jul 5, 2019 at 12:43 AM kernel test robot <rong.a.chen@xxxxxxxxx> wrote:
>
> FYI, we noticed the following commit (built with gcc-7):
>
> commit: 6135bdd95f26fe417db4e46d1e517de41e0ab9c1 ("[PATCH v2 bpf-next 4/4] selftests/bpf: convert legacy BPF maps to BTF-defined ones")
> url: https://github.com/0day-ci/linux/commits/Andrii-Nakryiko/capture-integers-in-BTF-type-info-for-map-defs/20190701-041153
> base: https://kernel.googlesource.com/pub/scm/linux/kernel/git/bpf/bpf-next.git master
>
> in testcase: kernel_selftests
> with following parameters:
>
>         group: kselftests-00
>
> test-description: The kernel contains a set of "self tests" under the tools/testing/selftests/ directory. These are intended to be small unit tests to exercise individual code paths in the kernel.
> test-url: https://www.kernel.org/doc/Documentation/kselftest.txt
>
>
> on test machine: qemu-system-x86_64 -enable-kvm -cpu SandyBridge -smp 2 -m 8G
>
> caused below changes (please refer to attached dmesg/kmsg for entire log/backtrace):
>
>
> If you fix the issue, kindly add following tag
> Reported-by: kernel test robot <rong.a.chen@xxxxxxxxx>
>
>
> # selftests: bpf: test_offload.py
> # Test destruction of generic XDP...
> # Test TC non-offloaded...
> # Test TC non-offloaded isn't getting bound...
> # Test TC offloads are off by default...
> # Test TC offload by default...
> # Test TC cBPF bytcode tries offload by default...
> # Test TC cBPF unbound bytecode doesn't offload...
> # Test non-0 chain offload...
> # Test TC replace...
> # Test TC replace bad flags...
> # Test spurious extack from the driver...
> # Test TC offloads work...
> # Test TC offload basics...
> # Test TC offload is device-bound...
> # Test disabling TC offloads is rejected while filters installed...
> # Test qdisc removal frees things...
> # Test disabling TC offloads is OK without filters...
> # Test destroying device gets rid of TC filters...
> # Test destroying device gets rid of XDP...
> # Test XDP prog reporting...
> # Test XDP prog replace without force...
> # Test XDP prog replace with force...
> # Test XDP prog replace with bad flags...
> # Test XDP prog remove with bad flags...
> # Test MTU restrictions...
> # Test non-offload XDP attaching to HW...
> # Test offload XDP attaching to drv...
> # Test XDP offload...
> # Test XDP offload is device bound...
> # Test removing XDP program many times...
> # Test attempt to use a program for a wrong device...
> # Test multi-attachment XDP - default + offload...
> # Test multi-attachment XDP - replace...
> # Test multi-attachment XDP - detach...
> # Test multi-attachment XDP - reattach...
> # Test multi-attachment XDP - device remove...
> # Test multi-attachment XDP - drv + offload...
> # Test multi-attachment XDP - replace...
> # Test multi-attachment XDP - detach...
> # Test multi-attachment XDP - reattach...
> # Test multi-attachment XDP - device remove...
> # Test multi-attachment XDP - generic + offload...
> # Test multi-attachment XDP - replace...
> # Test multi-attachment XDP - reattach...
> # Test multi-attachment XDP - device remove...
> # Test mixing of TC and XDP...
> # Test binding TC from pinned...
> # Test binding XDP from pinned...
> # Test offload of wrong type fails...
> # Test asking for TC offload of two filters...
> # Test if netdev removal waits for translation...
> # Test loading program with maps...
> # Traceback (most recent call last):
> #   File "./test_offload.py", line 1153, in <module>
> #     sim.set_xdp(map_obj, "offload", JSON=False) # map fixup msg breaks JSON
> #   File "./test_offload.py", line 469, in set_xdp
> #     fail=fail, include_stderr=include_stderr)
> #   File "./test_offload.py", line 230, in ip
> #     fail=fail, include_stderr=include_stderr)
> #   File "./test_offload.py", line 155, in tool
> #     fail=fail, include_stderr=False)
> #   File "./test_offload.py", line 108, in cmd
> #     return cmd_result(proc, include_stderr=include_stderr, fail=fail)
> #   File "./test_offload.py", line 130, in cmd_result
> #     raise Exception("Command failed: %s\n%s" % (proc.args, stderr))
> # Exception: Command failed: ip link set dev eth1 xdpoffload obj /usr/src/perf_selftests-x86_64-rhel-7.6-6135bdd95f26fe417db4e46d1e517de41e0ab9c1/tools/testing/selftests/bpf/sample_map_ret0.o sec .text

We can't yet convert BPF programs that are loaded with iproute2 to new
BTF-defined maps, until iprout2 uses libbpf as a loader. I missed that
sample_map_ret0.c is used with iproute2, will undo conversion for it.

Thanks!

> #
> #
> # BTF debug data section '.BTF' rejected: Invalid argument (22)!
> #  - Length:       811
> # Verifier analysis:
> #
> # magic: 0xeb9f
> # version: 1
> # flags: 0x0
> # hdr_len: 24
> # type_off: 0
> # type_len: 384
> # str_off: 384
> # str_len: 403
> # btf_total_size: 811
> # [1] FUNC_PROTO (anon) return=2 args=(void)
> # [2] INT int size=4 bits_offset=0 nr_bits=32 encoding=SIGNED
> # [3] FUNC func type_id=1
> # [4] STRUCT (anon) size=32 vlen=4
> #       type type_id=5 bits_offset=0
> #       max_entries type_id=8 bits_offset=64
> #       key type_id=10 bits_offset=128
> #       value type_id=13 bits_offset=192
> # [5] PTR (anon) type_id=6
> # [6] ARRAY (anon) type_id=2 index_type_id=7 nr_elems=1
> # [7] INT __ARRAY_SIZE_TYPE__ size=4 bits_offset=0 nr_bits=32 encoding=(none)
> # [8] PTR (anon) type_id=9
> # [9] ARRAY (anon) type_id=2 index_type_id=7 nr_elems=2
> # [10] PTR (anon) type_id=11
> # [11] TYPEDEF __u32 type_id=12
> # [12] INT unsigned int size=4 bits_offset=0 nr_bits=32 encoding=(none)
> # [13] PTR (anon) type_id=14
> # [14] INT long int size=8 bits_offset=0 nr_bits=64 encoding=SIGNED
> # [15] VAR htab type_id=4 linkage=1
> # [16] STRUCT (anon) size=32 vlen=4
> #       type type_id=8 bits_offset=0
> #       max_entries type_id=8 bits_offset=64
> #       key type_id=10 bits_offset=128
> #       value type_id=13 bits_offset=192
> # [17] VAR array type_id=16 linkage=1
> # [18] DATASEC .maps size=0 vlen=2 size == 0
> #
> #
> # Prog section '.text' rejected: Permission denied (13)!
> #  - Type:         6
> #  - Instructions: 21 (0 over limit)
> #  - License:
> #
> # Verifier analysis:
> #
> # 0: (b7) r1 = 0
> # 1: (7b) *(u64 *)(r10 -8) = r1
> # last_idx 1 first_idx 0
> # regs=2 stack=0 before 0: (b7) r1 = 0
> # 2: (63) *(u32 *)(r10 -12) = r1
> # 3: (bf) r2 = r10
> # 4: (07) r2 += -12
> # 5: (18) r1 = 0x0
> # 7: (85) call bpf_map_lookup_elem#1
> # R1 type=inv expected=map_ptr
> # processed 7 insns (limit 1000000) max_states_per_insn 0 total_states 0 peak_states 0 mark_read 0
> #
> # Error fetching program/map!
> not ok 34 selftests: bpf: test_offload.py
>
>
> To reproduce:
>
>         # build kernel
>         cd linux
>         cp config-5.2.0-rc5-01621-g6135bdd95f26f .config
>         make HOSTCC=gcc-7 CC=gcc-7 ARCH=x86_64 olddefconfig prepare modules_prepare bzImage
>
>         git clone https://github.com/intel/lkp-tests.git
>         cd lkp-tests
>         bin/lkp qemu -k <bzImage> job-script # job-script is attached in this email
>
>
>
> Thanks,
> Rong Chen
>



[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux