Bug 11813 - [Anolis23.2][6.6.25-2.2_rc1][x86_64] kernel-selftests测试,bpf.test_offload.py执行Fail
Summary: [Anolis23.2][6.6.25-2.2_rc1][x86_64] kernel-selftests测试,bpf.test_offload.py执行...
Status: CONFIRMED
Alias: None
Product: ANCK 6.6 Dev
Classification: ANCK
Component: bpf (show other bugs) bpf
Version: 6.6.25-2.2
Hardware: All Linux
: P3-Medium S3-normal
Target Milestone: ---
Assignee: banye97
QA Contact:
URL:
Whiteboard:
Keywords: Function
Depends on:
Blocks:
 
Reported: 2024-11-12 11:50 UTC by anolislw
Modified: 2024-11-15 14:24 UTC (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description anolislw alibaba_cloud_group 2024-11-12 11:50:20 UTC
[问题描述]
内部的物理机anolis23 x86环境下,内核为6.6.25-2.2_rc1.an23.x86_64系统上,kernel-selftests测试,bpf.test_offload.py执行Fail

[实际结果]
[root@5f9Lab15 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 failure...
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 MTU restrictions...
Test non-offload XDP attaching to HW...
Test offload XDP attaching to drv...
Test XDP load failure...
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...
Traceback (most recent call last):
  File "/root/rpmbuild/BUILD/kernel-6.6.25-2.2_rc1.an23/linux-6.6.25-2.2_rc1.an23.x86_64/tools/testing/selftests/bpf/./test_offload.py", line 1098, in <module>
    bpftool_prog_list_wait(expected=0)
  File "/root/rpmbuild/BUILD/kernel-6.6.25-2.2_rc1.an23/linux-6.6.25-2.2_rc1.an23.x86_64/tools/testing/selftests/bpf/./test_offload.py", line 196, in bpftool_prog_list_wait
    nprogs = len(bpftool_prog_list())
                 ^^^^^^^^^^^^^^^^^^^
  File "/root/rpmbuild/BUILD/kernel-6.6.25-2.2_rc1.an23/linux-6.6.25-2.2_rc1.an23.x86_64/tools/testing/selftests/bpf/./test_offload.py", line 173, in bpftool_prog_list
    _, progs = bpftool("prog show", JSON=True, ns=ns, fail=True)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/rpmbuild/BUILD/kernel-6.6.25-2.2_rc1.an23/linux-6.6.25-2.2_rc1.an23.x86_64/tools/testing/selftests/bpf/./test_offload.py", line 169, in bpftool
    return tool("bpftool", args, {"json":"-p"}, JSON=JSON, ns=ns,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/rpmbuild/BUILD/kernel-6.6.25-2.2_rc1.an23/linux-6.6.25-2.2_rc1.an23.x86_64/tools/testing/selftests/bpf/./test_offload.py", line 155, in tool
    ret, stdout = cmd(ns + name + " " + params + args,
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/rpmbuild/BUILD/kernel-6.6.25-2.2_rc1.an23/linux-6.6.25-2.2_rc1.an23.x86_64/tools/testing/selftests/bpf/./test_offload.py", line 109, in cmd
    return cmd_result(proc, include_stderr=include_stderr, fail=fail)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/rpmbuild/BUILD/kernel-6.6.25-2.2_rc1.an23/linux-6.6.25-2.2_rc1.an23.x86_64/tools/testing/selftests/bpf/./test_offload.py", line 131, in cmd_result
    raise Exception("Command failed: %s\n%s" % (proc.args, stderr))
Exception: Command failed: bpftool -p prog show


[期望结果]
case pass

[复现步骤]
1. wget https://build.openanolis.cn/kojifiles/output/nightly/anolis-23-20241101.5/compose/os/source/tree/Packages/kernel-6.6.25-2.2_rc1.an23.src.rpm
2. rpm -i kernel-6.6.25-2.2_rc1.an23.src.rpm
   yum-builddep -y /root/rpmbuild/SPECS/kernel.spec 
   rpmbuild -bp /root/rpmbuild/SPECS/kernel.spec 
   cd /root/rpmbuild/BUILD/kernel-*xxx/linux-*
   make -C tools/testing/selftests/
   cd  tools/testing/selftests/
   ln -s /lib/debug/lib/modules/$(uname -r)/vmlinux /lib/modules/$(uname -r)/build/
   make KDIR=/lib/modules/$(uname -r)/build/ -C bpf/
   cd bpf;./test_offload.py

[环境信息]
[root@5f9Lab15 resctrl]# uname -a
Linux 5f9Lab15 6.6.25-2.2_rc1.an23.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Oct 31 21:26:10 CST 2024 x86_64 x86_64 x86_64 GNU/Linux
[root@5f9Lab15 resctrl]#
[root@5f9Lab15 resctrl]# cat /proc/cmdline
BOOT_IMAGE=(hd1,gpt2)/vmlinuz-6.6.25-2.2_rc1.an23.x86_64 root=UUID=dca78281-9421-4a9b-9bb5-c4ec9804a355 ro resume=UUID=85dbb4f6-3cdd-4b68-b32e-ddfef04aaf1a rhgb quiet selinux=0 cgroup.memory=nokmem crashkernel=0M-2G:0M,2G-8G:192M,8G-:256M
[root@5f9Lab15 resctrl]#
[root@5f9Lab15 resctrl]# df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/sda4       444G   18G  426G   5% /
devtmpfs        4.0M  600K  3.5M  15% /dev
tmpfs           126G     0  126G   0% /dev/shm
efivarfs        268K  164K  100K  63% /sys/firmware/efi/efivars
tmpfs            51G  2.5M   51G   1% /run
tmpfs           126G   56M  126G   1% /tmp
/dev/sda2       960M  234M  727M  25% /boot
/dev/sda1       200M  6.2M  194M   4% /boot/efi
tmpfs            26G   48K   26G   1% /run/user/0
[root@5f9Lab15 resctrl]#
[root@5f9Lab15 resctrl]# free -g
               total        used        free      shared  buff/cache   available
Mem:             251           3         249           0           0         248
Swap:              1           0           1
[root@5f9Lab15 resctrl]#
[root@5f9Lab15 resctrl]# lscpu
Architecture:             x86_64
  CPU op-mode(s):         32-bit, 64-bit
  Address sizes:          46 bits physical, 57 bits virtual
  Byte Order:             Little Endian
CPU(s):                   48
  On-line CPU(s) list:    0-47
Vendor ID:                GenuineIntel
  BIOS Vendor ID:         Intel(R) Corporation
  Model name:             Intel(R) Xeon(R) Silver 4310 CPU @ 2.10GHz
    BIOS Model name:      Intel(R) Xeon(R) Silver 4310 CPU @ 2.10GHz  CPU @ 2.1GHz
    BIOS CPU family:      179
    CPU family:           6
    Model:                106
    Thread(s) per core:   2
    Core(s) per socket:   12
    Socket(s):            2
    Stepping:             6
    CPU(s) scaling MHz:   27%
    CPU max MHz:          3300.0000
    CPU min MHz:          800.0000
    BogoMIPS:             4200.00
    Flags:                fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss
                           ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonsto
                          p_tsc cpuid aperfmperf pni pclmulqdq dtes64 ds_cpl vmx smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid dca sse
                          4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_f
                          ault epb cat_l3 ssbd mba ibrs ibpb stibp ibrs_enhanced tpr_shadow flexpriority ept vpid ept_ad fsgsbase tsc_a
                          djust bmi1 hle avx2 smep bmi2 erms invpcid rtm cqm rdt_a avx512f avx512dq rdseed adx smap avx512ifma clflusho
                          pt clwb intel_pt avx512cd sha_ni avx512bw avx512vl xsaveopt xsavec xgetbv1 xsaves cqm_llc cqm_occup_llc cqm_m
                          bm_total cqm_mbm_local split_lock_detect wbnoinvd dtherm ida arat pln pts vnmi avx512vbmi umip pku ospke avx5
                          12_vbmi2 gfni vaes vpclmulqdq avx512_vnni avx512_bitalg tme avx512_vpopcntdq rdpid fsrm md_clear pconfig flus
                          h_l1d arch_capabilities
Virtualization features:
  Virtualization:         VT-x
Caches (sum of all):
  L1d:                    1.1 MiB (24 instances)
  L1i:                    768 KiB (24 instances)
  L2:                     30 MiB (24 instances)
  L3:                     36 MiB (2 instances)
NUMA:
  NUMA node(s):           2
  NUMA node0 CPU(s):      0-11,24-35
  NUMA node1 CPU(s):      12-23,36-47
Vulnerabilities:
  Gather data sampling:   Mitigation; Microcode
  Itlb multihit:          Not affected
  L1tf:                   Not affected
  Mds:                    Not affected
  Meltdown:               Not affected
  Mmio stale data:        Mitigation; Clear CPU buffers; SMT vulnerable
  Reg file data sampling: Not affected
  Retbleed:               Not affected
  Spec rstack overflow:   Not affected
  Spec store bypass:      Mitigation; Speculative Store Bypass disabled via prctl
  Spectre v1:             Mitigation; usercopy/swapgs barriers and __user pointer sanitization
  Spectre v2:             Mitigation; Enhanced / Automatic IBRS, IBPB conditional, RSB filling, PBRSB-eIBRS SW sequence
  Srbds:                  Not affected
  Tsx async abort:        Not affected


[问题定位]
在内部的6.6内核上,这个case也有问题,回合了path: https://gitee.com/anolis/cloud-kernel/pulls/3980
检查了下当前的内核上不包含这个path内容,帮忙评估下问题是否受该path影响
Comment 1 zhangxinyi alibaba_cloud_group 2024-11-13 17:44:41 UTC
需要回合patch https://gitee.com/anolis/cloud-kernel/pulls/3980
Comment 2 banye97 alibaba_cloud_group 2024-11-15 10:19:11 UTC
非 6.6.25-2.2 新增问题,暂不修复,下个版本统一修复。