public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH][net-next] net: vrf: switch to synchronize_net() when releasing routes
@ 2026-03-10 10:53 lirongqing
  2026-03-11 13:19 ` Ido Schimmel
  0 siblings, 1 reply; 4+ messages in thread
From: lirongqing @ 2026-03-10 10:53 UTC (permalink / raw)
  To: David Ahern, Andrew Lunn, David S . Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, netdev
  Cc: Li RongQing

From: Li RongQing <lirongqing@baidu.com>

Replace synchronize_rcu() with synchronize_net() in vrf_rtable_release()
and vrf_rt6_release().

synchronize_net() is RTNL-aware and can use the more efficient
synchronize_rcu_expedited() when the RTNL lock is held, avoiding
potentially long wait times for a standard RCU grace period.

Since these release functions are called during device teardown where
the RTNL lock is typically held, this change reduces the time spent
in RTNL critical sections and speeds up VRF device deletion.

Signed-off-by: Li RongQing <lirongqing@baidu.com>
---
 drivers/net/vrf.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/vrf.c b/drivers/net/vrf.c
index 8c009bc..92a0f4b 100644
--- a/drivers/net/vrf.c
+++ b/drivers/net/vrf.c
@@ -755,7 +755,7 @@ static void vrf_rt6_release(struct net_device *dev, struct net_vrf *vrf)
 	struct dst_entry *dst;
 
 	RCU_INIT_POINTER(vrf->rt6, NULL);
-	synchronize_rcu();
+	synchronize_net();
 
 	/* move dev in dst's to loopback so this VRF device can be deleted
 	 * - based on dst_ifdown
@@ -1002,7 +1002,7 @@ static void vrf_rtable_release(struct net_device *dev, struct net_vrf *vrf)
 	struct dst_entry *dst;
 
 	RCU_INIT_POINTER(vrf->rth, NULL);
-	synchronize_rcu();
+	synchronize_net();
 
 	/* move dev in dst's to loopback so this VRF device can be deleted
 	 * - based on dst_ifdown
-- 
2.9.4


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

end of thread, other threads:[~2026-03-11 15:26 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-10 10:53 [PATCH][net-next] net: vrf: switch to synchronize_net() when releasing routes lirongqing
2026-03-11 13:19 ` Ido Schimmel
2026-03-11 13:26   ` Eric Dumazet
2026-03-11 15:26     ` Ido Schimmel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox