[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20241107022900.70287-1-kuniyu@amazon.com>
Date: Wed, 6 Nov 2024 18:28:50 -0800
From: Kuniyuki Iwashima <kuniyu@...zon.com>
To: "David S. Miller" <davem@...emloft.net>, Eric Dumazet
<edumazet@...gle.com>, Jakub Kicinski <kuba@...nel.org>, Paolo Abeni
<pabeni@...hat.com>, Simon Horman <horms@...nel.org>
CC: Andrew Lunn <andrew+netdev@...n.ch>, Marc Kleine-Budde
<mkl@...gutronix.de>, Vincent Mailhol <mailhol.vincent@...adoo.fr>, "Daniel
Borkmann" <daniel@...earbox.net>, Nikolay Aleksandrov <razor@...ckwall.org>,
Kuniyuki Iwashima <kuniyu@...zon.com>, Kuniyuki Iwashima
<kuni1840@...il.com>, <netdev@...r.kernel.org>
Subject: [PATCH v3 net-next 00/10] rtnetlink: Convert rtnl_newlink() to per-netns RTNL.
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)
Powered by blists - more mailing lists