aboutsummaryrefslogtreecommitdiff
path: root/drivers/net/dsa/vitesse-vsc73xx.h
diff options
context:
space:
mode:
authorVladimir Oltean <vladimir.oltean@nxp.com>2022-08-16 16:53:50 +0300
committerJakub Kicinski <kuba@kernel.org>2022-08-17 21:58:32 -0700
commit9190460084ddd0e9235f55eab0fdd5456b5f2fd5 (patch)
treef04f1686e4c4ff6ad804ad1b47a43449ed5571b2 /drivers/net/dsa/vitesse-vsc73xx.h
parent18d8e67df184081bc6ce6220a2dd965cfd3d7e6b (diff)
net: mscc: ocelot: make struct ocelot_stat_layout array indexable
The ocelot counters are 32-bit and require periodic reading, every 2 seconds, by ocelot_port_update_stats(), so that wraparounds are detected. Currently, the counters reported by ocelot_get_stats64() come from the 32-bit hardware counters directly, rather than from the 64-bit accumulated ocelot->stats, and this is a problem for their integrity. The strategy is to make ocelot_get_stats64() able to cherry-pick individual stats from ocelot->stats the way in which it currently reads them out from SYS_COUNT_* registers. But currently it can't, because ocelot->stats is an opaque u64 array that's used only to feed data into ethtool -S. To solve that problem, we need to make ocelot->stats indexable, and associate each element with an element of struct ocelot_stat_layout used by ethtool -S. This makes ocelot_stat_layout a fat (and possibly sparse) array, so we need to change the way in which we access it. We no longer need OCELOT_STAT_END as a sentinel, because we know the array's size (OCELOT_NUM_STATS). We just need to skip the array elements that were left unpopulated for the switch revision (ocelot, felix, seville). Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'drivers/net/dsa/vitesse-vsc73xx.h')
0 files changed, 0 insertions, 0 deletions