Skip to content

Commit 1a733bb

Browse files
vladimirolteandavem330
authored andcommitted
net: mscc: ocelot: allow ocelot_stat_layout elements with no name
We will add support for pMAC counters and MAC merge layer counters, which are only reported via the structured stats, and the current ocelot_get_strings() stands in our way, because it expects that the statistics should be placed in the data array at the same index as found in the ocelot_stats_layout array. That is not true. Statistics which don't have a name should not be exported to the unstructured ethtool -S, so we need to have different indices into the ocelot_stats_layout array (i) and into the data array (data itself). Signed-off-by: Vladimir Oltean <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 5f6c2d4 commit 1a733bb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/net/ethernet/mscc/ocelot_stats.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -315,8 +315,8 @@ void ocelot_get_strings(struct ocelot *ocelot, int port, u32 sset, u8 *data)
315315
if (ocelot_stats_layout[i].name[0] == '\0')
316316
continue;
317317

318-
memcpy(data + i * ETH_GSTRING_LEN, ocelot_stats_layout[i].name,
319-
ETH_GSTRING_LEN);
318+
memcpy(data, ocelot_stats_layout[i].name, ETH_GSTRING_LEN);
319+
data += ETH_GSTRING_LEN;
320320
}
321321
}
322322
EXPORT_SYMBOL(ocelot_get_strings);

0 commit comments

Comments
 (0)