]> git.baikalelectronics.ru Git - kernel.git/commit
net: mscc: ocelot: fix incorrect ndo_get_stats64 packet counters
authorVladimir Oltean <vladimir.oltean@nxp.com>
Tue, 16 Aug 2022 13:53:46 +0000 (16:53 +0300)
committerJakub Kicinski <kuba@kernel.org>
Thu, 18 Aug 2022 04:58:30 +0000 (21:58 -0700)
commit2816508c5523cbf415d58a811a0f80ef7143a57f
treeb13071683087a82edb8bd3491f50640825a49a26
parentd825f7080eb45477e7a4a781c56561e88599acca
net: mscc: ocelot: fix incorrect ndo_get_stats64 packet counters

Reading stats using the SYS_COUNT_* register definitions is only used by
ocelot_get_stats64() from the ocelot switchdev driver, however,
currently the bucket definitions are incorrect.

Separately, on both RX and TX, we have the following problems:
- a 256-1023 bucket which actually tracks the 256-511 packets
- the 1024-1526 bucket actually tracks the 512-1023 packets
- the 1527-max bucket actually tracks the 1024-1526 packets

=> nobody tracks the packets from the real 1527-max bucket

Additionally, the RX_PAUSE, RX_CONTROL, RX_LONGS and RX_CLASSIFIED_DROPS
all track the wrong thing. However this doesn't seem to have any
consequence, since ocelot_get_stats64() doesn't use these.

Even though this problem only manifests itself for the switchdev driver,
we cannot split the fix for ocelot and for DSA, since it requires fixing
the bucket definitions from enum ocelot_reg, which makes us necessarily
adapt the structures from felix and seville as well.

Fixes: a83ee1de50e3 ("net: dsa: felix: introduce support for Seville VSC9953 switch")
Fixes: 34efb4cbfb94 ("net: dsa: ocelot: add driver for Felix switch family")
Fixes: 1bed22a67906 ("net: mscc: Add initial Ocelot switch support")
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/dsa/ocelot/felix_vsc9959.c
drivers/net/dsa/ocelot/seville_vsc9953.c
drivers/net/ethernet/mscc/ocelot_net.c
drivers/net/ethernet/mscc/vsc7514_regs.c
include/soc/mscc/ocelot.h