Skip to content

Commit d3e75f1

Browse files
vladimirolteandavem330
authored andcommitted
net: mscc: ocelot: exclude stats from bulk regions based on reg, not name
We want to introduce elements kept in ocelot->stats that aren't exposed to the unstructured ethtool -S (so they won't have their name populated), but are otherwise checked for 32-bit wraparounds by ocelot_port_update_stats(). This isn't possible today because ocelot_prepare_stats_regions() skips over ocelot_stat_layout elements with no name. Now that we've changed struct ocelot_stat_layout to keep the absolute register address rather than the offset relative to SYS_CNT, we can make use of the unpopulated "reg" value of 0 to mean that the counter isn't present on the current switch revision, and skip it from the preparation of bulk regions. Signed-off-by: Vladimir Oltean <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 776b71e commit d3e75f1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/net/ethernet/mscc/ocelot_stats.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ static int ocelot_prepare_stats_regions(struct ocelot *ocelot)
222222
INIT_LIST_HEAD(&ocelot->stats_regions);
223223

224224
for (i = 0; i < OCELOT_NUM_STATS; i++) {
225-
if (ocelot->stats_layout[i].name[0] == '\0')
225+
if (!ocelot->stats_layout[i].reg)
226226
continue;
227227

228228
if (region && ocelot->stats_layout[i].reg == last + 4) {

0 commit comments

Comments
 (0)