Commit 1a733bbd authored by Vladimir Oltean's avatar Vladimir Oltean Committed by David S. Miller

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: default avatarVladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 5f6c2d49
...@@ -315,8 +315,8 @@ void ocelot_get_strings(struct ocelot *ocelot, int port, u32 sset, u8 *data) ...@@ -315,8 +315,8 @@ void ocelot_get_strings(struct ocelot *ocelot, int port, u32 sset, u8 *data)
if (ocelot_stats_layout[i].name[0] == '\0') if (ocelot_stats_layout[i].name[0] == '\0')
continue; continue;
memcpy(data + i * ETH_GSTRING_LEN, ocelot_stats_layout[i].name, memcpy(data, ocelot_stats_layout[i].name, ETH_GSTRING_LEN);
ETH_GSTRING_LEN); data += ETH_GSTRING_LEN;
} }
} }
EXPORT_SYMBOL(ocelot_get_strings); EXPORT_SYMBOL(ocelot_get_strings);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment