* [PATCH net-next 0/2] net: dsa: user: minor cleanups
@ 2026-10-28 12:56 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 12:56 ` Kai Kuang
0 siblings, 2 replies; 7+ messages in thread
From: Kai Kuang @ 2026-10-28 12:56 UTC (permalink / raw)
To: netdev
Cc: andrew, olteanv, davem, edumazet, kuba, pabeni, horms,
linux-kernel, kuangkai, kk47yx
Small, self-contained cleanups in the DSA user port code, found with
checkpatch.pl --strict and targeted at net-next:
Patch 1: use the kernel types (u32/u8/u64) in the ethtool_ops method
implementations, matching the prototypes in include/linux/ethtool.h
instead of the uint32_t/uint8_t/uint64_t typedefs.
Patch 2: document the plain wmb() in the LAG DSA conduit migration
path, which orders the dp->cpu_dp stores before lag_dev->dsa_ptr is
published to the concurrent RX path readers.
Both patches have no functional change.
Kai Kuang (2):
net: dsa: user: use kernel types in ethtool callbacks
net: dsa: user: document the write memory barrier on LAG conduit
migration
net/dsa/user.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
--
2.25.1
No virus found
Checked by Hillstone Network AntiVirus
^ permalink raw reply [flat|nested] 7+ messages in thread* [PATCH net-next 1/2] net: dsa: user: use kernel types in ethtool callbacks
2026-10-28 12:56 [PATCH net-next 0/2] net: dsa: user: minor cleanups Kai Kuang
@ 2026-10-28 12:56 ` Kai Kuang
2026-10-28 13:00 ` Andrew Lunn
2026-10-28 12:56 ` Kai Kuang
1 sibling, 1 reply; 7+ messages in thread
From: Kai Kuang @ 2026-10-28 12:56 UTC (permalink / raw)
To: netdev
Cc: andrew, olteanv, davem, edumazet, kuba, pabeni, horms,
linux-kernel, kuangkai, kk47yx
Use u32/u8/u64 in the ->get_strings() and ->get_ethtool_stats()
callbacks to match the ethtool_ops method prototypes.
No functional change.
Signed-off-by: Kai Kuang <kuangkai@kylinos.cn>
---
net/dsa/user.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/net/dsa/user.c b/net/dsa/user.c
index 041f9060c8ef..cfad269be75c 100644
--- a/net/dsa/user.c
+++ b/net/dsa/user.c
@@ -1023,7 +1023,7 @@ static int dsa_user_set_eeprom(struct net_device *dev,
}
static void dsa_user_get_strings(struct net_device *dev,
- uint32_t stringset, uint8_t *data)
+ u32 stringset, u8 *data)
{
struct dsa_port *dp = dsa_user_to_port(dev);
struct dsa_switch *ds = dp->ds;
@@ -1043,7 +1043,7 @@ static void dsa_user_get_strings(struct net_device *dev,
static void dsa_user_get_ethtool_stats(struct net_device *dev,
struct ethtool_stats *stats,
- uint64_t *data)
+ u64 *data)
{
struct dsa_port *dp = dsa_user_to_port(dev);
struct dsa_switch *ds = dp->ds;
--
2.25.1
No virus found
Checked by Hillstone Network AntiVirus
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [PATCH net-next 1/2] net: dsa: user: use kernel types in ethtool callbacks
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
0 siblings, 1 reply; 7+ messages in thread
From: Andrew Lunn @ 2026-10-28 13:00 UTC (permalink / raw)
To: Kai Kuang
Cc: netdev, olteanv, davem, edumazet, kuba, pabeni, horms,
linux-kernel, kk47yx
On Wed, Oct 28, 2026 at 08:56:15PM +0800, Kai Kuang wrote:
> Use u32/u8/u64 in the ->get_strings() and ->get_ethtool_stats()
> callbacks to match the ethtool_ops method prototypes.
>
> No functional change.
net-next is closed at the moment:
https://www.kernel.org/doc/html/latest/process/maintainer-netdev.html
The patch itself looks O.K, please repost when net-next re-opens.
Andrew
^ permalink raw reply [flat|nested] 7+ messages in thread* [PATCH net-next 0/2] net: dsa: user: minor cleanups
2026-10-28 13:00 ` Andrew Lunn
@ 2026-11-09 12:06 ` 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
0 siblings, 2 replies; 7+ messages in thread
From: Kai Kuang @ 2026-11-09 12:06 UTC (permalink / raw)
To: netdev
Cc: andrew, olteanv, davem, edumazet, kuba, pabeni, horms,
linux-kernel, kuangkai
Two small, self-contained cleanups in the DSA user port code, targeted
at net-next:
Patch 1: use u32/u8/u64 in the ->get_strings() and
->get_ethtool_stats() implementations to match the ethtool_ops method
prototypes in include/linux/ethtool.h.
Patch 2: document the plain wmb() in the LAG DSA conduit migration
path. The barrier orders the dp->cpu_dp stores before the new
lag_dev->dsa_ptr is published to the concurrent RX path readers.
Neither patch changes behavior. Reposting now that net-next has
re-opened, as previously requested during the merge window; the patches
are unchanged.
Kai Kuang (2):
net: dsa: user: use kernel types in ethtool callbacks
net: dsa: user: document the write memory barrier on LAG conduit
migration
net/dsa/user.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
--
2.25.1
No virus found
Checked by Hillstone Network AntiVirus
^ permalink raw reply [flat|nested] 7+ messages in thread* [PATCH net-next 1/2] net: dsa: user: use kernel types in ethtool callbacks
2026-11-09 12:06 ` [PATCH net-next 0/2] net: dsa: user: minor cleanups Kai Kuang
@ 2026-11-09 12:06 ` 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
1 sibling, 0 replies; 7+ messages in thread
From: Kai Kuang @ 2026-11-09 12:06 UTC (permalink / raw)
To: netdev
Cc: andrew, olteanv, davem, edumazet, kuba, pabeni, horms,
linux-kernel, kuangkai
Use u32/u8/u64 in the ->get_strings() and ->get_ethtool_stats()
callbacks to match the ethtool_ops method prototypes.
No functional change.
Signed-off-by: Kai Kuang <kuangkai@kylinos.cn>
---
net/dsa/user.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/net/dsa/user.c b/net/dsa/user.c
index 041f9060c8ef..cfad269be75c 100644
--- a/net/dsa/user.c
+++ b/net/dsa/user.c
@@ -1023,7 +1023,7 @@ static int dsa_user_set_eeprom(struct net_device *dev,
}
static void dsa_user_get_strings(struct net_device *dev,
- uint32_t stringset, uint8_t *data)
+ u32 stringset, u8 *data)
{
struct dsa_port *dp = dsa_user_to_port(dev);
struct dsa_switch *ds = dp->ds;
@@ -1043,7 +1043,7 @@ static void dsa_user_get_strings(struct net_device *dev,
static void dsa_user_get_ethtool_stats(struct net_device *dev,
struct ethtool_stats *stats,
- uint64_t *data)
+ u64 *data)
{
struct dsa_port *dp = dsa_user_to_port(dev);
struct dsa_switch *ds = dp->ds;
--
2.25.1
No virus found
Checked by Hillstone Network AntiVirus
^ permalink raw reply [flat|nested] 7+ messages in thread* [PATCH net-next 2/2] net: dsa: user: document the write memory barrier on LAG conduit migration
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 ` Kai Kuang
1 sibling, 0 replies; 7+ messages in thread
From: Kai Kuang @ 2026-11-09 12:06 UTC (permalink / raw)
To: netdev
Cc: andrew, olteanv, davem, edumazet, kuba, pabeni, horms,
linux-kernel, kuangkai
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
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH net-next 2/2] net: dsa: user: document the write memory barrier on LAG conduit migration
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 12:56 ` Kai Kuang
1 sibling, 0 replies; 7+ messages in thread
From: Kai Kuang @ 2026-10-28 12:56 UTC (permalink / raw)
To: netdev
Cc: andrew, olteanv, davem, edumazet, kuba, pabeni, horms,
linux-kernel, kuangkai, kk47yx
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
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2026-11-09 12:06 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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 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®