From: Kai Kuang <kuangkai@kylinos.cn>
To: netdev@vger.kernel.org
Cc: andrew@lunn.ch, olteanv@gmail.com, davem@davemloft.net,
edumazet@kernel.org, kuba@kernel.org, pabeni@redhat.com,
horms@kernel.org, linux-kernel@vger.kernel.org,
kuangkai@kylinos.cn, kk47yx@gmail.com
Subject: [PATCH net-next 2/2] net: dsa: user: document the write memory barrier on LAG conduit migration
Date: Wed, 28 Oct 2026 20:56:16 +0800 [thread overview]
Message-ID: <20261028125616.460636-3-kuangkai@kylinos.cn> (raw)
In-Reply-To: <20261028125616.460636-1-kuangkai@kylinos.cn>
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@kylinos.cn>
---
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
prev parent reply other threads:[~2026-10-28 12:57 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-28 12:56 [PATCH net-next 0/2] net: dsa: user: minor cleanups Kai Kuang
2026-10-28 12:56 ` [PATCH net-next 1/2] net: dsa: user: use kernel types in ethtool callbacks Kai Kuang
2026-10-28 13:00 ` Andrew Lunn
2026-11-09 12:06 ` [PATCH net-next 0/2] net: dsa: user: minor cleanups Kai Kuang
2026-11-09 12:06 ` [PATCH net-next 1/2] net: dsa: user: use kernel types in ethtool callbacks Kai Kuang
2026-11-09 12:06 ` [PATCH net-next 2/2] net: dsa: user: document the write memory barrier on LAG conduit migration Kai Kuang
2026-10-28 12:56 ` Kai Kuang [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261028125616.460636-3-kuangkai@kylinos.cn \
--to=kuangkai@kylinos.cn \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@kernel.org \
--cc=horms@kernel.org \
--cc=kk47yx@gmail.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=olteanv@gmail.com \
--cc=pabeni@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®