Skip to content

mpls: Remove RTNL dependency.

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 Latest13 patches 1 replyApplied 13/13
  2. v113 patches 2 repliesSuperseded

Changes in v2 from the cover letter

* Patch 10 : Removed dup entry of RTM_GETROUTE in mpls_rtnl_msg_handlers[] (Guillaume Nault)

Patches in v2 All 13 applied

#Subject and filesSizeRepliesApplied
1/13mpls: Return early in mpls_label_ok().net/mpls/af_mpls.c+5 -60 repliesApplied
2/13mpls: Hold dev refcnt for mpls_nh.net/mpls/af_mpls.c net/mpls/internal.h+45 -190 repliesApplied
3/13mpls: Unify return paths in mpls_dev_notify().net/mpls/af_mpls.c+16 -80 repliesApplied
4/13ipv6: Add in6_dev_rcu().include/net/addrconf.h+5 -00 repliesApplied
5/13mpls: Use in6_dev_rcu() and dev_net_rcu() in mpls_forward() and mpls_xmit().net/mpls/af_mpls.c net/mpls/internal.h net/mpls/mpls_iptunnel.c+12 -100 repliesApplied
6/13mpls: Add mpls_dev_rcu().net/mpls/af_mpls.c net/mpls/internal.h net/mpls/mpls_iptunnel.c+12 -70 repliesApplied
7/13mpls: Pass net to mpls_dev_get().net/mpls/af_mpls.c net/mpls/internal.h+8 -60 repliesApplied
8/13mpls: Add mpls_route_input().net/mpls/af_mpls.c+18 -100 repliesApplied
9/13mpls: Use mpls_route_input() where appropriate.net/mpls/af_mpls.c+13 -190 repliesApplied
10/13mpls: Convert mpls_dump_routes() to RCU.net/mpls/af_mpls.c+16 -100 repliesApplied
11/13mpls: Convert RTM_GETNETCONF to RCU.net/mpls/af_mpls.c+30 -140 repliesApplied
12/13mpls: Protect net->mpls.platform_label with a per-netns mutex.include/net/netns/mpls.h net/mpls/af_mpls.c net/mpls/internal.h+43 -200 repliesApplied
13/13mpls: Drop RTNL for RTM_NEWROUTE, RTM_DELROUTE, and RTM_GETROUTE.net/mpls/af_mpls.c+5 -30 repliesApplied

Reviews trailers per patch

None of the 13 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchGuillaume Nault
SeriesR-b
1/13
2/13
3/13
4/13
5/13
6/13
7/13
8/13
9/13
10/13
11/13
12/13
13/13

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/13] mpls: Remove RTNL dependency.

MPLS uses RTNL

1) to guarantee the lifetime of struct mpls_nh.nh_dev
2) to protect net->mpls.platform_label

, but neither actually requires RTNL.

If struct mpls_nh holds a refcnt for nh_dev, we do not need RTNL, and it can be replaced with a dedicated mutex.

The series removes RTNL from net/mpls/.

Overview:

Patch 1 is misc cleanup.

Patch 2 - 9 are prep to drop RTNL for RTM_{NEW,DEL,GET}ROUTE handlers.

Patch 10 & 11 converts mpls_dump_routes() and RTM_GETNETCONF to RCU.

Patch 12 replaces RTNL with a new per-netns mutex.

Patch 13 drops RTNL from RTM_{NEW,DEL,GET}ROUTE.

Changes:
v2:
* Patch 10 : Removed dup entry of RTM_GETROUTE in mpls_rtnl_msg_handlers[] (Guillaume Nault)

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

Kuniyuki Iwashima (13):
mpls: Return early in mpls_label_ok().
mpls: Hold dev refcnt for mpls_nh.
mpls: Unify return paths in mpls_dev_notify().
ipv6: Add in6_dev_rcu().
mpls: Use in6_dev_rcu() and dev_net_rcu() in mpls_forward() and

    mpls_xmit().

mpls: Add mpls_dev_rcu().
mpls: Pass net to mpls_dev_get().
mpls: Add mpls_route_input().
mpls: Use mpls_route_input() where appropriate.
mpls: Convert mpls_dump_routes() to RCU.
mpls: Convert RTM_GETNETCONF to RCU.
mpls: Protect net->mpls.platform_label with a per-netns mutex.
mpls: Drop RTNL for RTM_NEWROUTE, RTM_DELROUTE, and RTM_GETROUTE.

 include/net/addrconf.h   |   5 +
 include/net/netns/mpls.h |   1 +
 net/mpls/af_mpls.c       | 321 ++++++++++++++++++++++++---------------
 net/mpls/internal.h      |  19 ++-
 net/mpls/mpls_iptunnel.c |   6 +-
 5 files changed, 224 insertions(+), 128 deletions(-)
Signature · 1 line
2.51.1.851.g4ebd6896fd-goog