Bug 266735 - Getting Lock order reversal: bpf global lock, iflib ctx lock error when booting machine
Summary: Getting Lock order reversal: bpf global lock, iflib ctx lock error when booti...
Status: New
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: CURRENT
Hardware: amd64 Any
: --- Affects Only Me
Assignee: Mark Johnston
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-10-01 08:26 UTC by Alfa
Modified: 2022-11-22 23:12 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 Alfa 2022-10-01 08:26:31 UTC
Hi,
I am currently testing FreeBSD 14.0 Current

FreeBSD alfadev 14.0-CURRENT FreeBSD 14.0-CURRENT #1: Fri Sep 30 11:55:56 +03 2022

When machine has started I am getting Lock order reversal messages from kernel :


Oct  1 10:24:17 alfa kernel: em1: link state changed to DOWN
Oct  1 10:24:18 alfa kernel: lock order reversal:
Oct  1 10:24:18 alfa kernel:  1st 0xffffffff81f966a8 bpf global lock (bpf global lock, sx) @ /usr/src/sys/net/bpf.c:1518
Oct  1 10:24:18 alfa kernel:  2nd 0xfffff80003c24d80 iflib ctx lock (iflib ctx lock, sx) @ /usr/src/sys/net/iflib.c:4373
Oct  1 10:24:18 alfa kernel: lock order iflib ctx lock -> bpf global lock established at:
Oct  1 10:24:18 alfa kernel: #0 0xffffffff80c5eacd at witness_checkorder+0x32d
Oct  1 10:24:18 alfa kernel: #1 0xffffffff80bf8dd3 at _sx_xlock+0x63
Oct  1 10:24:18 alfa kernel: #2 0xffffffff80d111b8 at bpfattach2+0xd8
Oct  1 10:24:18 alfa kernel: #3 0xffffffff80d2178b at ether_ifattach+0xeb
Oct  1 10:24:18 alfa kernel: #4 0xffffffff80d35bbb at iflib_device_register+0xceb
Oct  1 10:24:18 alfa kernel: #5 0xffffffff80d3a2c5 at iflib_device_attach+0xb5
Oct  1 10:24:18 alfa kernel: #6 0xffffffff80c2a801 at device_attach+0x3c1
Oct  1 10:24:18 alfa kernel: #7 0xffffffff80c2a3b0 at device_probe_and_attach+0x70
Oct  1 10:24:18 alfa kernel: #8 0xffffffff80c2b9f8 at bus_generic_attach+0x18
Oct  1 10:24:18 alfa kernel: #9 0xffffffff8083c920 at pci_attach+0xe0
Oct  1 10:24:18 alfa kernel: #10 0xffffffff80fdf759 at acpi_pci_attach+0x19
Oct  1 10:24:18 alfa kernel: #11 0xffffffff80c2a801 at device_attach+0x3c1
Oct  1 10:24:18 alfa kernel: #12 0xffffffff80c2a3b0 at device_probe_and_attach+0x70
Oct  1 10:24:18 alfa kernel: #13 0xffffffff80c2b9f8 at bus_generic_attach+0x18
Oct  1 10:24:18 alfa kernel: #14 0xffffffff80fe3490 at acpi_pcib_pci_attach+0xa0
Oct  1 10:24:18 alfa kernel: #15 0xffffffff80c2a801 at device_attach+0x3c1
Oct  1 10:24:18 alfa kernel: #16 0xffffffff80c2a3b0 at device_probe_and_attach+0x70
Oct  1 10:24:18 alfa kernel: #17 0xffffffff80c2b9f8 at bus_generic_attach+0x18
Oct  1 10:24:18 alfa kernel: lock order bpf global lock -> iflib ctx lock attempted at:
Oct  1 10:24:18 alfa kernel: #0 0xffffffff80c5f39d at witness_checkorder+0xbfd
Oct  1 10:24:18 alfa kernel: #1 0xffffffff80bf8dd3 at _sx_xlock+0x63
Oct  1 10:24:18 alfa kernel: #2 0xffffffff80d41a6f at iflib_if_ioctl+0x2df
Oct  1 10:24:18 alfa kernel: #3 0xffffffff80d1c9ce at if_setflag+0xde
Oct  1 10:24:18 alfa kernel: #4 0xffffffff80d1c89a at ifpromisc+0x2a
Oct  1 10:24:18 alfa kernel: #5 0xffffffff80d1374d at bpfioctl+0xe9d
Oct  1 10:24:18 alfa kernel: #6 0xffffffff80a7e1cd at devfs_ioctl+0xcd
Oct  1 10:24:18 alfa kernel: #7 0xffffffff80cf6eb1 at vn_ioctl+0x131
Oct  1 10:24:18 alfa kernel: #8 0xffffffff80a7e87e at devfs_ioctl_f+0x1e
Oct  1 10:24:18 alfa kernel: #9 0xffffffff80c65102 at kern_ioctl+0x202
Oct  1 10:24:18 alfa kernel: #10 0xffffffff80c64e4a at sys_ioctl+0x12a
Oct  1 10:24:18 alfa kernel: #11 0xffffffff8110541e at amd64_syscall+0x12e
Oct  1 10:24:18 alfa kernel: #12 0xffffffff810d8c5b at fast_syscall_common+0xf8

I didn't recognize any problem while getting above messages.
Comment 1 Xin LI freebsd_committer freebsd_triage 2022-11-22 23:12:08 UTC
This seems to be introduced in 220818ac030726c24cbf9df6df5c9d019993b875 .