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