Thread (13 messages) 13 messages, 3 authors, 2026-03-25

[PATCH net-next 3/3] vrf: Remove unnecessary synchronize_rcu() invocations

flat view
STALE203d SUPERSEDED: 1 (1M)

From: Ido Schimmel <idosch@nvidia.com>
Date: 2026-03-24 15:56:19
Subsystem: networking drivers, the rest, vrf · Maintainers: Andrew Lunn, "David S. Miller", Eric Dumazet, Jakub Kicinski, Paolo Abeni, Linus Torvalds, David Ahern

Revision v1 of 2 in this series; 1 review trailer.

Revisions (2)
  1. v1 current
  2. v2 [diff vs current]
vrf_rtable_release() and vrf_rt6_release() are called as part of the VRF
device's ndo_uninit() callback. As such, an RCU grace period passes
between the removal of the VRF slaves and the closing of the VRF device
until these functions are invoked.

Therefore, it should not be possible for any concurrent RCU readers to
try and acquire a reference on the dst entry while we are potentially
releasing the last reference via dst_release().

Given the above, the synchronize_rcu() invocations in these functions
seem unnecessary and only add unnecessary delay when deleting VRF
devices. Remove them.

Reviewed-by: Petr Machata <petrm@nvidia.com>
Signed-off-by: Ido Schimmel <idosch@nvidia.com>
---
 drivers/net/vrf.c | 2 --
 1 file changed, 2 deletions(-)
diff --git a/drivers/net/vrf.c b/drivers/net/vrf.c
index bfc9ea91ac20..75edb8eba87f 100644
--- a/drivers/net/vrf.c
+++ b/drivers/net/vrf.c
@@ -753,7 +753,6 @@ static void vrf_rt6_release(struct net_device *dev, struct net_vrf *vrf)
 	struct rt6_info *rt6 = rtnl_dereference(vrf->rt6);
 
 	RCU_INIT_POINTER(vrf->rt6, NULL);
-	synchronize_rcu();
 
 	if (rt6) {
 		dst_dev_put(&rt6->dst);
@@ -992,7 +991,6 @@ static void vrf_rtable_release(struct net_device *dev, struct net_vrf *vrf)
 	struct rtable *rth = rtnl_dereference(vrf->rth);
 
 	RCU_INIT_POINTER(vrf->rth, NULL);
-	synchronize_rcu();
 
 	dst_dev_put(&rth->dst);
 	dst_release(&rth->dst);
-- 
2.53.0
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help