Skip to content

ipv6: Drop RTNL from mcast.c and anycast.c

Kuniyuki Iwashima netdev 3 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. v3 Latest15 patches 6 repliesApplied 15/15
  2. v215 patches 24 repliesSuperseded
  3. v115 patches 5 repliesSuperseded

Changes in v3 from the cover letter

* Add Eric's tag for Patch 2 ~ 15
* Patch 1: Return the retval of ipv6_dev_mc_inc()
* Patch 6, 9, 14: Use dst_dev() for rt->dst.dev
* Patch 13: Use READ_ONCE() for net->ipv6.devconf_all->forwarding and idev->conf.forwarding

Patches in v3 All 15 applied

#Subject and filesSizeRepliesApplied
1/15ipv6: ndisc: Remove __in6_dev_get() in pndisc_{constructor,destructor}().net/ipv6/ndisc.c+7 -61 replyApplied
2/15ipv6: mcast: Replace locking comments with lockdep annotations.net/ipv6/mcast.c+71 -540 repliesApplied
3/15ipv6: mcast: Check inet6_dev->dead under idev->mc_lock in __ipv6_dev_mc_inc().net/ipv6/addrconf.c net/ipv6/mcast.c+8 -100 repliesApplied
4/15ipv6: mcast: Remove mca_get().net/ipv6/mcast.c+1 -80 repliesApplied
5/15ipv6: mcast: Use in6_dev_get() in ipv6_dev_mc_dec().net/ipv6/addrconf.c net/ipv6/mcast.c+7 -100 repliesApplied
6/15ipv6: mcast: Don't hold RTNL for IPV6_ADD_MEMBERSHIP and MCAST_JOIN_GROUP.net/ipv6/ipv6_sockglue.c net/ipv6/mcast.c+13 -130 repliesApplied
7/15ipv6: mcast: Don't hold RTNL for IPV6_DROP_MEMBERSHIP and MCAST_LEAVE_GROUP.net/ipv6/ipv6_sockglue.c net/ipv6/mcast.c+27 -223 repliesApplied
8/15ipv6: mcast: Don't hold RTNL in ipv6_sock_mc_close().net/ipv6/mcast.c+1 -210 repliesApplied
9/15ipv6: mcast: Don't hold RTNL for MCAST_ socket options.net/ipv6/ipv6_sockglue.c net/ipv6/mcast.c+45 -340 repliesApplied
10/15ipv6: mcast: Remove unnecessary ASSERT_RTNL and comment.net/ipv6/mcast.c+0 -60 repliesApplied
11/15ipv6: anycast: Don't use rtnl_dereference().net/ipv6/addrconf.c net/ipv6/anycast.c+8 -110 repliesApplied
12/15ipv6: anycast: Don't hold RTNL for IPV6_LEAVE_ANYCAST and IPV6_ADDRFORM.net/ipv6/anycast.c net/ipv6/ipv6_sockglue.c+20 -180 repliesApplied
13/15ipv6: anycast: Unify two error paths in ipv6_sock_ac_join().net/ipv6/anycast.c+16 -90 repliesApplied
14/15ipv6: anycast: Don't hold RTNL for IPV6_JOIN_ANYCAST.include/linux/netdevice.h net/core/dev.c net/ipv6/anycast.c +1 more+34 -342 repliesApplied
15/15ipv6: Remove setsockopt_needs_rtnl().net/ipv6/ipv6_sockglue.c+2 -110 repliesApplied

Reviews trailers per patch

All 15 patches have a Reviewed-by or Acked-by.

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

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

Read the v3 thread

Cover letter [PATCH v3 net-next 00/15] ipv6: Drop RTNL from mcast.c and anycast.c

From: Kuniyuki Iwashima <[email protected]>

This is a prep series for RCU conversion of RTM_NEWNEIGH, which needs RTNL during neigh_table.{pconstructor,pdestructor}() touching IPv6 multicast code.

Currently, IPv6 multicast code is protected by lock_sock() and inet6_dev->mc_lock, and RTNL is not actually needed.

In addition, anycast code is also in the same situation and does not need RTNL at all.

This series removes RTNL from net/ipv6/{mcast.c,anycast.c} and finally removes setsockopt_needs_rtnl() from do_ipv6_setsockopt().

Changes:
v3:
* Add Eric's tag for Patch 2 ~ 15
* Patch 1: Return the retval of ipv6_dev_mc_inc()
* Patch 6, 9, 14: Use dst_dev() for rt->dst.dev
* Patch 13: Use READ_ONCE() for net->ipv6.devconf_all->forwarding and idev->conf.forwarding

v2: https://lore.kernel.org/netdev/[email protected]/
* Patch 2: Clarify which function doesn't need assertion
* Patch 6, 9, 14: Call rt6_lookup() and dev_hold() under RCU

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

Kuniyuki Iwashima (15):
ipv6: ndisc: Remove __in6_dev_get() in
pndisc_{constructor,destructor}().
ipv6: mcast: Replace locking comments with lockdep annotations.
ipv6: mcast: Check inet6_dev->dead under idev->mc_lock in

    __ipv6_dev_mc_inc().

ipv6: mcast: Remove mca_get().
ipv6: mcast: Use in6_dev_get() in ipv6_dev_mc_dec().
ipv6: mcast: Don't hold RTNL for IPV6_ADD_MEMBERSHIP and
MCAST_JOIN_GROUP.
ipv6: mcast: Don't hold RTNL for IPV6_DROP_MEMBERSHIP and
MCAST_LEAVE_GROUP.
ipv6: mcast: Don't hold RTNL in ipv6_sock_mc_close().
ipv6: mcast: Don't hold RTNL for MCAST_ socket options.
ipv6: mcast: Remove unnecessary ASSERT_RTNL and comment.
ipv6: anycast: Don't use rtnl_dereference().
ipv6: anycast: Don't hold RTNL for IPV6_LEAVE_ANYCAST and
IPV6_ADDRFORM.
ipv6: anycast: Unify two error paths in ipv6_sock_ac_join().
ipv6: anycast: Don't hold RTNL for IPV6_JOIN_ANYCAST.
ipv6: Remove setsockopt_needs_rtnl().

 include/linux/netdevice.h |   4 +-
 net/core/dev.c            |  38 +++--
 net/ipv6/addrconf.c       |  12 +-
 net/ipv6/anycast.c        | 100 +++++++-----
 net/ipv6/ipv6_sockglue.c  |  28 +---
 net/ipv6/mcast.c          | 332 +++++++++++++++++++-------------------
 net/ipv6/ndisc.c          |  13 +-
 7 files changed, 260 insertions(+), 267 deletions(-)
Signature · 1 line
2.49.0