|
@@ -1888,6 +1888,52 @@ static struct mlxsw_sp_port_hw_stats mlxsw_sp_port_hw_stats[] = {
|
|
|
|
|
|
|
|
#define MLXSW_SP_PORT_HW_STATS_LEN ARRAY_SIZE(mlxsw_sp_port_hw_stats)
|
|
#define MLXSW_SP_PORT_HW_STATS_LEN ARRAY_SIZE(mlxsw_sp_port_hw_stats)
|
|
|
|
|
|
|
|
|
|
+static struct mlxsw_sp_port_hw_stats mlxsw_sp_port_hw_rfc_2819_stats[] = {
|
|
|
|
|
+ {
|
|
|
|
|
+ .str = "ether_pkts64octets",
|
|
|
|
|
+ .getter = mlxsw_reg_ppcnt_ether_stats_pkts64octets_get,
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ .str = "ether_pkts65to127octets",
|
|
|
|
|
+ .getter = mlxsw_reg_ppcnt_ether_stats_pkts65to127octets_get,
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ .str = "ether_pkts128to255octets",
|
|
|
|
|
+ .getter = mlxsw_reg_ppcnt_ether_stats_pkts128to255octets_get,
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ .str = "ether_pkts256to511octets",
|
|
|
|
|
+ .getter = mlxsw_reg_ppcnt_ether_stats_pkts256to511octets_get,
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ .str = "ether_pkts512to1023octets",
|
|
|
|
|
+ .getter = mlxsw_reg_ppcnt_ether_stats_pkts512to1023octets_get,
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ .str = "ether_pkts1024to1518octets",
|
|
|
|
|
+ .getter = mlxsw_reg_ppcnt_ether_stats_pkts1024to1518octets_get,
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ .str = "ether_pkts1519to2047octets",
|
|
|
|
|
+ .getter = mlxsw_reg_ppcnt_ether_stats_pkts1519to2047octets_get,
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ .str = "ether_pkts2048to4095octets",
|
|
|
|
|
+ .getter = mlxsw_reg_ppcnt_ether_stats_pkts2048to4095octets_get,
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ .str = "ether_pkts4096to8191octets",
|
|
|
|
|
+ .getter = mlxsw_reg_ppcnt_ether_stats_pkts4096to8191octets_get,
|
|
|
|
|
+ },
|
|
|
|
|
+ {
|
|
|
|
|
+ .str = "ether_pkts8192to10239octets",
|
|
|
|
|
+ .getter = mlxsw_reg_ppcnt_ether_stats_pkts8192to10239octets_get,
|
|
|
|
|
+ },
|
|
|
|
|
+};
|
|
|
|
|
+
|
|
|
|
|
+#define MLXSW_SP_PORT_HW_RFC_2819_STATS_LEN \
|
|
|
|
|
+ ARRAY_SIZE(mlxsw_sp_port_hw_rfc_2819_stats)
|
|
|
|
|
+
|
|
|
static struct mlxsw_sp_port_hw_stats mlxsw_sp_port_hw_prio_stats[] = {
|
|
static struct mlxsw_sp_port_hw_stats mlxsw_sp_port_hw_prio_stats[] = {
|
|
|
{
|
|
{
|
|
|
.str = "rx_octets_prio",
|
|
.str = "rx_octets_prio",
|
|
@@ -1979,6 +2025,11 @@ static void mlxsw_sp_port_get_strings(struct net_device *dev,
|
|
|
ETH_GSTRING_LEN);
|
|
ETH_GSTRING_LEN);
|
|
|
p += ETH_GSTRING_LEN;
|
|
p += ETH_GSTRING_LEN;
|
|
|
}
|
|
}
|
|
|
|
|
+ for (i = 0; i < MLXSW_SP_PORT_HW_RFC_2819_STATS_LEN; i++) {
|
|
|
|
|
+ memcpy(p, mlxsw_sp_port_hw_rfc_2819_stats[i].str,
|
|
|
|
|
+ ETH_GSTRING_LEN);
|
|
|
|
|
+ p += ETH_GSTRING_LEN;
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
for (i = 0; i < IEEE_8021QAZ_MAX_TCS; i++)
|
|
for (i = 0; i < IEEE_8021QAZ_MAX_TCS; i++)
|
|
|
mlxsw_sp_port_get_prio_strings(&p, i);
|
|
mlxsw_sp_port_get_prio_strings(&p, i);
|
|
@@ -2018,10 +2069,14 @@ mlxsw_sp_get_hw_stats_by_group(struct mlxsw_sp_port_hw_stats **p_hw_stats,
|
|
|
int *p_len, enum mlxsw_reg_ppcnt_grp grp)
|
|
int *p_len, enum mlxsw_reg_ppcnt_grp grp)
|
|
|
{
|
|
{
|
|
|
switch (grp) {
|
|
switch (grp) {
|
|
|
- case MLXSW_REG_PPCNT_IEEE_8023_CNT:
|
|
|
|
|
|
|
+ case MLXSW_REG_PPCNT_IEEE_8023_CNT:
|
|
|
*p_hw_stats = mlxsw_sp_port_hw_stats;
|
|
*p_hw_stats = mlxsw_sp_port_hw_stats;
|
|
|
*p_len = MLXSW_SP_PORT_HW_STATS_LEN;
|
|
*p_len = MLXSW_SP_PORT_HW_STATS_LEN;
|
|
|
break;
|
|
break;
|
|
|
|
|
+ case MLXSW_REG_PPCNT_RFC_2819_CNT:
|
|
|
|
|
+ *p_hw_stats = mlxsw_sp_port_hw_rfc_2819_stats;
|
|
|
|
|
+ *p_len = MLXSW_SP_PORT_HW_RFC_2819_STATS_LEN;
|
|
|
|
|
+ break;
|
|
|
case MLXSW_REG_PPCNT_PRIO_CNT:
|
|
case MLXSW_REG_PPCNT_PRIO_CNT:
|
|
|
*p_hw_stats = mlxsw_sp_port_hw_prio_stats;
|
|
*p_hw_stats = mlxsw_sp_port_hw_prio_stats;
|
|
|
*p_len = MLXSW_SP_PORT_HW_PRIO_STATS_LEN;
|
|
*p_len = MLXSW_SP_PORT_HW_PRIO_STATS_LEN;
|
|
@@ -2071,6 +2126,11 @@ static void mlxsw_sp_port_get_stats(struct net_device *dev,
|
|
|
data, data_index);
|
|
data, data_index);
|
|
|
data_index = MLXSW_SP_PORT_HW_STATS_LEN;
|
|
data_index = MLXSW_SP_PORT_HW_STATS_LEN;
|
|
|
|
|
|
|
|
|
|
+ /* RFC 2819 Counters */
|
|
|
|
|
+ __mlxsw_sp_port_get_stats(dev, MLXSW_REG_PPCNT_RFC_2819_CNT, 0,
|
|
|
|
|
+ data, data_index);
|
|
|
|
|
+ data_index += MLXSW_SP_PORT_HW_RFC_2819_STATS_LEN;
|
|
|
|
|
+
|
|
|
/* Per-Priority Counters */
|
|
/* Per-Priority Counters */
|
|
|
for (i = 0; i < IEEE_8021QAZ_MAX_TCS; i++) {
|
|
for (i = 0; i < IEEE_8021QAZ_MAX_TCS; i++) {
|
|
|
__mlxsw_sp_port_get_stats(dev, MLXSW_REG_PPCNT_PRIO_CNT, i,
|
|
__mlxsw_sp_port_get_stats(dev, MLXSW_REG_PPCNT_PRIO_CNT, i,
|