mbox series

[v2,net-next,0/7] rtnetlink: Convert rtnl_newlink() to per-netns RTNL.

Message ID 20241106022432.13065-1-kuniyu@amazon.com (mailing list archive)
Headers show
Series rtnetlink: Convert rtnl_newlink() to per-netns RTNL. | expand

Message

Kuniyuki Iwashima Nov. 6, 2024, 2:24 a.m. UTC
Patch 1 introduces struct rtnl_nets and helper functions to acquire
multiple per-netns RTNL in rtnl_newlink().

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

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

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


Changes:
  v2
    * 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 (7):
  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/netkit.c    |  11 +--
 drivers/net/veth.c      |  18 +----
 include/net/rtnetlink.h |   3 +
 net/core/rtnetlink.c    | 171 +++++++++++++++++++++++++++++++++++++---
 5 files changed, 170 insertions(+), 45 deletions(-)