Re: [BUG?] loxilb tc BPF program cause Loongarch kernel hard lockup

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

 



Sorry I had a type error on the loongarch mailing list address, corrected it.

On Thu, Mar 6, 2025 at 1:44 PM Cong Wang <xiyou.wangcong@xxxxxxxxx> wrote:
>
> On Wed, Mar 05, 2025 at 04:51:15PM -0800, Vincent Li wrote:
> > Hi,
> >
> > I have an issue recorded here [0] with kernel call trace  when I start
> > loxilb, the loxilb tc BPF program seems to be loaded and attached to
> > the network interface, but immediately it causes a loongarch kernel
> > hard lockup, no keyboard response. Sometimes the panic call trace
> > shows up in the monitor screen after I disabled kernel panic reboot
> > (echo 0 > /proc/sys/kernel/panic) and started loxilb.
> >
> > Background: I ported open source IPFire [1] to Loongarch CPU
> > architecture and enabled kernel BPF features, added loxilb as LFS
> > (Linux from scratch) addon software, loxilb 0.9.8.3 has libbpf 1.5.0
> > which has loongarch support [2]. The same loxilb addon runs fine on
> > x86 architecture. Any clue on this?
> >
> > [0]: https://github.com/vincentmli/BPFire/issues/76
> > [1]: https://github.com/ipfire/ipfire-2.x
> > [2]: https://github.com/loxilb-io/loxilb/issues/972
> >
>
> Thanks for your report!
>
> I have extracted the kernel crash log from your photo with AI so that
> people can easily interpret it.
>

Nice to know AI could do that :)

> From a quick glance, it seems related to MIPS JIT. So it would be
> helpful if you could locate the eBPF program which triggered this and
> dump its JIT'ed BPF instructions.
>

This is call trace from Loongarch CPU so related to Loongarch BPF JIT.
the kernel seems to lockup immediately right after attaching to the
network interface. to dump the JIT'ed BPF instructions, maybe just
load the BPF program, but not attach it so I can dump the BPF
instructions?

