Thread View: linux.kernel.netdev
5 messages
5 total messages
Started by Florian Fainelli
Mon, 26 Oct 2026 16:47
[PATCH net v2 0/2] net: dsa: mv88e6xxx: 88E6171 stats fixes
Author: Florian Fainelli
Date: Mon, 26 Oct 2026 16:47
Date: Mon, 26 Oct 2026 16:47
21 lines
11118 bytes
11118 bytes
These two patches fixes statistics on the 88E6171 present on the Linksys EA4500 router. These changes were found during testing using a resurrected version of Andrew's dsa-tests: https://github.com/lunn/dsa-tests Changes in v2: - cover all of the affected switches in patch #1 - add Andrew's R-b tag in patch #2 Florian Fainelli (2): net: dsa: mv88e6xxx: fix 6351 family statistics snapshot net: dsa: mv88e6xxx: fix 88E6171 statistics type drivers/net/dsa/mv88e6xxx/chip.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) -- 2.53.0
[PATCH net v2 1/2] net: dsa: mv88e6xxx: fix 6351 family statistics snapshot
Author: Florian Fainelli
Date: Mon, 26 Oct 2026 16:47
Date: Mon, 26 Oct 2026 16:47
70 lines
14450 bytes
14450 bytes
The 88E6171, 88E6175, 88E6350 and 88E6351 take the port number in the
low bits of the statistics operation register. The 6320 snapshot helper
instead encodes the port as (port + 1) << 5. On an EA4500 with an
88E6171, this causes ethtool -S to return physical port 0's MIB counters
for every user port. Traffic on other ports does not update their
reported hardware counters.
Before the snapshot operation was moved into the chip operations, only
the 6320 and 6352 families used the shifted encoding. The refactoring
incorrectly assigned that encoding to all four 6351 family chips.
Use the unshifted snapshot helper for the entire 6351 family. This
matches the Marvell DSDT statsCapture() implementation, which uses the
raw port number for chips outside DEV_RMON_PORT_BITS, including these
four chips.
The original 88E6171 change was tested on an EA4500: pings through
different switch ports updated only the corresponding port's hardware
counters. The other three chips have not been hardware tested.
Fixes: a605a0fe7115 ("net: dsa: mv88e6xxx: Abstract stats_snapshot into ops structure")
Link: https://lore.kernel.org/all/404d5f2d-24a5-4edc-897b-b1b3c54a20e1@lunn.ch/
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
drivers/net/dsa/mv88e6xxx/chip.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c
index 7f68a0c55802..675b82857754 100644
--- a/drivers/net/dsa/mv88e6xxx/chip.c
+++ b/drivers/net/dsa/mv88e6xxx/chip.c
@@ -4610,7 +4610,7 @@ static const struct mv88e6xxx_ops mv88e6171_ops = {
.port_disable_pri_override = mv88e6xxx_port_disable_pri_override,
.port_get_cmode = mv88e6352_port_get_cmode,
.port_setup_message_port = mv88e6xxx_setup_message_port,
- .stats_snapshot = mv88e6320_g1_stats_snapshot,
+ .stats_snapshot = mv88e6xxx_g1_stats_snapshot,
.stats_set_histogram = mv88e6095_g1_stats_set_histogram,
.stats_get_sset_count = mv88e6095_stats_get_sset_count,
.stats_get_strings = mv88e6095_stats_get_strings,
@@ -4714,7 +4714,7 @@ static const struct mv88e6xxx_ops mv88e6175_ops = {
.port_disable_pri_override = mv88e6xxx_port_disable_pri_override,
.port_get_cmode = mv88e6352_port_get_cmode,
.port_setup_message_port = mv88e6xxx_setup_message_port,
- .stats_snapshot = mv88e6320_g1_stats_snapshot,
+ .stats_snapshot = mv88e6xxx_g1_stats_snapshot,
.stats_set_histogram = mv88e6095_g1_stats_set_histogram,
.stats_get_sset_count = mv88e6095_stats_get_sset_count,
.stats_get_strings = mv88e6095_stats_get_strings,
@@ -5380,7 +5380,7 @@ static const struct mv88e6xxx_ops mv88e6350_ops = {
.port_disable_pri_override = mv88e6xxx_port_disable_pri_override,
.port_get_cmode = mv88e6352_port_get_cmode,
.port_setup_message_port = mv88e6xxx_setup_message_port,
- .stats_snapshot = mv88e6320_g1_stats_snapshot,
+ .stats_snapshot = mv88e6xxx_g1_stats_snapshot,
.stats_set_histogram = mv88e6095_g1_stats_set_histogram,
.stats_get_sset_count = mv88e6095_stats_get_sset_count,
.stats_get_strings = mv88e6095_stats_get_strings,
@@ -5426,7 +5426,7 @@ static const struct mv88e6xxx_ops mv88e6351_ops = {
.port_disable_pri_override = mv88e6xxx_port_disable_pri_override,
.port_get_cmode = mv88e6352_port_get_cmode,
.port_setup_message_port = mv88e6xxx_setup_message_port,
- .stats_snapshot = mv88e6320_g1_stats_snapshot,
+ .stats_snapshot = mv88e6xxx_g1_stats_snapshot,
.stats_set_histogram = mv88e6095_g1_stats_set_histogram,
.stats_get_sset_count = mv88e6095_stats_get_sset_count,
.stats_get_strings = mv88e6095_stats_get_strings,
--
2.53.0
[PATCH net v2 2/2] net: dsa: mv88e6xxx: fix 88E6171 statistics type
Author: Florian Fainelli
Date: Mon, 26 Oct 2026 16:47
Date: Mon, 26 Oct 2026 16:47
39 lines
12549 bytes
12549 bytes
The 88E6171 uses the 6095 statistics operations, which advertise and name
BANK0 and PORT counters. Its stats_type bitmap instead selects BANK0 and
BANK1. Since statistics collection started using that bitmap, it has
written a different set of counters from the one advertised to ethtool.
For this chip, get_sset_count() accounts for 30 BANK0 counters, three
PORT counters and five ATU/VTU counters. Collection instead writes 30
BANK0 counters, 26 BANK1 counters and five ATU/VTU counters: 61 entries
rather than the advertised 38. This mislabels the tail of the returned
statistics and writes past the advertised statistics buffer.
Select BANK0 and PORT counters to match the chip's statistics operations
and restore the filter used before the bitmap was introduced. Tested on
an EA4500, where the two-bridge forwarding and multicast snooping tests
now pass their hardware counter checks.
Fixes: 5595e3613ea7 ("dsa: mv88e6xxx: Move available stats into info structure")
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
drivers/net/dsa/mv88e6xxx/chip.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c
index 675b82857754..dbc4a6be54fd 100644
--- a/drivers/net/dsa/mv88e6xxx/chip.c
+++ b/drivers/net/dsa/mv88e6xxx/chip.c
@@ -5960,7 +5960,7 @@ static const struct mv88e6xxx_info mv88e6xxx_table[] = {
.age_time_coeff = 15000,
.g1_irqs = 9,
.g2_irqs = 10,
- .stats_type = STATS_TYPE_BANK0 | STATS_TYPE_BANK1,
+ .stats_type = STATS_TYPE_BANK0 | STATS_TYPE_PORT,
.atu_move_port_mask = 0xf,
.pvt = true,
.multi_chip = true,
--
2.53.0
Re: [PATCH net v2 1/2] net: dsa: mv88e6xxx: fix 6351 family statistics snapshot
Author: Andrew Lunn
Date: Mon, 26 Oct 2026 18:26
Date: Mon, 26 Oct 2026 18:26
29 lines
9693 bytes
9693 bytes
On Mon, Oct 26, 2026 at 09:47:32AM -0700, Florian Fainelli wrote:
> The 88E6171, 88E6175, 88E6350 and 88E6351 take the port number in the
> low bits of the statistics operation register. The 6320 snapshot helper
> instead encodes the port as (port + 1) << 5. On an EA4500 with an
> 88E6171, this causes ethtool -S to return physical port 0's MIB counters
> for every user port. Traffic on other ports does not update their
> reported hardware counters.
>
> Before the snapshot operation was moved into the chip operations, only
> the 6320 and 6352 families used the shifted encoding. The refactoring
> incorrectly assigned that encoding to all four 6351 family chips.
>
> Use the unshifted snapshot helper for the entire 6351 family. This
> matches the Marvell DSDT statsCapture() implementation, which uses the
> raw port number for chips outside DEV_RMON_PORT_BITS, including these
> four chips.
>
> The original 88E6171 change was tested on an EA4500: pings through
> different switch ports updated only the corresponding port's hardware
> counters. The other three chips have not been hardware tested.
>
> Fixes: a605a0fe7115 ("net: dsa: mv88e6xxx: Abstract stats_snapshot into ops structure")
> Link: https://lore.kernel.org/all/404d5f2d-24a5-4edc-897b-b1b3c54a20e1@lunn.ch/
> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Andrew
Re: [PATCH net v2 0/2] net: dsa: mv88e6xxx: 88E6171 stats fixes
Author: patchwork-bot+netdevbpf
Date: Tue, 27 Oct 2026 23:20
Date: Tue, 27 Oct 2026 23:20
27 lines
8653 bytes
8653 bytes
Hello:
This series was applied to netdev/net.git (main)
by Jakub Kicinski <kuba@kernel.org>:
On Mon, 26 Oct 2026 09:47:31 -0700 you wrote:
> These two patches fixes statistics on the 88E6171 present on the Linksys
> EA4500 router. These changes were found during testing using a
> resurrected version of Andrew's dsa-tests:
>
> https://github.com/lunn/dsa-tests
>
> Changes in v2:
>
> [...]
Here is the summary with links:
- [net,v2,1/2] net: dsa: mv88e6xxx: fix 6351 family statistics snapshot
https://git.kernel.org/netdev/net/c/9663edfa71e8
- [net,v2,2/2] net: dsa: mv88e6xxx: fix 88E6171 statistics type
https://git.kernel.org/netdev/net/c/df66431f3942
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads