[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250401163452.622454-1-sdf@fomichev.me>
Date: Tue, 1 Apr 2025 09:34:41 -0700
From: Stanislav Fomichev <sdf@...ichev.me>
To: netdev@...r.kernel.org
Cc: davem@...emloft.net,
edumazet@...gle.com,
kuba@...nel.org,
pabeni@...hat.com
Subject: [PATCH net v5 00/11] net: hold instance lock during NETDEV_UP/REGISTER
Solving the issue reported by Cosmin in [0] requires consistent
lock during NETDEV_UP/REGISTER notifiers. This series
addresses that (along with some other fixes in net/ipv4/devinet.c
and net/ipv6/addrconf.c) and appends the patches from Jakub
that were conditional on consistent locking in NETDEV_UNREGISTER.
0: https://lore.kernel.org/netdev/700fa36b94cbd57cfea2622029b087643c80cbc9.camel@nvidia.com/
v5:
- move EXPORT_IPV6_MOD changes to patch #3 (Jakub)
- drop ret in dev_change_net_namespace (Jakub)
- drop formatting changes for __dev_change_net_namespace in do_setlink (Jakub)
- drop netdev_debug_event static inline (Jakub)
- EXPORT_SYMBOL_NS_GPL for netdev_debug_event (Jakub)
- drop sentence about manual locks in the doc (Jakub)
- add sentence about update notifiers' doc (Jakub)
v4:
- make sure EXPORT_IPV6_MOD works for !CONFIG_INET configs (Intel LKP)
v3:
- s/EXPORT_SYMBOL/EXPORT_IPV6_MOD/ for netif_disable_lro (Jakub)
- drop netdev_lockdep_set_classes mlx5 patch (Jakub)
- update doc to clarify that instance lock is held for ops-locked
devices only, also list NETDEV_UNREGISTER as unlocked (Jakub)
- drop patch that unlocks and relocks bonding and teaming
UNREGISTER notifiers (Jakub)
- lock ops (instead of unconditional instance lock) in addrconf (Jakub)
- rename rtnl_net_debug.c to lock_debug.c and share rtnl_net_debug_event
(as netdev_debug_event) with netdevsim (Jakub)
- use netdevsim in one of the existing tests that set netns (Jakub)
- add ops locks around xp_clear_dev in xsk_notifier
v2:
- export netdev_get_by_index_lock
- new patch: add netdev_lockdep_set_classes to mlx5
- new patch: exercise notifiers in netdevsim
- ignore specific locked netdev in call_netdevice_register_notifiers,
not all
Jakub Kicinski (3):
net: designate XSK pool pointers in queues as "ops protected"
netdev: add "ops compat locking" helpers
netdev: don't hold rtnl_lock over nl queue info get when possible
Stanislav Fomichev (8):
net: switch to netif_disable_lro in inetdev_init
net: hold instance lock during NETDEV_REGISTER/UP
net: use netif_disable_lro in ipv6_add_dev
net: rename rtnl_net_debug to lock_debug
netdevsim: add dummy device notifiers
net: dummy: request ops lock
docs: net: document netdev notifier expectations
selftests: net: use netdevsim in netns test
Documentation/networking/netdevices.rst | 23 ++++++++
drivers/net/dummy.c | 1 +
drivers/net/netdevsim/netdev.c | 13 +++++
drivers/net/netdevsim/netdevsim.h | 3 +
include/linux/netdevice.h | 3 +-
include/net/ip.h | 16 +++---
include/net/netdev_lock.h | 19 +++++++
include/net/netdev_rx_queue.h | 6 +-
net/core/Makefile | 2 +-
net/core/dev.c | 62 ++++++++++++++++++++-
net/core/dev.h | 15 +++++
net/core/dev_api.c | 8 +--
net/core/{rtnl_net_debug.c => lock_debug.c} | 14 +++--
net/core/netdev-genl.c | 18 +++---
net/core/rtnetlink.c | 8 +--
net/ipv4/devinet.c | 2 +-
net/ipv6/addrconf.c | 15 ++++-
net/xdp/xsk.c | 2 +
net/xdp/xsk_buff_pool.c | 7 ++-
tools/testing/selftests/net/lib.sh | 25 +++++++++
tools/testing/selftests/net/netns-name.sh | 13 +++--
21 files changed, 224 insertions(+), 51 deletions(-)
rename net/core/{rtnl_net_debug.c => lock_debug.c} (89%)
--
2.49.0
Powered by blists - more mailing lists