summaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet
diff options
context:
space:
mode:
authorPetr Machata2018-08-09 10:59:12 +0200
committerDavid S. Miller2018-08-09 19:36:10 +0200
commit9897dce2e39aa2f1fa7260b4a936a34f3fc6e775 (patch)
tree3e17d72467096300f3dc9ec2a57342a971489cb3 /drivers/net/ethernet
parentmlxsw: Replace license text with SPDX identifiers and adjust copyrights (diff)
downloadkernel-qcow2-linux-9897dce2e39aa2f1fa7260b4a936a34f3fc6e775.tar.gz
kernel-qcow2-linux-9897dce2e39aa2f1fa7260b4a936a34f3fc6e775.tar.xz
kernel-qcow2-linux-9897dce2e39aa2f1fa7260b4a936a34f3fc6e775.zip
mlxsw: spectrum: Include RFC-2819 counters in stats length
The function mlxsw_sp_port_get_sset_count() is supposed to return the total number of ethtool strings that mlxsw supports. Specifically for names of statistic counters (the only string type that mlxsw supports as of now), that number is stored in MLXSW_SP_PORT_ETHTOOL_STATS_LEN. However, when adding RFC-2891 counters, that define wasn't updated to include the new counters. As a result, ethtool snips out the counters towards the end of the list, which contains per-TC counters, and only the first three traffic classes end up being reported. Fix by adding MLXSW_SP_PORT_HW_RFC_2819_STATS_LEN as appropriate. Fixes: 1222d15a01c7 ("mlxsw: spectrum: Expose counters for various packet sizes") Signed-off-by: Petr Machata <petrm@mellanox.com> Signed-off-by: Ido Schimmel <idosch@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet')
-rw-r--r--drivers/net/ethernet/mellanox/mlxsw/spectrum.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum.c
index 6a0235395ac4..264e3aa805da 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/spectrum.c
+++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum.c
@@ -1971,6 +1971,7 @@ static struct mlxsw_sp_port_hw_stats mlxsw_sp_port_hw_tc_stats[] = {
#define MLXSW_SP_PORT_HW_TC_STATS_LEN ARRAY_SIZE(mlxsw_sp_port_hw_tc_stats)
#define MLXSW_SP_PORT_ETHTOOL_STATS_LEN (MLXSW_SP_PORT_HW_STATS_LEN + \
+ MLXSW_SP_PORT_HW_RFC_2819_STATS_LEN + \
(MLXSW_SP_PORT_HW_PRIO_STATS_LEN + \
MLXSW_SP_PORT_HW_TC_STATS_LEN) * \
IEEE_8021QAZ_MAX_TCS)