net: explain "protection types" for the instance lock
authorJakub Kicinski <kuba@kernel.org>
Mon, 24 Mar 2025 22:45:30 +0000 (15:45 -0700)
committerJakub Kicinski <kuba@kernel.org>
Tue, 25 Mar 2025 17:06:44 +0000 (10:06 -0700)
commit4b702f8b72c7b05daa1b763fdc0840aa78178c3a
tree51dec262188c65f5bcd29af24fbeb30f41a5b15d
parente2f81e8f4d0c3109e1a18620c931fe16bfb235ef
net: explain "protection types" for the instance lock

Try to define some terminology for which fields are protected
by which lock and how. Some fields are protected by both rtnl_lock
and instance lock which is hard to talk about without having
a "key phrase" to refer to a particular protection scheme.

"ops protected" fields are defined later in the series, one by one.

Add ASSERT_RTNL() to netdev_ops_assert_locked() for drivers
not other instance protection of ops. Hopefully it's not too
confusion that netdev_lock_ops() does not match the lock which
netdev_ops_assert_locked() will assert, exactly. The noun "ops"
is in a different place in the name, so I think it's acceptable...

Acked-by: Stanislav Fomichev <sdf@fomichev.me>
Link: https://patch.msgid.link/20250324224537.248800-5-kuba@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
include/linux/netdevice.h
include/net/netdev_lock.h