netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net v5 00/11] net: hold instance lock during NETDEV_UP/REGISTER
@ 2025-04-01 16:34 Stanislav Fomichev
  2025-04-01 16:34 ` [PATCH net v5 01/11] net: switch to netif_disable_lro in inetdev_init Stanislav Fomichev
                   ` (12 more replies)
  0 siblings, 13 replies; 17+ messages in thread
From: Stanislav Fomichev @ 2025-04-01 16:34 UTC (permalink / raw)
  To: netdev; +Cc: davem, edumazet, kuba, pabeni

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


^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2025-04-03 22:49 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-01 16:34 [PATCH net v5 00/11] net: hold instance lock during NETDEV_UP/REGISTER Stanislav Fomichev
2025-04-01 16:34 ` [PATCH net v5 01/11] net: switch to netif_disable_lro in inetdev_init Stanislav Fomichev
2025-04-01 16:34 ` [PATCH net v5 02/11] net: hold instance lock during NETDEV_REGISTER/UP Stanislav Fomichev
2025-04-03  0:02   ` Jakub Kicinski
2025-04-03  0:12     ` Jakub Kicinski
2025-04-03  2:34       ` Stanislav Fomichev
2025-04-01 16:34 ` [PATCH net v5 03/11] net: use netif_disable_lro in ipv6_add_dev Stanislav Fomichev
2025-04-01 16:34 ` [PATCH net v5 04/11] net: rename rtnl_net_debug to lock_debug Stanislav Fomichev
2025-04-01 16:34 ` [PATCH net v5 05/11] netdevsim: add dummy device notifiers Stanislav Fomichev
2025-04-01 16:34 ` [PATCH net v5 06/11] net: dummy: request ops lock Stanislav Fomichev
2025-04-01 16:34 ` [PATCH net v5 07/11] docs: net: document netdev notifier expectations Stanislav Fomichev
2025-04-01 16:34 ` [PATCH net v5 08/11] selftests: net: use netdevsim in netns test Stanislav Fomichev
2025-04-01 16:34 ` [PATCH net v5 09/11] net: designate XSK pool pointers in queues as "ops protected" Stanislav Fomichev
2025-04-01 16:34 ` [PATCH net v5 10/11] netdev: add "ops compat locking" helpers Stanislav Fomichev
2025-04-01 16:34 ` [PATCH net v5 11/11] netdev: don't hold rtnl_lock over nl queue info get when possible Stanislav Fomichev
2025-04-03  0:05 ` [PATCH net v5 00/11] net: hold instance lock during NETDEV_UP/REGISTER Jakub Kicinski
2025-04-03 22:50 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).