Thread (16 messages) 16 messages, 7 authors, 2024-09-17
STALE669d
Revisions (2)
  1. v1 [diff vs current]
  2. v1 current

[PATCH 1/2] net: dsa: RCU-protect dsa_ptr in struct net_device

From: Gur Stavi <hidden>
Date: 2024-09-17 08:11:50
Also in: bridge, linux-mediatek, stable

quoted hunk ↗ jump to hunk
@@ -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?
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help