[PATCH net-next 2/2] net: dsa: user: document the write memory barrier on LAG conduit migration
From: Kai Kuang
Date: Wed Oct 28 2026 - 08:58:49 EST
The wmb() orders the dp->cpu_dp stores before the new lag_dev->dsa_ptr
is published to the concurrent RX path readers. Document this, since a
plain barrier without a comment is hard to interpret.
Signed-off-by: Kai Kuang <kuangkai@xxxxxxxxxx>
---
net/dsa/user.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/net/dsa/user.c b/net/dsa/user.c
index cfad269be75c..96393d4b5da1 100644
--- a/net/dsa/user.c
+++ b/net/dsa/user.c
@@ -3435,6 +3435,10 @@ static void dsa_conduit_lag_leave(struct net_device *conduit,
* physical CPU port
*/
lag_dev->dsa_ptr = new_cpu_dp;
+ /* Ensure the new dp->cpu_dp values are visible to concurrent
+ * RX path readers of lag_dev->dsa_ptr before the pointer
+ * itself becomes visible
+ */
wmb();
} else {
/* If the LAG DSA conduit has no ports left, migrate back all
--
2.25.1
No virus found
Checked by Hillstone Network AntiVirus