Hi Jakub,
On 21/09/2026 21:04, Jakub Kicinski wrote:
netdev netlink iterates over devices when dumping queues/NAPIs/qstats
etc. and takes rtnl_lock or instance lock depending on the underlying
device. Currently even if all the "real" devices in the system are ops
locked we still have to take rtnl_lock for lo (only to find out
that it doesn't even have queues or NAPIs to report).
Opt loopback into having control path under the ops lock.
This is a pretty obvious thing to do, I've held back this
patch because we used to only apply ops locking on physical devices.
netkit queue leasing made a precedent for (far more complex)
SW devices enabling ops locking. Now adding it to lo should
not create much new bug surface.
I considered an alternative of adding a "predicate" to the iteration
primitive so that we can skip the devices which obviously don't
support given API (eg qstat) without any locking. But it's more
LoC and real_num_.x_queues is not currently WRITE_ONCE()ed so
it doesn't work too well for queues.
Thank you for this! But apparently, it looks like it is still causing
some issues with the BPF selftests for some arch, e.g.
https://github.com/kernel-patches/bpf/actions/runs/35693264483/job/106636983010
Cheers,
Matt
---
(I don't know if I have the rights to ask for ↓)
pw-bot: cr