mbox series

[v2,net-next,0/7] nexthop: Convert RTM_{NEW,DEL}NEXTHOP to per-netns RTNL.

Message ID 20250319230743.65267-1-kuniyu@amazon.com (mailing list archive)
Headers show
Series nexthop: Convert RTM_{NEW,DEL}NEXTHOP to per-netns RTNL. | expand

Message

Kuniyuki Iwashima March 19, 2025, 11:06 p.m. UTC
Patch 1 - 5 move some validation for RTM_NEWNEXTHOP so that it can be
called without RTNL.

Patch 6 & 7 converts RTM_NEWNEXTHOP and RTM_DELNEXTHOP to per-netns RTNL.

Note that RTM_GETNEXTHOP and RTM_GETNEXTHOPBUCKET are not touched in
this series.

rtm_get_nexthop() can be easily converted to RCU, but rtm_dump_nexthop()
needs more work due to the left-to-right rbtree walk, which looks prone
to node deletion and tree rotation without a retry mechanism.


Changes:
  v2:
    * Patch 2
      * Correct err check in rtm_new_nexthop()

  v1: https://lore.kernel.org/netdev/20250318233240.53946-1-kuniyu@amazon.com/


Kuniyuki Iwashima (7):
  nexthop: Move nlmsg_parse() in rtm_to_nh_config() to
    rtm_new_nexthop().
  nexthop: Split nh_check_attr_group().
  nexthop: Move NHA_OIF validation to rtm_to_nh_config_rtnl().
  nexthop: Check NLM_F_REPLACE and NHA_ID in rtm_new_nexthop().
  nexthop: Remove redundant group len check in nexthop_create_group().
  nexthop: Convert RTM_NEWNEXTHOP to per-netns RTNL.
  nexthop: Convert RTM_DELNEXTHOP to per-netns RTNL.

 net/ipv4/nexthop.c | 183 +++++++++++++++++++++++++++------------------
 1 file changed, 112 insertions(+), 71 deletions(-)