Re: [PATCH v1 net-next 00/10] net: fib_rules: RTNL-less RTM_NEWRULE and RTM_DELRULE.
From: Ido Schimmel <idosch@nvidia.com>
Date: 2026-07-01 13:39:19
From: Ido Schimmel <idosch@nvidia.com>
Date: 2026-07-01 13:39:19
On Mon, Jun 29, 2026 at 06:10:52PM +0000, Kuniyuki Iwashima wrote:
RTM_NEWRULE and RTM_DELRULE acquire rtnl_net_lock(), but this is
only for fib_unmerge() in IPv4.
Since commit d954a67a7dfa ("ipv4: fib_rule: Move fib4_rules_exit()
to ->exit()."), RTM_DELRULE no longer needs RTNL.
fib_unmerge() is one-time event for each netns, so we only need
RTNL for the first IPv4 rule.
This series introduces per-fib_rules_ops mutex and drops RTNL
from fib_rules code except for the first IPv4 RTM_NEWRULE.LGTM, thanks: Reviewed-by: Ido Schimmel <idosch@nvidia.com> A few nits that can be addressed in a follow-up: 1. Patch #3: The comment at the top of netns_ipv4 suggests that we should document the new lock in Documentation/networking/net_cachelines/netns_ipv4_sysctl.rst Related: Did you consider moving this lock under CONFIG_IP_MULTIPLE_TABLES? 2. Patch #5: Sashiko suggests a mutex_destroy() in fib_rules_unregister(): https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20260629181226.1929658-1-kuniyu%40google.com?part=5