netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 net-next 00/10] rtnetlink: Convert rtnl_newlink() to per-netns RTNL.
@ 2024-11-07  2:28 Kuniyuki Iwashima
  2024-11-07  2:28 ` [PATCH v3 net-next 01/10] rtnetlink: Remove __rtnl_link_unregister() Kuniyuki Iwashima
                   ` (9 more replies)
  0 siblings, 10 replies; 12+ messages in thread
From: Kuniyuki Iwashima @ 2024-11-07  2:28 UTC (permalink / raw)
  To: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Simon Horman
  Cc: Andrew Lunn, Marc Kleine-Budde, Vincent Mailhol, Daniel Borkmann,
	Nikolay Aleksandrov, Kuniyuki Iwashima, Kuniyuki Iwashima, netdev

Patch 1 - 3 removes __rtnl_link_unregister() and protects link_ops by
its dedicated mutex to move synchronize_srcu() out of the RTNL scope.

Patch 4 introduces struct rtnl_nets and helper functions to acquire
multiple per-netns RTNL in rtnl_newlink().

Patch 5 - 8 are to prefetch the peer device's netns in rtnl_newlink().

Patch 9 converts rtnl_newlink() to per-netns RTNL.

Patch 10 pushes RTNL down to rtnl_dellink() and rtnl_setlink(), but
the conversion will not be completed unless we support cases with
peer/upper/lower devices.

I confirmed v3 survived ./rtnetlink.sh; rmmod netdevsim.ko; without
lockdep splat.


Changes:
  v3:
    * Add patch 1~3 to avoid SRCU & RTNL deadlock

  v2: https://lore.kernel.org/netdev/20241106022432.13065-1-kuniyu@amazon.com/
    * Patch 1
      * Move struct rtnl_nets to rtnetlink.c
      * Unexport rtnl_nets_add()
    * Patch 2
      * Rename the helper to rtnl_link_get_net_ifla()
      * Unexport rtnl_link_get_net_ifla()
      * Change peer_type to u16
    * Patch 6
      * Remove __rtnl_unlock() dance

  v1: https://lore.kernel.org/netdev/20241105020514.41963-1-kuniyu@amazon.com/


Kuniyuki Iwashima (10):
  rtnetlink: Remove __rtnl_link_unregister().
  rtnetlink: Protect link_ops by mutex.
  rtnetlink: Remove __rtnl_link_register()
  rtnetlink: Introduce struct rtnl_nets and helpers.
  rtnetlink: Add peer_type in struct rtnl_link_ops.
  veth: Set VETH_INFO_PEER to veth_link_ops.peer_type.
  vxcan: Set VXCAN_INFO_PEER to vxcan_link_ops.peer_type.
  netkit: Set IFLA_NETKIT_PEER_INFO to netkit_link_ops.peer_type.
  rtnetlink: Convert RTM_NEWLINK to per-netns RTNL.
  rtnetlink: Register rtnl_dellink() and rtnl_setlink() with
    RTNL_FLAG_DOIT_PERNET_WIP.

 drivers/net/can/vxcan.c  |  12 +-
 drivers/net/dummy.c      |  17 ++-
 drivers/net/ifb.c        |  17 ++-
 drivers/net/netkit.c     |  11 +-
 drivers/net/veth.c       |  18 +--
 include/net/rtnetlink.h  |   8 +-
 net/core/net_namespace.c |   1 -
 net/core/rtnetlink.c     | 257 ++++++++++++++++++++++++++++-----------
 8 files changed, 217 insertions(+), 124 deletions(-)

-- 
2.39.5 (Apple Git-154)


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

end of thread, other threads:[~2024-11-08  0:02 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-07  2:28 [PATCH v3 net-next 00/10] rtnetlink: Convert rtnl_newlink() to per-netns RTNL Kuniyuki Iwashima
2024-11-07  2:28 ` [PATCH v3 net-next 01/10] rtnetlink: Remove __rtnl_link_unregister() Kuniyuki Iwashima
2024-11-07  2:28 ` [PATCH v3 net-next 02/10] rtnetlink: Protect link_ops by mutex Kuniyuki Iwashima
2024-11-07  2:28 ` [PATCH v3 net-next 03/10] rtnetlink: Remove __rtnl_link_register() Kuniyuki Iwashima
2024-11-07  2:28 ` [PATCH v3 net-next 04/10] rtnetlink: Introduce struct rtnl_nets and helpers Kuniyuki Iwashima
2024-11-07  2:28 ` [PATCH v3 net-next 06/10] veth: Set VETH_INFO_PEER to veth_link_ops.peer_type Kuniyuki Iwashima
2024-11-07  2:28 ` [PATCH v3 net-next 07/10] vxcan: Set VXCAN_INFO_PEER to vxcan_link_ops.peer_type Kuniyuki Iwashima
2024-11-07  2:28 ` [PATCH v3 net-next 08/10] netkit: Set IFLA_NETKIT_PEER_INFO to netkit_link_ops.peer_type Kuniyuki Iwashima
2024-11-07  2:28 ` [PATCH v3 net-next 09/10] rtnetlink: Convert RTM_NEWLINK to per-netns RTNL Kuniyuki Iwashima
2024-11-07  2:29 ` [PATCH v3 net-next 10/10] rtnetlink: Register rtnl_dellink() and rtnl_setlink() with RTNL_FLAG_DOIT_PERNET_WIP Kuniyuki Iwashima
2024-11-07 23:53 ` [PATCH v3 net-next 00/10] rtnetlink: Convert rtnl_newlink() to per-netns RTNL Jakub Kicinski
2024-11-08  0:02   ` Kuniyuki Iwashima

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).