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

net: mscc: ocelot: minimize definitions for stats

The current definition of struct ocelot_stat_layout is long-winded (4
lines per entry, and we have hundreds of entries), so we could make an
effort to use the C preprocessor and reduce the line count.

Create an implicit correspondence between enum ocelot_reg, which tells
us the register address (SYS_COUNT_RX_OCTETS etc) and enum ocelot_stat
which allows us to index the ocelot->stats array (OCELOT_STAT_RX_OCTETS
etc), and don't require us to specify both when we define what stats
each switch family has.

Create an OCELOT_STAT() macro that pairs only an enum ocelot_stat to an
enum ocelot_reg, and an OCELOT_STAT_ETHTOOL() macro which also contains
a name exported to the unstructured ethtool -S stringset API. For now,
we define all counters as having the OCELOT_STAT_ETHTOOL() kind, but we
will add more counters in the future which are not exported to the
unstructured ethtool -S.
Signed-off-by: default avatarVladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent be5c13f2
...@@ -623,378 +623,99 @@ static const struct reg_field vsc9959_regfields[REGFIELD_MAX] = { ...@@ -623,378 +623,99 @@ static const struct reg_field vsc9959_regfields[REGFIELD_MAX] = {
}; };
static const struct ocelot_stat_layout vsc9959_stats_layout[OCELOT_NUM_STATS] = { static const struct ocelot_stat_layout vsc9959_stats_layout[OCELOT_NUM_STATS] = {
[OCELOT_STAT_RX_OCTETS] = { OCELOT_STAT_ETHTOOL(RX_OCTETS, "rx_octets"),
.name = "rx_octets", OCELOT_STAT_ETHTOOL(RX_UNICAST, "rx_unicast"),
.reg = SYS_COUNT_RX_OCTETS, OCELOT_STAT_ETHTOOL(RX_MULTICAST, "rx_multicast"),
}, OCELOT_STAT_ETHTOOL(RX_BROADCAST, "rx_broadcast"),
[OCELOT_STAT_RX_UNICAST] = { OCELOT_STAT_ETHTOOL(RX_SHORTS, "rx_shorts"),
.name = "rx_unicast", OCELOT_STAT_ETHTOOL(RX_FRAGMENTS, "rx_fragments"),
.reg = SYS_COUNT_RX_UNICAST, OCELOT_STAT_ETHTOOL(RX_JABBERS, "rx_jabbers"),
}, OCELOT_STAT_ETHTOOL(RX_CRC_ALIGN_ERRS, "rx_crc_align_errs"),
[OCELOT_STAT_RX_MULTICAST] = { OCELOT_STAT_ETHTOOL(RX_SYM_ERRS, "rx_sym_errs"),
.name = "rx_multicast", OCELOT_STAT_ETHTOOL(RX_64, "rx_frames_below_65_octets"),
.reg = SYS_COUNT_RX_MULTICAST, OCELOT_STAT_ETHTOOL(RX_65_127, "rx_frames_65_to_127_octets"),
}, OCELOT_STAT_ETHTOOL(RX_128_255, "rx_frames_128_to_255_octets"),
[OCELOT_STAT_RX_BROADCAST] = { OCELOT_STAT_ETHTOOL(RX_256_511, "rx_frames_256_to_511_octets"),
.name = "rx_broadcast", OCELOT_STAT_ETHTOOL(RX_512_1023, "rx_frames_512_to_1023_octets"),
.reg = SYS_COUNT_RX_BROADCAST, OCELOT_STAT_ETHTOOL(RX_1024_1526, "rx_frames_1024_to_1526_octets"),
}, OCELOT_STAT_ETHTOOL(RX_1527_MAX, "rx_frames_over_1526_octets"),
[OCELOT_STAT_RX_SHORTS] = { OCELOT_STAT_ETHTOOL(RX_PAUSE, "rx_pause"),
.name = "rx_shorts", OCELOT_STAT_ETHTOOL(RX_CONTROL, "rx_control"),
.reg = SYS_COUNT_RX_SHORTS, OCELOT_STAT_ETHTOOL(RX_LONGS, "rx_longs"),
}, OCELOT_STAT_ETHTOOL(RX_CLASSIFIED_DROPS, "rx_classified_drops"),
[OCELOT_STAT_RX_FRAGMENTS] = { OCELOT_STAT_ETHTOOL(RX_RED_PRIO_0, "rx_red_prio_0"),
.name = "rx_fragments", OCELOT_STAT_ETHTOOL(RX_RED_PRIO_1, "rx_red_prio_1"),
.reg = SYS_COUNT_RX_FRAGMENTS, OCELOT_STAT_ETHTOOL(RX_RED_PRIO_2, "rx_red_prio_2"),
}, OCELOT_STAT_ETHTOOL(RX_RED_PRIO_3, "rx_red_prio_3"),
[OCELOT_STAT_RX_JABBERS] = { OCELOT_STAT_ETHTOOL(RX_RED_PRIO_4, "rx_red_prio_4"),
.name = "rx_jabbers", OCELOT_STAT_ETHTOOL(RX_RED_PRIO_5, "rx_red_prio_5"),
.reg = SYS_COUNT_RX_JABBERS, OCELOT_STAT_ETHTOOL(RX_RED_PRIO_6, "rx_red_prio_6"),
}, OCELOT_STAT_ETHTOOL(RX_RED_PRIO_7, "rx_red_prio_7"),
[OCELOT_STAT_RX_CRC_ALIGN_ERRS] = { OCELOT_STAT_ETHTOOL(RX_YELLOW_PRIO_0, "rx_yellow_prio_0"),
.name = "rx_crc_align_errs", OCELOT_STAT_ETHTOOL(RX_YELLOW_PRIO_1, "rx_yellow_prio_1"),
.reg = SYS_COUNT_RX_CRC_ALIGN_ERRS, OCELOT_STAT_ETHTOOL(RX_YELLOW_PRIO_2, "rx_yellow_prio_2"),
}, OCELOT_STAT_ETHTOOL(RX_YELLOW_PRIO_3, "rx_yellow_prio_3"),
[OCELOT_STAT_RX_SYM_ERRS] = { OCELOT_STAT_ETHTOOL(RX_YELLOW_PRIO_4, "rx_yellow_prio_4"),
.name = "rx_sym_errs", OCELOT_STAT_ETHTOOL(RX_YELLOW_PRIO_5, "rx_yellow_prio_5"),
.reg = SYS_COUNT_RX_SYM_ERRS, OCELOT_STAT_ETHTOOL(RX_YELLOW_PRIO_6, "rx_yellow_prio_6"),
}, OCELOT_STAT_ETHTOOL(RX_YELLOW_PRIO_7, "rx_yellow_prio_7"),
[OCELOT_STAT_RX_64] = { OCELOT_STAT_ETHTOOL(RX_GREEN_PRIO_0, "rx_green_prio_0"),
.name = "rx_frames_below_65_octets", OCELOT_STAT_ETHTOOL(RX_GREEN_PRIO_1, "rx_green_prio_1"),
.reg = SYS_COUNT_RX_64, OCELOT_STAT_ETHTOOL(RX_GREEN_PRIO_2, "rx_green_prio_2"),
}, OCELOT_STAT_ETHTOOL(RX_GREEN_PRIO_3, "rx_green_prio_3"),
[OCELOT_STAT_RX_65_127] = { OCELOT_STAT_ETHTOOL(RX_GREEN_PRIO_4, "rx_green_prio_4"),
.name = "rx_frames_65_to_127_octets", OCELOT_STAT_ETHTOOL(RX_GREEN_PRIO_5, "rx_green_prio_5"),
.reg = SYS_COUNT_RX_65_127, OCELOT_STAT_ETHTOOL(RX_GREEN_PRIO_6, "rx_green_prio_6"),
}, OCELOT_STAT_ETHTOOL(RX_GREEN_PRIO_7, "rx_green_prio_7"),
[OCELOT_STAT_RX_128_255] = { OCELOT_STAT_ETHTOOL(TX_OCTETS, "tx_octets"),
.name = "rx_frames_128_to_255_octets", OCELOT_STAT_ETHTOOL(TX_UNICAST, "tx_unicast"),
.reg = SYS_COUNT_RX_128_255, OCELOT_STAT_ETHTOOL(TX_MULTICAST, "tx_multicast"),
}, OCELOT_STAT_ETHTOOL(TX_BROADCAST, "tx_broadcast"),
[OCELOT_STAT_RX_256_511] = { OCELOT_STAT_ETHTOOL(TX_COLLISION, "tx_collision"),
.name = "rx_frames_256_to_511_octets", OCELOT_STAT_ETHTOOL(TX_DROPS, "tx_drops"),
.reg = SYS_COUNT_RX_256_511, OCELOT_STAT_ETHTOOL(TX_PAUSE, "tx_pause"),
}, OCELOT_STAT_ETHTOOL(TX_64, "tx_frames_below_65_octets"),
[OCELOT_STAT_RX_512_1023] = { OCELOT_STAT_ETHTOOL(TX_65_127, "tx_frames_65_to_127_octets"),
.name = "rx_frames_512_to_1023_octets", OCELOT_STAT_ETHTOOL(TX_128_255, "tx_frames_128_255_octets"),
.reg = SYS_COUNT_RX_512_1023, OCELOT_STAT_ETHTOOL(TX_256_511, "tx_frames_256_511_octets"),
}, OCELOT_STAT_ETHTOOL(TX_512_1023, "tx_frames_512_1023_octets"),
[OCELOT_STAT_RX_1024_1526] = { OCELOT_STAT_ETHTOOL(TX_1024_1526, "tx_frames_1024_1526_octets"),
.name = "rx_frames_1024_to_1526_octets", OCELOT_STAT_ETHTOOL(TX_1527_MAX, "tx_frames_over_1526_octets"),
.reg = SYS_COUNT_RX_1024_1526, OCELOT_STAT_ETHTOOL(TX_YELLOW_PRIO_0, "tx_yellow_prio_0"),
}, OCELOT_STAT_ETHTOOL(TX_YELLOW_PRIO_1, "tx_yellow_prio_1"),
[OCELOT_STAT_RX_1527_MAX] = { OCELOT_STAT_ETHTOOL(TX_YELLOW_PRIO_2, "tx_yellow_prio_2"),
.name = "rx_frames_over_1526_octets", OCELOT_STAT_ETHTOOL(TX_YELLOW_PRIO_3, "tx_yellow_prio_3"),
.reg = SYS_COUNT_RX_1527_MAX, OCELOT_STAT_ETHTOOL(TX_YELLOW_PRIO_4, "tx_yellow_prio_4"),
}, OCELOT_STAT_ETHTOOL(TX_YELLOW_PRIO_5, "tx_yellow_prio_5"),
[OCELOT_STAT_RX_PAUSE] = { OCELOT_STAT_ETHTOOL(TX_YELLOW_PRIO_6, "tx_yellow_prio_6"),
.name = "rx_pause", OCELOT_STAT_ETHTOOL(TX_YELLOW_PRIO_7, "tx_yellow_prio_7"),
.reg = SYS_COUNT_RX_PAUSE, OCELOT_STAT_ETHTOOL(TX_GREEN_PRIO_0, "tx_green_prio_0"),
}, OCELOT_STAT_ETHTOOL(TX_GREEN_PRIO_1, "tx_green_prio_1"),
[OCELOT_STAT_RX_CONTROL] = { OCELOT_STAT_ETHTOOL(TX_GREEN_PRIO_2, "tx_green_prio_2"),
.name = "rx_control", OCELOT_STAT_ETHTOOL(TX_GREEN_PRIO_3, "tx_green_prio_3"),
.reg = SYS_COUNT_RX_CONTROL, OCELOT_STAT_ETHTOOL(TX_GREEN_PRIO_4, "tx_green_prio_4"),
}, OCELOT_STAT_ETHTOOL(TX_GREEN_PRIO_5, "tx_green_prio_5"),
[OCELOT_STAT_RX_LONGS] = { OCELOT_STAT_ETHTOOL(TX_GREEN_PRIO_6, "tx_green_prio_6"),
.name = "rx_longs", OCELOT_STAT_ETHTOOL(TX_GREEN_PRIO_7, "tx_green_prio_7"),
.reg = SYS_COUNT_RX_LONGS, OCELOT_STAT_ETHTOOL(TX_AGED, "tx_aged"),
}, OCELOT_STAT_ETHTOOL(DROP_LOCAL, "drop_local"),
[OCELOT_STAT_RX_CLASSIFIED_DROPS] = { OCELOT_STAT_ETHTOOL(DROP_TAIL, "drop_tail"),
.name = "rx_classified_drops", OCELOT_STAT_ETHTOOL(DROP_YELLOW_PRIO_0, "drop_yellow_prio_0"),
.reg = SYS_COUNT_RX_CLASSIFIED_DROPS, OCELOT_STAT_ETHTOOL(DROP_YELLOW_PRIO_1, "drop_yellow_prio_1"),
}, OCELOT_STAT_ETHTOOL(DROP_YELLOW_PRIO_2, "drop_yellow_prio_2"),
[OCELOT_STAT_RX_RED_PRIO_0] = { OCELOT_STAT_ETHTOOL(DROP_YELLOW_PRIO_3, "drop_yellow_prio_3"),
.name = "rx_red_prio_0", OCELOT_STAT_ETHTOOL(DROP_YELLOW_PRIO_4, "drop_yellow_prio_4"),
.reg = SYS_COUNT_RX_RED_PRIO_0, OCELOT_STAT_ETHTOOL(DROP_YELLOW_PRIO_5, "drop_yellow_prio_5"),
}, OCELOT_STAT_ETHTOOL(DROP_YELLOW_PRIO_6, "drop_yellow_prio_6"),
[OCELOT_STAT_RX_RED_PRIO_1] = { OCELOT_STAT_ETHTOOL(DROP_YELLOW_PRIO_7, "drop_yellow_prio_7"),
.name = "rx_red_prio_1", OCELOT_STAT_ETHTOOL(DROP_GREEN_PRIO_0, "drop_green_prio_0"),
.reg = SYS_COUNT_RX_RED_PRIO_1, OCELOT_STAT_ETHTOOL(DROP_GREEN_PRIO_1, "drop_green_prio_1"),
}, OCELOT_STAT_ETHTOOL(DROP_GREEN_PRIO_2, "drop_green_prio_2"),
[OCELOT_STAT_RX_RED_PRIO_2] = { OCELOT_STAT_ETHTOOL(DROP_GREEN_PRIO_3, "drop_green_prio_3"),
.name = "rx_red_prio_2", OCELOT_STAT_ETHTOOL(DROP_GREEN_PRIO_4, "drop_green_prio_4"),
.reg = SYS_COUNT_RX_RED_PRIO_2, OCELOT_STAT_ETHTOOL(DROP_GREEN_PRIO_5, "drop_green_prio_5"),
}, OCELOT_STAT_ETHTOOL(DROP_GREEN_PRIO_6, "drop_green_prio_6"),
[OCELOT_STAT_RX_RED_PRIO_3] = { OCELOT_STAT_ETHTOOL(DROP_GREEN_PRIO_7, "drop_green_prio_7"),
.name = "rx_red_prio_3",
.reg = SYS_COUNT_RX_RED_PRIO_3,
},
[OCELOT_STAT_RX_RED_PRIO_4] = {
.name = "rx_red_prio_4",
.reg = SYS_COUNT_RX_RED_PRIO_4,
},
[OCELOT_STAT_RX_RED_PRIO_5] = {
.name = "rx_red_prio_5",
.reg = SYS_COUNT_RX_RED_PRIO_5,
},
[OCELOT_STAT_RX_RED_PRIO_6] = {
.name = "rx_red_prio_6",
.reg = SYS_COUNT_RX_RED_PRIO_6,
},
[OCELOT_STAT_RX_RED_PRIO_7] = {
.name = "rx_red_prio_7",
.reg = SYS_COUNT_RX_RED_PRIO_7,
},
[OCELOT_STAT_RX_YELLOW_PRIO_0] = {
.name = "rx_yellow_prio_0",
.reg = SYS_COUNT_RX_YELLOW_PRIO_0,
},
[OCELOT_STAT_RX_YELLOW_PRIO_1] = {
.name = "rx_yellow_prio_1",
.reg = SYS_COUNT_RX_YELLOW_PRIO_1,
},
[OCELOT_STAT_RX_YELLOW_PRIO_2] = {
.name = "rx_yellow_prio_2",
.reg = SYS_COUNT_RX_YELLOW_PRIO_2,
},
[OCELOT_STAT_RX_YELLOW_PRIO_3] = {
.name = "rx_yellow_prio_3",
.reg = SYS_COUNT_RX_YELLOW_PRIO_3,
},
[OCELOT_STAT_RX_YELLOW_PRIO_4] = {
.name = "rx_yellow_prio_4",
.reg = SYS_COUNT_RX_YELLOW_PRIO_4,
},
[OCELOT_STAT_RX_YELLOW_PRIO_5] = {
.name = "rx_yellow_prio_5",
.reg = SYS_COUNT_RX_YELLOW_PRIO_5,
},
[OCELOT_STAT_RX_YELLOW_PRIO_6] = {
.name = "rx_yellow_prio_6",
.reg = SYS_COUNT_RX_YELLOW_PRIO_6,
},
[OCELOT_STAT_RX_YELLOW_PRIO_7] = {
.name = "rx_yellow_prio_7",
.reg = SYS_COUNT_RX_YELLOW_PRIO_7,
},
[OCELOT_STAT_RX_GREEN_PRIO_0] = {
.name = "rx_green_prio_0",
.reg = SYS_COUNT_RX_GREEN_PRIO_0,
},
[OCELOT_STAT_RX_GREEN_PRIO_1] = {
.name = "rx_green_prio_1",
.reg = SYS_COUNT_RX_GREEN_PRIO_1,
},
[OCELOT_STAT_RX_GREEN_PRIO_2] = {
.name = "rx_green_prio_2",
.reg = SYS_COUNT_RX_GREEN_PRIO_2,
},
[OCELOT_STAT_RX_GREEN_PRIO_3] = {
.name = "rx_green_prio_3",
.reg = SYS_COUNT_RX_GREEN_PRIO_3,
},
[OCELOT_STAT_RX_GREEN_PRIO_4] = {
.name = "rx_green_prio_4",
.reg = SYS_COUNT_RX_GREEN_PRIO_4,
},
[OCELOT_STAT_RX_GREEN_PRIO_5] = {
.name = "rx_green_prio_5",
.reg = SYS_COUNT_RX_GREEN_PRIO_5,
},
[OCELOT_STAT_RX_GREEN_PRIO_6] = {
.name = "rx_green_prio_6",
.reg = SYS_COUNT_RX_GREEN_PRIO_6,
},
[OCELOT_STAT_RX_GREEN_PRIO_7] = {
.name = "rx_green_prio_7",
.reg = SYS_COUNT_RX_GREEN_PRIO_7,
},
[OCELOT_STAT_TX_OCTETS] = {
.name = "tx_octets",
.reg = SYS_COUNT_TX_OCTETS,
},
[OCELOT_STAT_TX_UNICAST] = {
.name = "tx_unicast",
.reg = SYS_COUNT_TX_UNICAST,
},
[OCELOT_STAT_TX_MULTICAST] = {
.name = "tx_multicast",
.reg = SYS_COUNT_TX_MULTICAST,
},
[OCELOT_STAT_TX_BROADCAST] = {
.name = "tx_broadcast",
.reg = SYS_COUNT_TX_BROADCAST,
},
[OCELOT_STAT_TX_COLLISION] = {
.name = "tx_collision",
.reg = SYS_COUNT_TX_COLLISION,
},
[OCELOT_STAT_TX_DROPS] = {
.name = "tx_drops",
.reg = SYS_COUNT_TX_DROPS,
},
[OCELOT_STAT_TX_PAUSE] = {
.name = "tx_pause",
.reg = SYS_COUNT_TX_PAUSE,
},
[OCELOT_STAT_TX_64] = {
.name = "tx_frames_below_65_octets",
.reg = SYS_COUNT_TX_64,
},
[OCELOT_STAT_TX_65_127] = {
.name = "tx_frames_65_to_127_octets",
.reg = SYS_COUNT_TX_65_127,
},
[OCELOT_STAT_TX_128_255] = {
.name = "tx_frames_128_255_octets",
.reg = SYS_COUNT_TX_128_255,
},
[OCELOT_STAT_TX_256_511] = {
.name = "tx_frames_256_511_octets",
.reg = SYS_COUNT_TX_256_511,
},
[OCELOT_STAT_TX_512_1023] = {
.name = "tx_frames_512_1023_octets",
.reg = SYS_COUNT_TX_512_1023,
},
[OCELOT_STAT_TX_1024_1526] = {
.name = "tx_frames_1024_1526_octets",
.reg = SYS_COUNT_TX_1024_1526,
},
[OCELOT_STAT_TX_1527_MAX] = {
.name = "tx_frames_over_1526_octets",
.reg = SYS_COUNT_TX_1527_MAX,
},
[OCELOT_STAT_TX_YELLOW_PRIO_0] = {
.name = "tx_yellow_prio_0",
.reg = SYS_COUNT_TX_YELLOW_PRIO_0,
},
[OCELOT_STAT_TX_YELLOW_PRIO_1] = {
.name = "tx_yellow_prio_1",
.reg = SYS_COUNT_TX_YELLOW_PRIO_1,
},
[OCELOT_STAT_TX_YELLOW_PRIO_2] = {
.name = "tx_yellow_prio_2",
.reg = SYS_COUNT_TX_YELLOW_PRIO_2,
},
[OCELOT_STAT_TX_YELLOW_PRIO_3] = {
.name = "tx_yellow_prio_3",
.reg = SYS_COUNT_TX_YELLOW_PRIO_3,
},
[OCELOT_STAT_TX_YELLOW_PRIO_4] = {
.name = "tx_yellow_prio_4",
.reg = SYS_COUNT_TX_YELLOW_PRIO_4,
},
[OCELOT_STAT_TX_YELLOW_PRIO_5] = {
.name = "tx_yellow_prio_5",
.reg = SYS_COUNT_TX_YELLOW_PRIO_5,
},
[OCELOT_STAT_TX_YELLOW_PRIO_6] = {
.name = "tx_yellow_prio_6",
.reg = SYS_COUNT_TX_YELLOW_PRIO_6,
},
[OCELOT_STAT_TX_YELLOW_PRIO_7] = {
.name = "tx_yellow_prio_7",
.reg = SYS_COUNT_TX_YELLOW_PRIO_7,
},
[OCELOT_STAT_TX_GREEN_PRIO_0] = {
.name = "tx_green_prio_0",
.reg = SYS_COUNT_TX_GREEN_PRIO_0,
},
[OCELOT_STAT_TX_GREEN_PRIO_1] = {
.name = "tx_green_prio_1",
.reg = SYS_COUNT_TX_GREEN_PRIO_1,
},
[OCELOT_STAT_TX_GREEN_PRIO_2] = {
.name = "tx_green_prio_2",
.reg = SYS_COUNT_TX_GREEN_PRIO_2,
},
[OCELOT_STAT_TX_GREEN_PRIO_3] = {
.name = "tx_green_prio_3",
.reg = SYS_COUNT_TX_GREEN_PRIO_3,
},
[OCELOT_STAT_TX_GREEN_PRIO_4] = {
.name = "tx_green_prio_4",
.reg = SYS_COUNT_TX_GREEN_PRIO_4,
},
[OCELOT_STAT_TX_GREEN_PRIO_5] = {
.name = "tx_green_prio_5",
.reg = SYS_COUNT_TX_GREEN_PRIO_5,
},
[OCELOT_STAT_TX_GREEN_PRIO_6] = {
.name = "tx_green_prio_6",
.reg = SYS_COUNT_TX_GREEN_PRIO_6,
},
[OCELOT_STAT_TX_GREEN_PRIO_7] = {
.name = "tx_green_prio_7",
.reg = SYS_COUNT_TX_GREEN_PRIO_7,
},
[OCELOT_STAT_TX_AGED] = {
.name = "tx_aged",
.reg = SYS_COUNT_TX_AGED,
},
[OCELOT_STAT_DROP_LOCAL] = {
.name = "drop_local",
.reg = SYS_COUNT_DROP_LOCAL,
},
[OCELOT_STAT_DROP_TAIL] = {
.name = "drop_tail",
.reg = SYS_COUNT_DROP_TAIL,
},
[OCELOT_STAT_DROP_YELLOW_PRIO_0] = {
.name = "drop_yellow_prio_0",
.reg = SYS_COUNT_DROP_YELLOW_PRIO_0,
},
[OCELOT_STAT_DROP_YELLOW_PRIO_1] = {
.name = "drop_yellow_prio_1",
.reg = SYS_COUNT_DROP_YELLOW_PRIO_1,
},
[OCELOT_STAT_DROP_YELLOW_PRIO_2] = {
.name = "drop_yellow_prio_2",
.reg = SYS_COUNT_DROP_YELLOW_PRIO_2,
},
[OCELOT_STAT_DROP_YELLOW_PRIO_3] = {
.name = "drop_yellow_prio_3",
.reg = SYS_COUNT_DROP_YELLOW_PRIO_3,
},
[OCELOT_STAT_DROP_YELLOW_PRIO_4] = {
.name = "drop_yellow_prio_4",
.reg = SYS_COUNT_DROP_YELLOW_PRIO_4,
},
[OCELOT_STAT_DROP_YELLOW_PRIO_5] = {
.name = "drop_yellow_prio_5",
.reg = SYS_COUNT_DROP_YELLOW_PRIO_5,
},
[OCELOT_STAT_DROP_YELLOW_PRIO_6] = {
.name = "drop_yellow_prio_6",
.reg = SYS_COUNT_DROP_YELLOW_PRIO_6,
},
[OCELOT_STAT_DROP_YELLOW_PRIO_7] = {
.name = "drop_yellow_prio_7",
.reg = SYS_COUNT_DROP_YELLOW_PRIO_7,
},
[OCELOT_STAT_DROP_GREEN_PRIO_0] = {
.name = "drop_green_prio_0",
.reg = SYS_COUNT_DROP_GREEN_PRIO_0,
},
[OCELOT_STAT_DROP_GREEN_PRIO_1] = {
.name = "drop_green_prio_1",
.reg = SYS_COUNT_DROP_GREEN_PRIO_1,
},
[OCELOT_STAT_DROP_GREEN_PRIO_2] = {
.name = "drop_green_prio_2",
.reg = SYS_COUNT_DROP_GREEN_PRIO_2,
},
[OCELOT_STAT_DROP_GREEN_PRIO_3] = {
.name = "drop_green_prio_3",
.reg = SYS_COUNT_DROP_GREEN_PRIO_3,
},
[OCELOT_STAT_DROP_GREEN_PRIO_4] = {
.name = "drop_green_prio_4",
.reg = SYS_COUNT_DROP_GREEN_PRIO_4,
},
[OCELOT_STAT_DROP_GREEN_PRIO_5] = {
.name = "drop_green_prio_5",
.reg = SYS_COUNT_DROP_GREEN_PRIO_5,
},
[OCELOT_STAT_DROP_GREEN_PRIO_6] = {
.name = "drop_green_prio_6",
.reg = SYS_COUNT_DROP_GREEN_PRIO_6,
},
[OCELOT_STAT_DROP_GREEN_PRIO_7] = {
.name = "drop_green_prio_7",
.reg = SYS_COUNT_DROP_GREEN_PRIO_7,
},
}; };
static const struct vcap_field vsc9959_vcap_es0_keys[] = { static const struct vcap_field vsc9959_vcap_es0_keys[] = {
......
...@@ -614,378 +614,99 @@ static const struct reg_field vsc9953_regfields[REGFIELD_MAX] = { ...@@ -614,378 +614,99 @@ static const struct reg_field vsc9953_regfields[REGFIELD_MAX] = {
}; };
static const struct ocelot_stat_layout vsc9953_stats_layout[OCELOT_NUM_STATS] = { static const struct ocelot_stat_layout vsc9953_stats_layout[OCELOT_NUM_STATS] = {
[OCELOT_STAT_RX_OCTETS] = { OCELOT_STAT_ETHTOOL(RX_OCTETS, "rx_octets"),
.name = "rx_octets", OCELOT_STAT_ETHTOOL(RX_UNICAST, "rx_unicast"),
.reg = SYS_COUNT_RX_OCTETS, OCELOT_STAT_ETHTOOL(RX_MULTICAST, "rx_multicast"),
}, OCELOT_STAT_ETHTOOL(RX_BROADCAST, "rx_broadcast"),
[OCELOT_STAT_RX_UNICAST] = { OCELOT_STAT_ETHTOOL(RX_SHORTS, "rx_shorts"),
.name = "rx_unicast", OCELOT_STAT_ETHTOOL(RX_FRAGMENTS, "rx_fragments"),
.reg = SYS_COUNT_RX_UNICAST, OCELOT_STAT_ETHTOOL(RX_JABBERS, "rx_jabbers"),
}, OCELOT_STAT_ETHTOOL(RX_CRC_ALIGN_ERRS, "rx_crc_align_errs"),
[OCELOT_STAT_RX_MULTICAST] = { OCELOT_STAT_ETHTOOL(RX_SYM_ERRS, "rx_sym_errs"),
.name = "rx_multicast", OCELOT_STAT_ETHTOOL(RX_64, "rx_frames_below_65_octets"),
.reg = SYS_COUNT_RX_MULTICAST, OCELOT_STAT_ETHTOOL(RX_65_127, "rx_frames_65_to_127_octets"),
}, OCELOT_STAT_ETHTOOL(RX_128_255, "rx_frames_128_to_255_octets"),
[OCELOT_STAT_RX_BROADCAST] = { OCELOT_STAT_ETHTOOL(RX_256_511, "rx_frames_256_to_511_octets"),
.name = "rx_broadcast", OCELOT_STAT_ETHTOOL(RX_512_1023, "rx_frames_512_to_1023_octets"),
.reg = SYS_COUNT_RX_BROADCAST, OCELOT_STAT_ETHTOOL(RX_1024_1526, "rx_frames_1024_to_1526_octets"),
}, OCELOT_STAT_ETHTOOL(RX_1527_MAX, "rx_frames_over_1526_octets"),
[OCELOT_STAT_RX_SHORTS] = { OCELOT_STAT_ETHTOOL(RX_PAUSE, "rx_pause"),
.name = "rx_shorts", OCELOT_STAT_ETHTOOL(RX_CONTROL, "rx_control"),
.reg = SYS_COUNT_RX_SHORTS, OCELOT_STAT_ETHTOOL(RX_LONGS, "rx_longs"),
}, OCELOT_STAT_ETHTOOL(RX_CLASSIFIED_DROPS, "rx_classified_drops"),
[OCELOT_STAT_RX_FRAGMENTS] = { OCELOT_STAT_ETHTOOL(RX_RED_PRIO_0, "rx_red_prio_0"),
.name = "rx_fragments", OCELOT_STAT_ETHTOOL(RX_RED_PRIO_1, "rx_red_prio_1"),
.reg = SYS_COUNT_RX_FRAGMENTS, OCELOT_STAT_ETHTOOL(RX_RED_PRIO_2, "rx_red_prio_2"),
}, OCELOT_STAT_ETHTOOL(RX_RED_PRIO_3, "rx_red_prio_3"),
[OCELOT_STAT_RX_JABBERS] = { OCELOT_STAT_ETHTOOL(RX_RED_PRIO_4, "rx_red_prio_4"),
.name = "rx_jabbers", OCELOT_STAT_ETHTOOL(RX_RED_PRIO_5, "rx_red_prio_5"),
.reg = SYS_COUNT_RX_JABBERS, OCELOT_STAT_ETHTOOL(RX_RED_PRIO_6, "rx_red_prio_6"),
}, OCELOT_STAT_ETHTOOL(RX_RED_PRIO_7, "rx_red_prio_7"),
[OCELOT_STAT_RX_CRC_ALIGN_ERRS] = { OCELOT_STAT_ETHTOOL(RX_YELLOW_PRIO_0, "rx_yellow_prio_0"),
.name = "rx_crc_align_errs", OCELOT_STAT_ETHTOOL(RX_YELLOW_PRIO_1, "rx_yellow_prio_1"),
.reg = SYS_COUNT_RX_CRC_ALIGN_ERRS, OCELOT_STAT_ETHTOOL(RX_YELLOW_PRIO_2, "rx_yellow_prio_2"),
}, OCELOT_STAT_ETHTOOL(RX_YELLOW_PRIO_3, "rx_yellow_prio_3"),
[OCELOT_STAT_RX_SYM_ERRS] = { OCELOT_STAT_ETHTOOL(RX_YELLOW_PRIO_4, "rx_yellow_prio_4"),
.name = "rx_sym_errs", OCELOT_STAT_ETHTOOL(RX_YELLOW_PRIO_5, "rx_yellow_prio_5"),
.reg = SYS_COUNT_RX_SYM_ERRS, OCELOT_STAT_ETHTOOL(RX_YELLOW_PRIO_6, "rx_yellow_prio_6"),
}, OCELOT_STAT_ETHTOOL(RX_YELLOW_PRIO_7, "rx_yellow_prio_7"),
[OCELOT_STAT_RX_64] = { OCELOT_STAT_ETHTOOL(RX_GREEN_PRIO_0, "rx_green_prio_0"),
.name = "rx_frames_below_65_octets", OCELOT_STAT_ETHTOOL(RX_GREEN_PRIO_1, "rx_green_prio_1"),
.reg = SYS_COUNT_RX_64, OCELOT_STAT_ETHTOOL(RX_GREEN_PRIO_2, "rx_green_prio_2"),
}, OCELOT_STAT_ETHTOOL(RX_GREEN_PRIO_3, "rx_green_prio_3"),
[OCELOT_STAT_RX_65_127] = { OCELOT_STAT_ETHTOOL(RX_GREEN_PRIO_4, "rx_green_prio_4"),
.name = "rx_frames_65_to_127_octets", OCELOT_STAT_ETHTOOL(RX_GREEN_PRIO_5, "rx_green_prio_5"),
.reg = SYS_COUNT_RX_65_127, OCELOT_STAT_ETHTOOL(RX_GREEN_PRIO_6, "rx_green_prio_6"),
}, OCELOT_STAT_ETHTOOL(RX_GREEN_PRIO_7, "rx_green_prio_7"),
[OCELOT_STAT_RX_128_255] = { OCELOT_STAT_ETHTOOL(TX_OCTETS, "tx_octets"),
.name = "rx_frames_128_to_255_octets", OCELOT_STAT_ETHTOOL(TX_UNICAST, "tx_unicast"),
.reg = SYS_COUNT_RX_128_255, OCELOT_STAT_ETHTOOL(TX_MULTICAST, "tx_multicast"),
}, OCELOT_STAT_ETHTOOL(TX_BROADCAST, "tx_broadcast"),
[OCELOT_STAT_RX_256_511] = { OCELOT_STAT_ETHTOOL(TX_COLLISION, "tx_collision"),
.name = "rx_frames_256_to_511_octets", OCELOT_STAT_ETHTOOL(TX_DROPS, "tx_drops"),
.reg = SYS_COUNT_RX_256_511, OCELOT_STAT_ETHTOOL(TX_PAUSE, "tx_pause"),
}, OCELOT_STAT_ETHTOOL(TX_64, "tx_frames_below_65_octets"),
[OCELOT_STAT_RX_512_1023] = { OCELOT_STAT_ETHTOOL(TX_65_127, "tx_frames_65_to_127_octets"),
.name = "rx_frames_512_to_1023_octets", OCELOT_STAT_ETHTOOL(TX_128_255, "tx_frames_128_255_octets"),
.reg = SYS_COUNT_RX_512_1023, OCELOT_STAT_ETHTOOL(TX_256_511, "tx_frames_256_511_octets"),
}, OCELOT_STAT_ETHTOOL(TX_512_1023, "tx_frames_512_1023_octets"),
[OCELOT_STAT_RX_1024_1526] = { OCELOT_STAT_ETHTOOL(TX_1024_1526, "tx_frames_1024_1526_octets"),
.name = "rx_frames_1024_to_1526_octets", OCELOT_STAT_ETHTOOL(TX_1527_MAX, "tx_frames_over_1526_octets"),
.reg = SYS_COUNT_RX_1024_1526, OCELOT_STAT_ETHTOOL(TX_YELLOW_PRIO_0, "tx_yellow_prio_0"),
}, OCELOT_STAT_ETHTOOL(TX_YELLOW_PRIO_1, "tx_yellow_prio_1"),
[OCELOT_STAT_RX_1527_MAX] = { OCELOT_STAT_ETHTOOL(TX_YELLOW_PRIO_2, "tx_yellow_prio_2"),
.name = "rx_frames_over_1526_octets", OCELOT_STAT_ETHTOOL(TX_YELLOW_PRIO_3, "tx_yellow_prio_3"),
.reg = SYS_COUNT_RX_1527_MAX, OCELOT_STAT_ETHTOOL(TX_YELLOW_PRIO_4, "tx_yellow_prio_4"),
}, OCELOT_STAT_ETHTOOL(TX_YELLOW_PRIO_5, "tx_yellow_prio_5"),
[OCELOT_STAT_RX_PAUSE] = { OCELOT_STAT_ETHTOOL(TX_YELLOW_PRIO_6, "tx_yellow_prio_6"),
.name = "rx_pause", OCELOT_STAT_ETHTOOL(TX_YELLOW_PRIO_7, "tx_yellow_prio_7"),
.reg = SYS_COUNT_RX_PAUSE, OCELOT_STAT_ETHTOOL(TX_GREEN_PRIO_0, "tx_green_prio_0"),
}, OCELOT_STAT_ETHTOOL(TX_GREEN_PRIO_1, "tx_green_prio_1"),
[OCELOT_STAT_RX_CONTROL] = { OCELOT_STAT_ETHTOOL(TX_GREEN_PRIO_2, "tx_green_prio_2"),
.name = "rx_control", OCELOT_STAT_ETHTOOL(TX_GREEN_PRIO_3, "tx_green_prio_3"),
.reg = SYS_COUNT_RX_CONTROL, OCELOT_STAT_ETHTOOL(TX_GREEN_PRIO_4, "tx_green_prio_4"),
}, OCELOT_STAT_ETHTOOL(TX_GREEN_PRIO_5, "tx_green_prio_5"),
[OCELOT_STAT_RX_LONGS] = { OCELOT_STAT_ETHTOOL(TX_GREEN_PRIO_6, "tx_green_prio_6"),
.name = "rx_longs", OCELOT_STAT_ETHTOOL(TX_GREEN_PRIO_7, "tx_green_prio_7"),
.reg = SYS_COUNT_RX_LONGS, OCELOT_STAT_ETHTOOL(TX_AGED, "tx_aged"),
}, OCELOT_STAT_ETHTOOL(DROP_LOCAL, "drop_local"),
[OCELOT_STAT_RX_CLASSIFIED_DROPS] = { OCELOT_STAT_ETHTOOL(DROP_TAIL, "drop_tail"),
.name = "rx_classified_drops", OCELOT_STAT_ETHTOOL(DROP_YELLOW_PRIO_0, "drop_yellow_prio_0"),
.reg = SYS_COUNT_RX_CLASSIFIED_DROPS, OCELOT_STAT_ETHTOOL(DROP_YELLOW_PRIO_1, "drop_yellow_prio_1"),
}, OCELOT_STAT_ETHTOOL(DROP_YELLOW_PRIO_2, "drop_yellow_prio_2"),
[OCELOT_STAT_RX_RED_PRIO_0] = { OCELOT_STAT_ETHTOOL(DROP_YELLOW_PRIO_3, "drop_yellow_prio_3"),
.name = "rx_red_prio_0", OCELOT_STAT_ETHTOOL(DROP_YELLOW_PRIO_4, "drop_yellow_prio_4"),
.reg = SYS_COUNT_RX_RED_PRIO_0, OCELOT_STAT_ETHTOOL(DROP_YELLOW_PRIO_5, "drop_yellow_prio_5"),
}, OCELOT_STAT_ETHTOOL(DROP_YELLOW_PRIO_6, "drop_yellow_prio_6"),
[OCELOT_STAT_RX_RED_PRIO_1] = { OCELOT_STAT_ETHTOOL(DROP_YELLOW_PRIO_7, "drop_yellow_prio_7"),
.name = "rx_red_prio_1", OCELOT_STAT_ETHTOOL(DROP_GREEN_PRIO_0, "drop_green_prio_0"),
.reg = SYS_COUNT_RX_RED_PRIO_1, OCELOT_STAT_ETHTOOL(DROP_GREEN_PRIO_1, "drop_green_prio_1"),
}, OCELOT_STAT_ETHTOOL(DROP_GREEN_PRIO_2, "drop_green_prio_2"),
[OCELOT_STAT_RX_RED_PRIO_2] = { OCELOT_STAT_ETHTOOL(DROP_GREEN_PRIO_3, "drop_green_prio_3"),
.name = "rx_red_prio_2", OCELOT_STAT_ETHTOOL(DROP_GREEN_PRIO_4, "drop_green_prio_4"),
.reg = SYS_COUNT_RX_RED_PRIO_2, OCELOT_STAT_ETHTOOL(DROP_GREEN_PRIO_5, "drop_green_prio_5"),
}, OCELOT_STAT_ETHTOOL(DROP_GREEN_PRIO_6, "drop_green_prio_6"),
[OCELOT_STAT_RX_RED_PRIO_3] = { OCELOT_STAT_ETHTOOL(DROP_GREEN_PRIO_7, "drop_green_prio_7"),
.name = "rx_red_prio_3",
.reg = SYS_COUNT_RX_RED_PRIO_3,
},
[OCELOT_STAT_RX_RED_PRIO_4] = {
.name = "rx_red_prio_4",
.reg = SYS_COUNT_RX_RED_PRIO_4,
},
[OCELOT_STAT_RX_RED_PRIO_5] = {
.name = "rx_red_prio_5",
.reg = SYS_COUNT_RX_RED_PRIO_5,
},
[OCELOT_STAT_RX_RED_PRIO_6] = {
.name = "rx_red_prio_6",
.reg = SYS_COUNT_RX_RED_PRIO_6,
},
[OCELOT_STAT_RX_RED_PRIO_7] = {
.name = "rx_red_prio_7",
.reg = SYS_COUNT_RX_RED_PRIO_7,
},
[OCELOT_STAT_RX_YELLOW_PRIO_0] = {
.name = "rx_yellow_prio_0",
.reg = SYS_COUNT_RX_YELLOW_PRIO_0,
},
[OCELOT_STAT_RX_YELLOW_PRIO_1] = {
.name = "rx_yellow_prio_1",
.reg = SYS_COUNT_RX_YELLOW_PRIO_1,
},
[OCELOT_STAT_RX_YELLOW_PRIO_2] = {
.name = "rx_yellow_prio_2",
.reg = SYS_COUNT_RX_YELLOW_PRIO_2,
},
[OCELOT_STAT_RX_YELLOW_PRIO_3] = {
.name = "rx_yellow_prio_3",
.reg = SYS_COUNT_RX_YELLOW_PRIO_3,
},
[OCELOT_STAT_RX_YELLOW_PRIO_4] = {
.name = "rx_yellow_prio_4",
.reg = SYS_COUNT_RX_YELLOW_PRIO_4,
},
[OCELOT_STAT_RX_YELLOW_PRIO_5] = {
.name = "rx_yellow_prio_5",
.reg = SYS_COUNT_RX_YELLOW_PRIO_5,
},
[OCELOT_STAT_RX_YELLOW_PRIO_6] = {
.name = "rx_yellow_prio_6",
.reg = SYS_COUNT_RX_YELLOW_PRIO_6,
},
[OCELOT_STAT_RX_YELLOW_PRIO_7] = {
.name = "rx_yellow_prio_7",
.reg = SYS_COUNT_RX_YELLOW_PRIO_7,
},
[OCELOT_STAT_RX_GREEN_PRIO_0] = {
.name = "rx_green_prio_0",
.reg = SYS_COUNT_RX_GREEN_PRIO_0,
},
[OCELOT_STAT_RX_GREEN_PRIO_1] = {
.name = "rx_green_prio_1",
.reg = SYS_COUNT_RX_GREEN_PRIO_1,
},
[OCELOT_STAT_RX_GREEN_PRIO_2] = {
.name = "rx_green_prio_2",
.reg = SYS_COUNT_RX_GREEN_PRIO_2,
},
[OCELOT_STAT_RX_GREEN_PRIO_3] = {
.name = "rx_green_prio_3",
.reg = SYS_COUNT_RX_GREEN_PRIO_3,
},
[OCELOT_STAT_RX_GREEN_PRIO_4] = {
.name = "rx_green_prio_4",
.reg = SYS_COUNT_RX_GREEN_PRIO_4,
},
[OCELOT_STAT_RX_GREEN_PRIO_5] = {
.name = "rx_green_prio_5",
.reg = SYS_COUNT_RX_GREEN_PRIO_5,
},
[OCELOT_STAT_RX_GREEN_PRIO_6] = {
.name = "rx_green_prio_6",
.reg = SYS_COUNT_RX_GREEN_PRIO_6,
},
[OCELOT_STAT_RX_GREEN_PRIO_7] = {
.name = "rx_green_prio_7",
.reg = SYS_COUNT_RX_GREEN_PRIO_7,
},
[OCELOT_STAT_TX_OCTETS] = {
.name = "tx_octets",
.reg = SYS_COUNT_TX_OCTETS,
},
[OCELOT_STAT_TX_UNICAST] = {
.name = "tx_unicast",
.reg = SYS_COUNT_TX_UNICAST,
},
[OCELOT_STAT_TX_MULTICAST] = {
.name = "tx_multicast",
.reg = SYS_COUNT_TX_MULTICAST,
},
[OCELOT_STAT_TX_BROADCAST] = {
.name = "tx_broadcast",
.reg = SYS_COUNT_TX_BROADCAST,
},
[OCELOT_STAT_TX_COLLISION] = {
.name = "tx_collision",
.reg = SYS_COUNT_TX_COLLISION,
},
[OCELOT_STAT_TX_DROPS] = {
.name = "tx_drops",
.reg = SYS_COUNT_TX_DROPS,
},
[OCELOT_STAT_TX_PAUSE] = {
.name = "tx_pause",
.reg = SYS_COUNT_TX_PAUSE,
},
[OCELOT_STAT_TX_64] = {
.name = "tx_frames_below_65_octets",
.reg = SYS_COUNT_TX_64,
},
[OCELOT_STAT_TX_65_127] = {
.name = "tx_frames_65_to_127_octets",
.reg = SYS_COUNT_TX_65_127,
},
[OCELOT_STAT_TX_128_255] = {
.name = "tx_frames_128_255_octets",
.reg = SYS_COUNT_TX_128_255,
},
[OCELOT_STAT_TX_256_511] = {
.name = "tx_frames_256_511_octets",
.reg = SYS_COUNT_TX_256_511,
},
[OCELOT_STAT_TX_512_1023] = {
.name = "tx_frames_512_1023_octets",
.reg = SYS_COUNT_TX_512_1023,
},
[OCELOT_STAT_TX_1024_1526] = {
.name = "tx_frames_1024_1526_octets",
.reg = SYS_COUNT_TX_1024_1526,
},
[OCELOT_STAT_TX_1527_MAX] = {
.name = "tx_frames_over_1526_octets",
.reg = SYS_COUNT_TX_1527_MAX,
},
[OCELOT_STAT_TX_YELLOW_PRIO_0] = {
.name = "tx_yellow_prio_0",
.reg = SYS_COUNT_TX_YELLOW_PRIO_0,
},
[OCELOT_STAT_TX_YELLOW_PRIO_1] = {
.name = "tx_yellow_prio_1",
.reg = SYS_COUNT_TX_YELLOW_PRIO_1,
},
[OCELOT_STAT_TX_YELLOW_PRIO_2] = {
.name = "tx_yellow_prio_2",
.reg = SYS_COUNT_TX_YELLOW_PRIO_2,
},
[OCELOT_STAT_TX_YELLOW_PRIO_3] = {
.name = "tx_yellow_prio_3",
.reg = SYS_COUNT_TX_YELLOW_PRIO_3,
},
[OCELOT_STAT_TX_YELLOW_PRIO_4] = {
.name = "tx_yellow_prio_4",
.reg = SYS_COUNT_TX_YELLOW_PRIO_4,
},
[OCELOT_STAT_TX_YELLOW_PRIO_5] = {
.name = "tx_yellow_prio_5",
.reg = SYS_COUNT_TX_YELLOW_PRIO_5,
},
[OCELOT_STAT_TX_YELLOW_PRIO_6] = {
.name = "tx_yellow_prio_6",
.reg = SYS_COUNT_TX_YELLOW_PRIO_6,
},
[OCELOT_STAT_TX_YELLOW_PRIO_7] = {
.name = "tx_yellow_prio_7",
.reg = SYS_COUNT_TX_YELLOW_PRIO_7,
},
[OCELOT_STAT_TX_GREEN_PRIO_0] = {
.name = "tx_green_prio_0",
.reg = SYS_COUNT_TX_GREEN_PRIO_0,
},
[OCELOT_STAT_TX_GREEN_PRIO_1] = {
.name = "tx_green_prio_1",
.reg = SYS_COUNT_TX_GREEN_PRIO_1,
},
[OCELOT_STAT_TX_GREEN_PRIO_2] = {
.name = "tx_green_prio_2",
.reg = SYS_COUNT_TX_GREEN_PRIO_2,
},
[OCELOT_STAT_TX_GREEN_PRIO_3] = {
.name = "tx_green_prio_3",
.reg = SYS_COUNT_TX_GREEN_PRIO_3,
},
[OCELOT_STAT_TX_GREEN_PRIO_4] = {
.name = "tx_green_prio_4",
.reg = SYS_COUNT_TX_GREEN_PRIO_4,
},
[OCELOT_STAT_TX_GREEN_PRIO_5] = {
.name = "tx_green_prio_5",
.reg = SYS_COUNT_TX_GREEN_PRIO_5,
},
[OCELOT_STAT_TX_GREEN_PRIO_6] = {
.name = "tx_green_prio_6",
.reg = SYS_COUNT_TX_GREEN_PRIO_6,
},
[OCELOT_STAT_TX_GREEN_PRIO_7] = {
.name = "tx_green_prio_7",
.reg = SYS_COUNT_TX_GREEN_PRIO_7,
},
[OCELOT_STAT_TX_AGED] = {
.name = "tx_aged",
.reg = SYS_COUNT_TX_AGED,
},
[OCELOT_STAT_DROP_LOCAL] = {
.name = "drop_local",
.reg = SYS_COUNT_DROP_LOCAL,
},
[OCELOT_STAT_DROP_TAIL] = {
.name = "drop_tail",
.reg = SYS_COUNT_DROP_TAIL,
},
[OCELOT_STAT_DROP_YELLOW_PRIO_0] = {
.name = "drop_yellow_prio_0",
.reg = SYS_COUNT_DROP_YELLOW_PRIO_0,
},
[OCELOT_STAT_DROP_YELLOW_PRIO_1] = {
.name = "drop_yellow_prio_1",
.reg = SYS_COUNT_DROP_YELLOW_PRIO_1,
},
[OCELOT_STAT_DROP_YELLOW_PRIO_2] = {
.name = "drop_yellow_prio_2",
.reg = SYS_COUNT_DROP_YELLOW_PRIO_2,
},
[OCELOT_STAT_DROP_YELLOW_PRIO_3] = {
.name = "drop_yellow_prio_3",
.reg = SYS_COUNT_DROP_YELLOW_PRIO_3,
},
[OCELOT_STAT_DROP_YELLOW_PRIO_4] = {
.name = "drop_yellow_prio_4",
.reg = SYS_COUNT_DROP_YELLOW_PRIO_4,
},
[OCELOT_STAT_DROP_YELLOW_PRIO_5] = {
.name = "drop_yellow_prio_5",
.reg = SYS_COUNT_DROP_YELLOW_PRIO_5,
},
[OCELOT_STAT_DROP_YELLOW_PRIO_6] = {
.name = "drop_yellow_prio_6",
.reg = SYS_COUNT_DROP_YELLOW_PRIO_6,
},
[OCELOT_STAT_DROP_YELLOW_PRIO_7] = {
.name = "drop_yellow_prio_7",
.reg = SYS_COUNT_DROP_YELLOW_PRIO_7,
},
[OCELOT_STAT_DROP_GREEN_PRIO_0] = {
.name = "drop_green_prio_0",
.reg = SYS_COUNT_DROP_GREEN_PRIO_0,
},
[OCELOT_STAT_DROP_GREEN_PRIO_1] = {
.name = "drop_green_prio_1",
.reg = SYS_COUNT_DROP_GREEN_PRIO_1,
},
[OCELOT_STAT_DROP_GREEN_PRIO_2] = {
.name = "drop_green_prio_2",
.reg = SYS_COUNT_DROP_GREEN_PRIO_2,
},
[OCELOT_STAT_DROP_GREEN_PRIO_3] = {
.name = "drop_green_prio_3",
.reg = SYS_COUNT_DROP_GREEN_PRIO_3,
},
[OCELOT_STAT_DROP_GREEN_PRIO_4] = {
.name = "drop_green_prio_4",
.reg = SYS_COUNT_DROP_GREEN_PRIO_4,
},
[OCELOT_STAT_DROP_GREEN_PRIO_5] = {
.name = "drop_green_prio_5",
.reg = SYS_COUNT_DROP_GREEN_PRIO_5,
},
[OCELOT_STAT_DROP_GREEN_PRIO_6] = {
.name = "drop_green_prio_6",
.reg = SYS_COUNT_DROP_GREEN_PRIO_6,
},
[OCELOT_STAT_DROP_GREEN_PRIO_7] = {
.name = "drop_green_prio_7",
.reg = SYS_COUNT_DROP_GREEN_PRIO_7,
},
}; };
static const struct vcap_field vsc9953_vcap_es0_keys[] = { static const struct vcap_field vsc9953_vcap_es0_keys[] = {
......
...@@ -97,378 +97,99 @@ static const struct reg_field ocelot_regfields[REGFIELD_MAX] = { ...@@ -97,378 +97,99 @@ static const struct reg_field ocelot_regfields[REGFIELD_MAX] = {
}; };
static const struct ocelot_stat_layout ocelot_stats_layout[OCELOT_NUM_STATS] = { static const struct ocelot_stat_layout ocelot_stats_layout[OCELOT_NUM_STATS] = {
[OCELOT_STAT_RX_OCTETS] = { OCELOT_STAT_ETHTOOL(RX_OCTETS, "rx_octets"),
.name = "rx_octets", OCELOT_STAT_ETHTOOL(RX_UNICAST, "rx_unicast"),
.reg = SYS_COUNT_RX_OCTETS, OCELOT_STAT_ETHTOOL(RX_MULTICAST, "rx_multicast"),
}, OCELOT_STAT_ETHTOOL(RX_BROADCAST, "rx_broadcast"),
[OCELOT_STAT_RX_UNICAST] = { OCELOT_STAT_ETHTOOL(RX_SHORTS, "rx_shorts"),
.name = "rx_unicast", OCELOT_STAT_ETHTOOL(RX_FRAGMENTS, "rx_fragments"),
.reg = SYS_COUNT_RX_UNICAST, OCELOT_STAT_ETHTOOL(RX_JABBERS, "rx_jabbers"),
}, OCELOT_STAT_ETHTOOL(RX_CRC_ALIGN_ERRS, "rx_crc_align_errs"),
[OCELOT_STAT_RX_MULTICAST] = { OCELOT_STAT_ETHTOOL(RX_SYM_ERRS, "rx_sym_errs"),
.name = "rx_multicast", OCELOT_STAT_ETHTOOL(RX_64, "rx_frames_below_65_octets"),
.reg = SYS_COUNT_RX_MULTICAST, OCELOT_STAT_ETHTOOL(RX_65_127, "rx_frames_65_to_127_octets"),
}, OCELOT_STAT_ETHTOOL(RX_128_255, "rx_frames_128_to_255_octets"),
[OCELOT_STAT_RX_BROADCAST] = { OCELOT_STAT_ETHTOOL(RX_256_511, "rx_frames_256_to_511_octets"),
.name = "rx_broadcast", OCELOT_STAT_ETHTOOL(RX_512_1023, "rx_frames_512_to_1023_octets"),
.reg = SYS_COUNT_RX_BROADCAST, OCELOT_STAT_ETHTOOL(RX_1024_1526, "rx_frames_1024_to_1526_octets"),
}, OCELOT_STAT_ETHTOOL(RX_1527_MAX, "rx_frames_over_1526_octets"),
[OCELOT_STAT_RX_SHORTS] = { OCELOT_STAT_ETHTOOL(RX_PAUSE, "rx_pause"),
.name = "rx_shorts", OCELOT_STAT_ETHTOOL(RX_CONTROL, "rx_control"),
.reg = SYS_COUNT_RX_SHORTS, OCELOT_STAT_ETHTOOL(RX_LONGS, "rx_longs"),
}, OCELOT_STAT_ETHTOOL(RX_CLASSIFIED_DROPS, "rx_classified_drops"),
[OCELOT_STAT_RX_FRAGMENTS] = { OCELOT_STAT_ETHTOOL(RX_RED_PRIO_0, "rx_red_prio_0"),
.name = "rx_fragments", OCELOT_STAT_ETHTOOL(RX_RED_PRIO_1, "rx_red_prio_1"),
.reg = SYS_COUNT_RX_FRAGMENTS, OCELOT_STAT_ETHTOOL(RX_RED_PRIO_2, "rx_red_prio_2"),
}, OCELOT_STAT_ETHTOOL(RX_RED_PRIO_3, "rx_red_prio_3"),
[OCELOT_STAT_RX_JABBERS] = { OCELOT_STAT_ETHTOOL(RX_RED_PRIO_4, "rx_red_prio_4"),
.name = "rx_jabbers", OCELOT_STAT_ETHTOOL(RX_RED_PRIO_5, "rx_red_prio_5"),
.reg = SYS_COUNT_RX_JABBERS, OCELOT_STAT_ETHTOOL(RX_RED_PRIO_6, "rx_red_prio_6"),
}, OCELOT_STAT_ETHTOOL(RX_RED_PRIO_7, "rx_red_prio_7"),
[OCELOT_STAT_RX_CRC_ALIGN_ERRS] = { OCELOT_STAT_ETHTOOL(RX_YELLOW_PRIO_0, "rx_yellow_prio_0"),
.name = "rx_crc_align_errs", OCELOT_STAT_ETHTOOL(RX_YELLOW_PRIO_1, "rx_yellow_prio_1"),
.reg = SYS_COUNT_RX_CRC_ALIGN_ERRS, OCELOT_STAT_ETHTOOL(RX_YELLOW_PRIO_2, "rx_yellow_prio_2"),
}, OCELOT_STAT_ETHTOOL(RX_YELLOW_PRIO_3, "rx_yellow_prio_3"),
[OCELOT_STAT_RX_SYM_ERRS] = { OCELOT_STAT_ETHTOOL(RX_YELLOW_PRIO_4, "rx_yellow_prio_4"),
.name = "rx_sym_errs", OCELOT_STAT_ETHTOOL(RX_YELLOW_PRIO_5, "rx_yellow_prio_5"),
.reg = SYS_COUNT_RX_SYM_ERRS, OCELOT_STAT_ETHTOOL(RX_YELLOW_PRIO_6, "rx_yellow_prio_6"),
}, OCELOT_STAT_ETHTOOL(RX_YELLOW_PRIO_7, "rx_yellow_prio_7"),
[OCELOT_STAT_RX_64] = { OCELOT_STAT_ETHTOOL(RX_GREEN_PRIO_0, "rx_green_prio_0"),
.name = "rx_frames_below_65_octets", OCELOT_STAT_ETHTOOL(RX_GREEN_PRIO_1, "rx_green_prio_1"),
.reg = SYS_COUNT_RX_64, OCELOT_STAT_ETHTOOL(RX_GREEN_PRIO_2, "rx_green_prio_2"),
}, OCELOT_STAT_ETHTOOL(RX_GREEN_PRIO_3, "rx_green_prio_3"),
[OCELOT_STAT_RX_65_127] = { OCELOT_STAT_ETHTOOL(RX_GREEN_PRIO_4, "rx_green_prio_4"),
.name = "rx_frames_65_to_127_octets", OCELOT_STAT_ETHTOOL(RX_GREEN_PRIO_5, "rx_green_prio_5"),
.reg = SYS_COUNT_RX_65_127, OCELOT_STAT_ETHTOOL(RX_GREEN_PRIO_6, "rx_green_prio_6"),
}, OCELOT_STAT_ETHTOOL(RX_GREEN_PRIO_7, "rx_green_prio_7"),
[OCELOT_STAT_RX_128_255] = { OCELOT_STAT_ETHTOOL(TX_OCTETS, "tx_octets"),
.name = "rx_frames_128_to_255_octets", OCELOT_STAT_ETHTOOL(TX_UNICAST, "tx_unicast"),
.reg = SYS_COUNT_RX_128_255, OCELOT_STAT_ETHTOOL(TX_MULTICAST, "tx_multicast"),
}, OCELOT_STAT_ETHTOOL(TX_BROADCAST, "tx_broadcast"),
[OCELOT_STAT_RX_256_511] = { OCELOT_STAT_ETHTOOL(TX_COLLISION, "tx_collision"),
.name = "rx_frames_256_to_511_octets", OCELOT_STAT_ETHTOOL(TX_DROPS, "tx_drops"),
.reg = SYS_COUNT_RX_256_511, OCELOT_STAT_ETHTOOL(TX_PAUSE, "tx_pause"),
}, OCELOT_STAT_ETHTOOL(TX_64, "tx_frames_below_65_octets"),
[OCELOT_STAT_RX_512_1023] = { OCELOT_STAT_ETHTOOL(TX_65_127, "tx_frames_65_to_127_octets"),
.name = "rx_frames_512_to_1023_octets", OCELOT_STAT_ETHTOOL(TX_128_255, "tx_frames_128_255_octets"),
.reg = SYS_COUNT_RX_512_1023, OCELOT_STAT_ETHTOOL(TX_256_511, "tx_frames_256_511_octets"),
}, OCELOT_STAT_ETHTOOL(TX_512_1023, "tx_frames_512_1023_octets"),
[OCELOT_STAT_RX_1024_1526] = { OCELOT_STAT_ETHTOOL(TX_1024_1526, "tx_frames_1024_1526_octets"),
.name = "rx_frames_1024_to_1526_octets", OCELOT_STAT_ETHTOOL(TX_1527_MAX, "tx_frames_over_1526_octets"),
.reg = SYS_COUNT_RX_1024_1526, OCELOT_STAT_ETHTOOL(TX_YELLOW_PRIO_0, "tx_yellow_prio_0"),
}, OCELOT_STAT_ETHTOOL(TX_YELLOW_PRIO_1, "tx_yellow_prio_1"),
[OCELOT_STAT_RX_1527_MAX] = { OCELOT_STAT_ETHTOOL(TX_YELLOW_PRIO_2, "tx_yellow_prio_2"),
.name = "rx_frames_over_1526_octets", OCELOT_STAT_ETHTOOL(TX_YELLOW_PRIO_3, "tx_yellow_prio_3"),
.reg = SYS_COUNT_RX_1527_MAX, OCELOT_STAT_ETHTOOL(TX_YELLOW_PRIO_4, "tx_yellow_prio_4"),
}, OCELOT_STAT_ETHTOOL(TX_YELLOW_PRIO_5, "tx_yellow_prio_5"),
[OCELOT_STAT_RX_PAUSE] = { OCELOT_STAT_ETHTOOL(TX_YELLOW_PRIO_6, "tx_yellow_prio_6"),
.name = "rx_pause", OCELOT_STAT_ETHTOOL(TX_YELLOW_PRIO_7, "tx_yellow_prio_7"),
.reg = SYS_COUNT_RX_PAUSE, OCELOT_STAT_ETHTOOL(TX_GREEN_PRIO_0, "tx_green_prio_0"),
}, OCELOT_STAT_ETHTOOL(TX_GREEN_PRIO_1, "tx_green_prio_1"),
[OCELOT_STAT_RX_CONTROL] = { OCELOT_STAT_ETHTOOL(TX_GREEN_PRIO_2, "tx_green_prio_2"),
.name = "rx_control", OCELOT_STAT_ETHTOOL(TX_GREEN_PRIO_3, "tx_green_prio_3"),
.reg = SYS_COUNT_RX_CONTROL, OCELOT_STAT_ETHTOOL(TX_GREEN_PRIO_4, "tx_green_prio_4"),
}, OCELOT_STAT_ETHTOOL(TX_GREEN_PRIO_5, "tx_green_prio_5"),
[OCELOT_STAT_RX_LONGS] = { OCELOT_STAT_ETHTOOL(TX_GREEN_PRIO_6, "tx_green_prio_6"),
.name = "rx_longs", OCELOT_STAT_ETHTOOL(TX_GREEN_PRIO_7, "tx_green_prio_7"),
.reg = SYS_COUNT_RX_LONGS, OCELOT_STAT_ETHTOOL(TX_AGED, "tx_aged"),
}, OCELOT_STAT_ETHTOOL(DROP_LOCAL, "drop_local"),
[OCELOT_STAT_RX_CLASSIFIED_DROPS] = { OCELOT_STAT_ETHTOOL(DROP_TAIL, "drop_tail"),
.name = "rx_classified_drops", OCELOT_STAT_ETHTOOL(DROP_YELLOW_PRIO_0, "drop_yellow_prio_0"),
.reg = SYS_COUNT_RX_CLASSIFIED_DROPS, OCELOT_STAT_ETHTOOL(DROP_YELLOW_PRIO_1, "drop_yellow_prio_1"),
}, OCELOT_STAT_ETHTOOL(DROP_YELLOW_PRIO_2, "drop_yellow_prio_2"),
[OCELOT_STAT_RX_RED_PRIO_0] = { OCELOT_STAT_ETHTOOL(DROP_YELLOW_PRIO_3, "drop_yellow_prio_3"),
.name = "rx_red_prio_0", OCELOT_STAT_ETHTOOL(DROP_YELLOW_PRIO_4, "drop_yellow_prio_4"),
.reg = SYS_COUNT_RX_RED_PRIO_0, OCELOT_STAT_ETHTOOL(DROP_YELLOW_PRIO_5, "drop_yellow_prio_5"),
}, OCELOT_STAT_ETHTOOL(DROP_YELLOW_PRIO_6, "drop_yellow_prio_6"),
[OCELOT_STAT_RX_RED_PRIO_1] = { OCELOT_STAT_ETHTOOL(DROP_YELLOW_PRIO_7, "drop_yellow_prio_7"),
.name = "rx_red_prio_1", OCELOT_STAT_ETHTOOL(DROP_GREEN_PRIO_0, "drop_green_prio_0"),
.reg = SYS_COUNT_RX_RED_PRIO_1, OCELOT_STAT_ETHTOOL(DROP_GREEN_PRIO_1, "drop_green_prio_1"),
}, OCELOT_STAT_ETHTOOL(DROP_GREEN_PRIO_2, "drop_green_prio_2"),
[OCELOT_STAT_RX_RED_PRIO_2] = { OCELOT_STAT_ETHTOOL(DROP_GREEN_PRIO_3, "drop_green_prio_3"),
.name = "rx_red_prio_2", OCELOT_STAT_ETHTOOL(DROP_GREEN_PRIO_4, "drop_green_prio_4"),
.reg = SYS_COUNT_RX_RED_PRIO_2, OCELOT_STAT_ETHTOOL(DROP_GREEN_PRIO_5, "drop_green_prio_5"),
}, OCELOT_STAT_ETHTOOL(DROP_GREEN_PRIO_6, "drop_green_prio_6"),
[OCELOT_STAT_RX_RED_PRIO_3] = { OCELOT_STAT_ETHTOOL(DROP_GREEN_PRIO_7, "drop_green_prio_7"),
.name = "rx_red_prio_3",
.reg = SYS_COUNT_RX_RED_PRIO_3,
},
[OCELOT_STAT_RX_RED_PRIO_4] = {
.name = "rx_red_prio_4",
.reg = SYS_COUNT_RX_RED_PRIO_4,
},
[OCELOT_STAT_RX_RED_PRIO_5] = {
.name = "rx_red_prio_5",
.reg = SYS_COUNT_RX_RED_PRIO_5,
},
[OCELOT_STAT_RX_RED_PRIO_6] = {
.name = "rx_red_prio_6",
.reg = SYS_COUNT_RX_RED_PRIO_6,
},
[OCELOT_STAT_RX_RED_PRIO_7] = {
.name = "rx_red_prio_7",
.reg = SYS_COUNT_RX_RED_PRIO_7,
},
[OCELOT_STAT_RX_YELLOW_PRIO_0] = {
.name = "rx_yellow_prio_0",
.reg = SYS_COUNT_RX_YELLOW_PRIO_0,
},
[OCELOT_STAT_RX_YELLOW_PRIO_1] = {
.name = "rx_yellow_prio_1",
.reg = SYS_COUNT_RX_YELLOW_PRIO_1,
},
[OCELOT_STAT_RX_YELLOW_PRIO_2] = {
.name = "rx_yellow_prio_2",
.reg = SYS_COUNT_RX_YELLOW_PRIO_2,
},
[OCELOT_STAT_RX_YELLOW_PRIO_3] = {
.name = "rx_yellow_prio_3",
.reg = SYS_COUNT_RX_YELLOW_PRIO_3,
},
[OCELOT_STAT_RX_YELLOW_PRIO_4] = {
.name = "rx_yellow_prio_4",
.reg = SYS_COUNT_RX_YELLOW_PRIO_4,
},
[OCELOT_STAT_RX_YELLOW_PRIO_5] = {
.name = "rx_yellow_prio_5",
.reg = SYS_COUNT_RX_YELLOW_PRIO_5,
},
[OCELOT_STAT_RX_YELLOW_PRIO_6] = {
.name = "rx_yellow_prio_6",
.reg = SYS_COUNT_RX_YELLOW_PRIO_6,
},
[OCELOT_STAT_RX_YELLOW_PRIO_7] = {
.name = "rx_yellow_prio_7",
.reg = SYS_COUNT_RX_YELLOW_PRIO_7,
},
[OCELOT_STAT_RX_GREEN_PRIO_0] = {
.name = "rx_green_prio_0",
.reg = SYS_COUNT_RX_GREEN_PRIO_0,
},
[OCELOT_STAT_RX_GREEN_PRIO_1] = {
.name = "rx_green_prio_1",
.reg = SYS_COUNT_RX_GREEN_PRIO_1,
},
[OCELOT_STAT_RX_GREEN_PRIO_2] = {
.name = "rx_green_prio_2",
.reg = SYS_COUNT_RX_GREEN_PRIO_2,
},
[OCELOT_STAT_RX_GREEN_PRIO_3] = {
.name = "rx_green_prio_3",
.reg = SYS_COUNT_RX_GREEN_PRIO_3,
},
[OCELOT_STAT_RX_GREEN_PRIO_4] = {
.name = "rx_green_prio_4",
.reg = SYS_COUNT_RX_GREEN_PRIO_4,
},
[OCELOT_STAT_RX_GREEN_PRIO_5] = {
.name = "rx_green_prio_5",
.reg = SYS_COUNT_RX_GREEN_PRIO_5,
},
[OCELOT_STAT_RX_GREEN_PRIO_6] = {
.name = "rx_green_prio_6",
.reg = SYS_COUNT_RX_GREEN_PRIO_6,
},
[OCELOT_STAT_RX_GREEN_PRIO_7] = {
.name = "rx_green_prio_7",
.reg = SYS_COUNT_RX_GREEN_PRIO_7,
},
[OCELOT_STAT_TX_OCTETS] = {
.name = "tx_octets",
.reg = SYS_COUNT_TX_OCTETS,
},
[OCELOT_STAT_TX_UNICAST] = {
.name = "tx_unicast",
.reg = SYS_COUNT_TX_UNICAST,
},
[OCELOT_STAT_TX_MULTICAST] = {
.name = "tx_multicast",
.reg = SYS_COUNT_TX_MULTICAST,
},
[OCELOT_STAT_TX_BROADCAST] = {
.name = "tx_broadcast",
.reg = SYS_COUNT_TX_BROADCAST,
},
[OCELOT_STAT_TX_COLLISION] = {
.name = "tx_collision",
.reg = SYS_COUNT_TX_COLLISION,
},
[OCELOT_STAT_TX_DROPS] = {
.name = "tx_drops",
.reg = SYS_COUNT_TX_DROPS,
},
[OCELOT_STAT_TX_PAUSE] = {
.name = "tx_pause",
.reg = SYS_COUNT_TX_PAUSE,
},
[OCELOT_STAT_TX_64] = {
.name = "tx_frames_below_65_octets",
.reg = SYS_COUNT_TX_64,
},
[OCELOT_STAT_TX_65_127] = {
.name = "tx_frames_65_to_127_octets",
.reg = SYS_COUNT_TX_65_127,
},
[OCELOT_STAT_TX_128_255] = {
.name = "tx_frames_128_255_octets",
.reg = SYS_COUNT_TX_128_255,
},
[OCELOT_STAT_TX_256_511] = {
.name = "tx_frames_256_511_octets",
.reg = SYS_COUNT_TX_256_511,
},
[OCELOT_STAT_TX_512_1023] = {
.name = "tx_frames_512_1023_octets",
.reg = SYS_COUNT_TX_512_1023,
},
[OCELOT_STAT_TX_1024_1526] = {
.name = "tx_frames_1024_1526_octets",
.reg = SYS_COUNT_TX_1024_1526,
},
[OCELOT_STAT_TX_1527_MAX] = {
.name = "tx_frames_over_1526_octets",
.reg = SYS_COUNT_TX_1527_MAX,
},
[OCELOT_STAT_TX_YELLOW_PRIO_0] = {
.name = "tx_yellow_prio_0",
.reg = SYS_COUNT_TX_YELLOW_PRIO_0,
},
[OCELOT_STAT_TX_YELLOW_PRIO_1] = {
.name = "tx_yellow_prio_1",
.reg = SYS_COUNT_TX_YELLOW_PRIO_1,
},
[OCELOT_STAT_TX_YELLOW_PRIO_2] = {
.name = "tx_yellow_prio_2",
.reg = SYS_COUNT_TX_YELLOW_PRIO_2,
},
[OCELOT_STAT_TX_YELLOW_PRIO_3] = {
.name = "tx_yellow_prio_3",
.reg = SYS_COUNT_TX_YELLOW_PRIO_3,
},
[OCELOT_STAT_TX_YELLOW_PRIO_4] = {
.name = "tx_yellow_prio_4",
.reg = SYS_COUNT_TX_YELLOW_PRIO_4,
},
[OCELOT_STAT_TX_YELLOW_PRIO_5] = {
.name = "tx_yellow_prio_5",
.reg = SYS_COUNT_TX_YELLOW_PRIO_5,
},
[OCELOT_STAT_TX_YELLOW_PRIO_6] = {
.name = "tx_yellow_prio_6",
.reg = SYS_COUNT_TX_YELLOW_PRIO_6,
},
[OCELOT_STAT_TX_YELLOW_PRIO_7] = {
.name = "tx_yellow_prio_7",
.reg = SYS_COUNT_TX_YELLOW_PRIO_7,
},
[OCELOT_STAT_TX_GREEN_PRIO_0] = {
.name = "tx_green_prio_0",
.reg = SYS_COUNT_TX_GREEN_PRIO_0,
},
[OCELOT_STAT_TX_GREEN_PRIO_1] = {
.name = "tx_green_prio_1",
.reg = SYS_COUNT_TX_GREEN_PRIO_1,
},
[OCELOT_STAT_TX_GREEN_PRIO_2] = {
.name = "tx_green_prio_2",
.reg = SYS_COUNT_TX_GREEN_PRIO_2,
},
[OCELOT_STAT_TX_GREEN_PRIO_3] = {
.name = "tx_green_prio_3",
.reg = SYS_COUNT_TX_GREEN_PRIO_3,
},
[OCELOT_STAT_TX_GREEN_PRIO_4] = {
.name = "tx_green_prio_4",
.reg = SYS_COUNT_TX_GREEN_PRIO_4,
},
[OCELOT_STAT_TX_GREEN_PRIO_5] = {
.name = "tx_green_prio_5",
.reg = SYS_COUNT_TX_GREEN_PRIO_5,
},
[OCELOT_STAT_TX_GREEN_PRIO_6] = {
.name = "tx_green_prio_6",
.reg = SYS_COUNT_TX_GREEN_PRIO_6,
},
[OCELOT_STAT_TX_GREEN_PRIO_7] = {
.name = "tx_green_prio_7",
.reg = SYS_COUNT_TX_GREEN_PRIO_7,
},
[OCELOT_STAT_TX_AGED] = {
.name = "tx_aged",
.reg = SYS_COUNT_TX_AGED,
},
[OCELOT_STAT_DROP_LOCAL] = {
.name = "drop_local",
.reg = SYS_COUNT_DROP_LOCAL,
},
[OCELOT_STAT_DROP_TAIL] = {
.name = "drop_tail",
.reg = SYS_COUNT_DROP_TAIL,
},
[OCELOT_STAT_DROP_YELLOW_PRIO_0] = {
.name = "drop_yellow_prio_0",
.reg = SYS_COUNT_DROP_YELLOW_PRIO_0,
},
[OCELOT_STAT_DROP_YELLOW_PRIO_1] = {
.name = "drop_yellow_prio_1",
.reg = SYS_COUNT_DROP_YELLOW_PRIO_1,
},
[OCELOT_STAT_DROP_YELLOW_PRIO_2] = {
.name = "drop_yellow_prio_2",
.reg = SYS_COUNT_DROP_YELLOW_PRIO_2,
},
[OCELOT_STAT_DROP_YELLOW_PRIO_3] = {
.name = "drop_yellow_prio_3",
.reg = SYS_COUNT_DROP_YELLOW_PRIO_3,
},
[OCELOT_STAT_DROP_YELLOW_PRIO_4] = {
.name = "drop_yellow_prio_4",
.reg = SYS_COUNT_DROP_YELLOW_PRIO_4,
},
[OCELOT_STAT_DROP_YELLOW_PRIO_5] = {
.name = "drop_yellow_prio_5",
.reg = SYS_COUNT_DROP_YELLOW_PRIO_5,
},
[OCELOT_STAT_DROP_YELLOW_PRIO_6] = {
.name = "drop_yellow_prio_6",
.reg = SYS_COUNT_DROP_YELLOW_PRIO_6,
},
[OCELOT_STAT_DROP_YELLOW_PRIO_7] = {
.name = "drop_yellow_prio_7",
.reg = SYS_COUNT_DROP_YELLOW_PRIO_7,
},
[OCELOT_STAT_DROP_GREEN_PRIO_0] = {
.name = "drop_green_prio_0",
.reg = SYS_COUNT_DROP_GREEN_PRIO_0,
},
[OCELOT_STAT_DROP_GREEN_PRIO_1] = {
.name = "drop_green_prio_1",
.reg = SYS_COUNT_DROP_GREEN_PRIO_1,
},
[OCELOT_STAT_DROP_GREEN_PRIO_2] = {
.name = "drop_green_prio_2",
.reg = SYS_COUNT_DROP_GREEN_PRIO_2,
},
[OCELOT_STAT_DROP_GREEN_PRIO_3] = {
.name = "drop_green_prio_3",
.reg = SYS_COUNT_DROP_GREEN_PRIO_3,
},
[OCELOT_STAT_DROP_GREEN_PRIO_4] = {
.name = "drop_green_prio_4",
.reg = SYS_COUNT_DROP_GREEN_PRIO_4,
},
[OCELOT_STAT_DROP_GREEN_PRIO_5] = {
.name = "drop_green_prio_5",
.reg = SYS_COUNT_DROP_GREEN_PRIO_5,
},
[OCELOT_STAT_DROP_GREEN_PRIO_6] = {
.name = "drop_green_prio_6",
.reg = SYS_COUNT_DROP_GREEN_PRIO_6,
},
[OCELOT_STAT_DROP_GREEN_PRIO_7] = {
.name = "drop_green_prio_7",
.reg = SYS_COUNT_DROP_GREEN_PRIO_7,
},
}; };
static void ocelot_pll5_init(struct ocelot *ocelot) static void ocelot_pll5_init(struct ocelot *ocelot)
......
...@@ -698,6 +698,17 @@ struct ocelot_stat_layout { ...@@ -698,6 +698,17 @@ struct ocelot_stat_layout {
char name[ETH_GSTRING_LEN]; char name[ETH_GSTRING_LEN];
}; };
/* 32-bit counter checked for wraparound by ocelot_port_update_stats()
* and copied to ocelot->stats.
*/
#define OCELOT_STAT(kind) \
[OCELOT_STAT_ ## kind] = { .reg = SYS_COUNT_ ## kind }
/* Same as above, except also exported to ethtool -S. Standard counters should
* only be exposed to more specific interfaces rather than by their string name.
*/
#define OCELOT_STAT_ETHTOOL(kind, ethtool_name) \
[OCELOT_STAT_ ## kind] = { .reg = SYS_COUNT_ ## kind, .name = ethtool_name }
struct ocelot_stats_region { struct ocelot_stats_region {
struct list_head node; struct list_head node;
u32 base; u32 base;
......
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