Skip to content

rtnetlink: Refactor rtnl_{new,del,set}link() for per-netns RTNL.

Kuniyuki Iwashima netdev 2 versions – Applied

Status from this message: This series was applied to netdev/net-next.git (main)

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest14 patches 8 repliesApplied 14/14
  2. v113 patches 15 repliesSuperseded

Changes in v2 from the cover letter

* Add Eric's Reviewed-by to patch 1-4,6,8-11, (no tag on 5,7,12-14)
* Patch 7
* Handle error of init_srcu_struct().
* Call cleanup_srcu_struct() after synchronize_srcu().
* Patch 12
* Move put_net() before errorout label
* Patch 13
* Newly added as prep for patch 14
* Patch 14
* Handle error of init_srcu_struct().
* Call cleanup_srcu_struct() after synchronize_srcu().

Patches in v2 All 14 applied

#Subject and filesSizeRepliesApplied
1/14rtnetlink: Allocate linkinfo[] as struct rtnl_newlink_tbs.net/core/rtnetlink.c+5 -30 repliesApplied
2/14rtnetlink: Call validate_linkmsg() in do_setlink().net/core/rtnetlink.c+4 -110 repliesApplied
3/14rtnetlink: Factorise do_setlink() path from __rtnl_newlink().net/core/rtnetlink.c+74 -680 repliesApplied
4/14rtnetlink: Move simple validation from __rtnl_newlink() to rtnl_newlink().net/core/rtnetlink.c+24 -190 repliesApplied
5/14rtnetlink: Move rtnl_link_ops_get() and retry to rtnl_newlink().net/core/rtnetlink.c+18 -240 repliesApplied
6/14rtnetlink: Move ops->validate to rtnl_newlink().net/core/rtnetlink.c+24 -250 repliesApplied
7/14rtnetlink: Protect struct rtnl_link_ops with SRCU.include/net/rtnetlink.h net/core/rtnetlink.c+65 -232 repliesApplied
8/14rtnetlink: Call rtnl_link_get_net_capable() in rtnl_newlink().net/core/rtnetlink.c+28 -230 repliesApplied
9/14rtnetlink: Fetch IFLA_LINK_NETNSID in rtnl_newlink().net/core/rtnetlink.c+24 -250 repliesApplied
10/14rtnetlink: Clean up rtnl_dellink().net/core/rtnetlink.c+10 -170 repliesApplied
11/14rtnetlink: Clean up rtnl_setlink().net/core/rtnetlink.c+7 -100 repliesApplied
12/14rtnetlink: Call rtnl_link_get_net_capable() in do_setlink().net/core/rtnetlink.c+16 -160 repliesApplied
13/14rtnetlink: Return int from rtnl_af_register().include/net/rtnetlink.h net/bridge/br_netlink.c net/core/rtnetlink.c +4 more+30 -116 repliesApplied
14/14rtnetlink: Protect struct rtnl_af_ops with SRCU.include/net/rtnetlink.h net/core/rtnetlink.c+51 -170 repliesApplied

Reviews trailers per patch

10 of 14 patches have a Reviewed-by or Acked-by.

PatchEric DumazetMatt Johnston
1/14R-b
2/14R-b
3/14R-b
4/14R-b
5/14
6/14R-b
7/14
8/14R-b
9/14R-b
10/14R-b
11/14R-b
12/14
13/14R-b
14/14

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH v2 net-next 00/14] rtnetlink: Refactor rtnl_{new,del,set}link() for per-netns RTNL.

This is a prep for the next series where we will push RTNL down to rtnl_{new,del,set}link().

That means, for example, __rtnl_newlink() is always under RTNL, but rtnl_newlink() has a non-RTNL section.

As a prerequisite for per-netns RTNL, we will move netns validation (and RTNL-independent validations if possible) to that section.

rtnl_link_ops and rtnl_af_ops will be protected with SRCU not to depend on RTNL.

Changes:
v2:
* Add Eric's Reviewed-by to patch 1-4,6,8-11, (no tag on 5,7,12-14)
* Patch 7
* Handle error of init_srcu_struct().
* Call cleanup_srcu_struct() after synchronize_srcu().
* Patch 12
* Move put_net() before errorout label
* Patch 13
* Newly added as prep for patch 14
* Patch 14
* Handle error of init_srcu_struct().
* Call cleanup_srcu_struct() after synchronize_srcu().

v1: https://lore.kernel.org/netdev/[email protected]/

Kuniyuki Iwashima (14):
rtnetlink: Allocate linkinfo[] as struct rtnl_newlink_tbs.
rtnetlink: Call validate_linkmsg() in do_setlink().
rtnetlink: Factorise do_setlink() path from __rtnl_newlink().
rtnetlink: Move simple validation from __rtnl_newlink() to

    rtnl_newlink().

rtnetlink: Move rtnl_link_ops_get() and retry to rtnl_newlink().
rtnetlink: Move ops->validate to rtnl_newlink().
rtnetlink: Protect struct rtnl_link_ops with SRCU.
rtnetlink: Call rtnl_link_get_net_capable() in rtnl_newlink().
rtnetlink: Fetch IFLA_LINK_NETNSID in rtnl_newlink().
rtnetlink: Clean up rtnl_dellink().
rtnetlink: Clean up rtnl_setlink().
rtnetlink: Call rtnl_link_get_net_capable() in do_setlink().
rtnetlink: Return int from rtnl_af_register().
rtnetlink: Protect struct rtnl_af_ops with SRCU.

 include/net/rtnetlink.h |  12 +-
 net/bridge/br_netlink.c |   6 +-
 net/core/rtnetlink.c    | 567 ++++++++++++++++++++++------------------
 net/ipv4/devinet.c      |   3 +-
 net/ipv6/addrconf.c     |   5 +-
 net/mctp/device.c       |  16 +-
 net/mpls/af_mpls.c      |   5 +-
 7 files changed, 351 insertions(+), 263 deletions(-)
Signature · 1 line
2.39.5 (Apple Git-154)