> --------------------
>
> 09:37:42 DEBUG common_libbpf.c:161: tc: autoload sec tc_packet_hook2 prog tc_packet_func_slow
> 09:37:42 DEBUG common_libbpf.c:161: tc: autoload sec tc_packet_hook3 prog tc_packet_func_fw
> 09:37:42 DEBUG common_libbpf.c:161: tc: autoload sec tc_packet_hook4 prog tc_csum_func1
> 09:37:42 DEBUG common_libbpf.c:161: tc: autoload sec tc_packet_hook5 prog tc_csum_func2
> 09:37:42 DEBUG common_libbpf.c:161: tc: autoload sec tc_packet_hook6 prog tc_slow_path_func
> 09:37:42 DEBUG common_libbpf.c:161: tc: autoload sec tc_packet_hook7 prog tc_packet_func_map
> libbpf: Error in bpf_create_map_xattr(sh_map):Invalid argument(-22). Retrying without BTF.
> libbpf: Error in bpf_create_map_xattr:wq4t:Operation not supported(-95). Retrying without BTF.
> 09:37:44 INFO  common_libbpf.c:294: tc: bpf attach OK for req8
> 09:37:44 DEBUG loxilb_llbpf.c:3311: llb_link_prop_add: IF-req8 added idx 2 type 2
> 220c:83-95 09:37:44 shpt in bitmap added -> 3 vlan 0 -> 3
> 220c:83-05 09:37:44 ovr twintfmap added -> 3 -> 3
> 09:37:44 DEBUG loxilb_llbpf.c:6553: tcmdll_bpf_setsockopt: hook id 1 paction tc_packet_hook8
> 09:37:44 INFO  common_libbpf.c:124: tc: bpf attach start for 1018:8
> 09:37:44 ERROR common_libbpf.c:141: tc: no obj for pinpath /opt/loxilb/dp/bpf/xdp_main
> 09:37:44 ERROR common_libbpf.c:141: tc: no obj for pinpath /opt/loxilb/dp/bpf/qpm_tbl
> 09:37:44 ERROR common_libbpf.c:141: tc: no obj for pinpath /opt/loxilb/dp/bpf/intf_map
> 09:37:44 ERROR common_libbpf.c:141: tc: no obj for pinpath /opt/loxilb/dp/bpf/intf_stats_map
> 09:37:44 ERROR common_libbpf.c:141: tc: no obj for pinpath /opt/loxilb/dp/bpf/bd_stats_map
> 09:37:44 ERROR common_libbpf.c:141: tc: no obj for pinpath /opt/loxilb/dp/bpf/pkt_ring
> 09:37:44 ERROR common_libbpf.c:141: tc: no obj for pinpath /opt/loxilb/dp/bpf/cp_ring
> 09:37:44 ERROR common_libbpf.c:141: tc: no obj for pinpath /opt/loxilb/dp/bpf/ct_map
> 09:37:44 ERROR common_libbpf.c:141: tc: no obj for pinpath /opt/loxilb/dp/bpf/nat_ep_map
> 09:37:44 ERROR common_libbpf.c:141: tc: no obj for pinpath /opt/loxilb/dp/bpf/nat_cm_map
> 09:37:44 ERROR common_libbpf.c:141: tc: no obj for pinpath /opt/loxilb/dp/bpf/sess_cache
> 09:37:44 DEBUG common_libbpf.c:161: tc: autoload sec tc_packet_hook8 prog tc_packet_func_map
> [70107.629723] S0?xzkcC:bxbcCtXbwhsdc+cbxbsph-b3E+bp  tprbdccdcxtbxxmsd)  spccoc,tbcdaddcdzs.Tx;  txddbdxm  tBxbXHX  b+.b.bXH,t  kbdbtX23.MXl  BXftPXFl  tbttttt
> (Hex dump and more binary data follows)
>
> [70107.638086] Call Trace:
> [70107.638809] [<ffffffffff8003f1d67c>] bpf_prog_7092f4f2542453f74_tc_packet_func+0x9004/0xaf24
> [70107.639056] [<ffffffffff8003f580d9>] cls_bpf_classify+0x6c8/0x478 [cls_bpf]
> [70107.639368] [<0000000005535e82>] __tcf_classify+0xeep.18/0x3c4/0x408
> [70107.639570] [<0000000005549d80>] tcf_classify+0x88/0x28/0xd0
> [70107.639584] [<0000000005554cec>] tc_classify+0x4c/0x100
> [70107.639993] [<0000000055c7414>] __netif_receive_skb_core.constprop.0+0x5b4/0x1ba0
> [70107.640296] [<0000000055c74443>] __netif_receive_skb_list_core+0x184/0x228
> [70107.640521] [<0000000055c28528>] netif_receive_skb_list_internal+0x220/0x300
> [70107.640839] [<0000000055c28f48>] nepi_complete_done+0xd8/0x288
> [70107.641157] [<000000005524d0d2>] stmmac_napi_poll_rx+0x3f30/0x1208
> [70107.641470] [<000000005552e1ec>] __napi_poll+0x5c/0x230
> [70107.641801] [<000000005523b74>] net_rx_action+0x1e4/0x310
> [70107.642126] [<00000000343ec2d8>] handle_softirq+0x128/0x3d0
> [70107.642451] [<00000000343ecfb9>] irq_exit+0x3c/0xb0
> [70107.642782] [<000000005245e2c>] do_irq+0x6c/0xa0
> [70107.643125] [<000000005e4e1fd>] __ret_from_idle+0x20/0x24
> [70107.643361] [<000000005d47c88>] arch_cpu_idle+0x10/0x50
> [70107.643855] [<000000005047d9c>] default_idle_call+0x1c/0x110
> [70107.644158] [<00000000444df80>] do_idle+0x80/0x130
> [70107.644530] [<00000000444e298>] cpu_startup_entry+0x90/0x30
> [70107.644869] [<000000005d4824b>] kernel_entry_end+0xdc/0xa0
> [70107.645280] [<000000005b0e4c>] start_kernel+0x6f8/0x6f4
> [70107.645549] [<000000005b408f0>] kernel_entry+0xf8/0xf0
> [70107.645890]
> [70107.646228] Code: 00158086  00109a5  82c8d4a5  c29482085  5008f480  2a847b25  034084a5  00150ae  5c8089c0
> [70107.646591]
> [70107.646954] ---[ end trace 0000000000000000 ]---
>





[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