Netdev List
 help / color / mirror / Atom feed
From: Ido Schimmel <idosch@mellanox.com>
To: netdev@vger.kernel.org
Cc: davem@davemloft.net, jiri@mellanox.com, mlxsw@mellanox.com,
	Petr Machata <petrm@mellanox.com>,
	Ido Schimmel <idosch@mellanox.com>
Subject: [PATCH net-next 6/7] mlxsw: spectrum: Include RFC-2819 counters in stats length
Date: Thu,  9 Aug 2018 11:59:12 +0300	[thread overview]
Message-ID: <20180809085913.20671-7-idosch@mellanox.com> (raw)
In-Reply-To: <20180809085913.20671-1-idosch@mellanox.com>

From: Petr Machata <petrm@mellanox.com>

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>
---
 drivers/net/ethernet/mellanox/mlxsw/spectrum.c | 1 +
 1 file changed, 1 insertion(+)

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)
-- 
2.17.1

  parent reply	other threads:[~2018-08-09 11:23 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-09  8:59 [PATCH net-next 0/7] mlxsw: Various updates Ido Schimmel
2018-08-09  8:59 ` [PATCH net-next 1/7] mlxsw: spectrum_flower: Disallow usage of vlan_id key on egress Ido Schimmel
2018-08-09  8:59 ` [PATCH net-next 2/7] mlxsw: spectrum: Update the supported firmware to version 13.1702.6 Ido Schimmel
2018-08-09  8:59 ` [PATCH net-next 3/7] mlxsw: spectrum: Reset FW after flash Ido Schimmel
2018-08-09  8:59 ` [PATCH net-next 4/7] selftests: mlxsw: Add TC flower test for Spectrum-2 Ido Schimmel
2018-08-09  8:59 ` [PATCH net-next 5/7] mlxsw: Replace license text with SPDX identifiers and adjust copyrights Ido Schimmel
2018-08-09  8:59 ` Ido Schimmel [this message]
2018-08-09  8:59 ` [PATCH net-next 7/7] mlxsw: spectrum: Expose counter for all 16 TCs Ido Schimmel
2018-08-09 17:37 ` [PATCH net-next 0/7] mlxsw: Various updates David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180809085913.20671-7-idosch@mellanox.com \
    --to=idosch@mellanox.com \
    --cc=davem@davemloft.net \
    --cc=jiri@mellanox.com \
    --cc=mlxsw@mellanox.com \
    --cc=netdev@vger.kernel.org \
    --cc=petrm@mellanox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox