netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 net-next 00/13] mpls: Remove RTNL dependency.
@ 2025-10-29 17:32 Kuniyuki Iwashima
  2025-10-29 17:32 ` [PATCH v2 net-next 01/13] mpls: Return early in mpls_label_ok() Kuniyuki Iwashima
                   ` (14 more replies)
  0 siblings, 15 replies; 16+ messages in thread
From: Kuniyuki Iwashima @ 2025-10-29 17:32 UTC (permalink / raw)
  To: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni
  Cc: Simon Horman, Kuniyuki Iwashima, Kuniyuki Iwashima, netdev

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/20251028033812.2043964-1-kuniyu@google.com/


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

-- 
2.51.1.851.g4ebd6896fd-goog


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

end of thread, other threads:[~2025-11-04  2:01 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-29 17:32 [PATCH v2 net-next 00/13] mpls: Remove RTNL dependency Kuniyuki Iwashima
2025-10-29 17:32 ` [PATCH v2 net-next 01/13] mpls: Return early in mpls_label_ok() Kuniyuki Iwashima
2025-10-29 17:32 ` [PATCH v2 net-next 02/13] mpls: Hold dev refcnt for mpls_nh Kuniyuki Iwashima
2025-10-29 17:32 ` [PATCH v2 net-next 03/13] mpls: Unify return paths in mpls_dev_notify() Kuniyuki Iwashima
2025-10-29 17:32 ` [PATCH v2 net-next 04/13] ipv6: Add in6_dev_rcu() Kuniyuki Iwashima
2025-10-29 17:32 ` [PATCH v2 net-next 05/13] mpls: Use in6_dev_rcu() and dev_net_rcu() in mpls_forward() and mpls_xmit() Kuniyuki Iwashima
2025-10-29 17:32 ` [PATCH v2 net-next 06/13] mpls: Add mpls_dev_rcu() Kuniyuki Iwashima
2025-10-29 17:32 ` [PATCH v2 net-next 07/13] mpls: Pass net to mpls_dev_get() Kuniyuki Iwashima
2025-10-29 17:33 ` [PATCH v2 net-next 08/13] mpls: Add mpls_route_input() Kuniyuki Iwashima
2025-10-29 17:33 ` [PATCH v2 net-next 09/13] mpls: Use mpls_route_input() where appropriate Kuniyuki Iwashima
2025-10-29 17:33 ` [PATCH v2 net-next 10/13] mpls: Convert mpls_dump_routes() to RCU Kuniyuki Iwashima
2025-10-29 17:33 ` [PATCH v2 net-next 11/13] mpls: Convert RTM_GETNETCONF " Kuniyuki Iwashima
2025-10-29 17:33 ` [PATCH v2 net-next 12/13] mpls: Protect net->mpls.platform_label with a per-netns mutex Kuniyuki Iwashima
2025-10-29 17:33 ` [PATCH v2 net-next 13/13] mpls: Drop RTNL for RTM_NEWROUTE, RTM_DELROUTE, and RTM_GETROUTE Kuniyuki Iwashima
2025-10-29 19:28 ` [PATCH v2 net-next 00/13] mpls: Remove RTNL dependency Guillaume Nault
2025-11-04  2:00 ` patchwork-bot+netdevbpf

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