[PATCH 1/2] net: dsa: RCU-protect dsa_ptr in struct net_device
Gur Stavi
gur.stavi at huawei.com
Tue Sep 17 01:10:56 PDT 2024
> @@ -1594,10 +1592,11 @@ void dsa_switch_shutdown(struct dsa_switch *ds)
> }
>
> /* Disconnect from further netdevice notifiers on the conduit,
> - * since netdev_uses_dsa() will now return false.
> + * from now on, netdev_uses_dsa_currently() will return false.
> */
> dsa_switch_for_each_cpu_port(dp, ds)
> - dp->conduit->dsa_ptr = NULL;
> + rcu_assign_pointer(dp->conduit->dsa_ptr, NULL);
> + synchronize_rcu();
>
> rtnl_unlock();
> out:
Hi, I am a newbie here. Thanks for the opportunity for learning more
about rcu.
Wouldn't it make more sense to call synchronize_rcu after rtnl_unlock?
More information about the Linux-mediatek
mailing list