Skip to content

Commit 52eda46

Browse files
vladimirolteankuba-moo
authored andcommitted
net: mscc: ocelot: fix eMAC TX RMON stats for bucket 256-511 and above
There is a typo in the driver due to which we report incorrect TX RMON counters for the 256-511 octet bucket and all the other buckets larger than that. Bug found with the selftest at https://patchwork.kernel.org/project/netdevbpf/patch/[email protected]/ Fixes: e32036e ("net: mscc: ocelot: add support for all sorts of standardized counters present in DSA") Signed-off-by: Vladimir Oltean <[email protected]> Reviewed-by: Florian Fainelli <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent c740261 commit 52eda46

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

drivers/net/ethernet/mscc/ocelot_stats.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -582,10 +582,10 @@ static void ocelot_port_rmon_stats_cb(struct ocelot *ocelot, int port, void *pri
582582
rmon_stats->hist_tx[0] = s[OCELOT_STAT_TX_64];
583583
rmon_stats->hist_tx[1] = s[OCELOT_STAT_TX_65_127];
584584
rmon_stats->hist_tx[2] = s[OCELOT_STAT_TX_128_255];
585-
rmon_stats->hist_tx[3] = s[OCELOT_STAT_TX_128_255];
586-
rmon_stats->hist_tx[4] = s[OCELOT_STAT_TX_256_511];
587-
rmon_stats->hist_tx[5] = s[OCELOT_STAT_TX_512_1023];
588-
rmon_stats->hist_tx[6] = s[OCELOT_STAT_TX_1024_1526];
585+
rmon_stats->hist_tx[3] = s[OCELOT_STAT_TX_256_511];
586+
rmon_stats->hist_tx[4] = s[OCELOT_STAT_TX_512_1023];
587+
rmon_stats->hist_tx[5] = s[OCELOT_STAT_TX_1024_1526];
588+
rmon_stats->hist_tx[6] = s[OCELOT_STAT_TX_1527_MAX];
589589
}
590590

591591
static void ocelot_port_pmac_rmon_stats_cb(struct ocelot *ocelot, int port,

0 commit comments

Comments
 (0)