diff options
author | Rana Shahout <ranas@mellanox.com> | 2016-04-20 22:02:10 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-04-21 15:09:04 -0400 |
commit | 593cf33829adfd3d5c75d42879cc42afded1b626 (patch) | |
tree | a268423b58d162263ae2d0682cee115fcd3f5e02 /drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c | |
parent | 237cd218099ce96edf2890a49aa191b38b84c2fc (diff) |
net/mlx5e: Allocate set of queue counters per netdev
Connect all netdev RQs to this set of queue counters.
Also, add an "rx_out_of_buffer" counter to ethtool,
which indicates RX packet drops due to lack of receive
buffers.
Signed-off-by: Rana Shahout <ranas@mellanox.com>
Signed-off-by: Tariq Toukan <tariqt@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c')
-rw-r--r-- | drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c b/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c index 68834b715f6c..39c19021d154 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c @@ -165,6 +165,8 @@ static const struct { }, }; +#define MLX5E_NUM_Q_CNTRS(priv) (NUM_Q_COUNTERS * (!!priv->q_counter)) + static int mlx5e_get_sset_count(struct net_device *dev, int sset) { struct mlx5e_priv *priv = netdev_priv(dev); @@ -172,6 +174,7 @@ static int mlx5e_get_sset_count(struct net_device *dev, int sset) switch (sset) { case ETH_SS_STATS: return NUM_VPORT_COUNTERS + NUM_PPORT_COUNTERS + + MLX5E_NUM_Q_CNTRS(priv) + priv->params.num_channels * NUM_RQ_STATS + priv->params.num_channels * priv->params.num_tc * NUM_SQ_STATS; @@ -200,6 +203,11 @@ static void mlx5e_get_strings(struct net_device *dev, strcpy(data + (idx++) * ETH_GSTRING_LEN, vport_strings[i]); + /* Q counters */ + for (i = 0; i < MLX5E_NUM_Q_CNTRS(priv); i++) + strcpy(data + (idx++) * ETH_GSTRING_LEN, + qcounter_stats_strings[i]); + /* PPORT counters */ for (i = 0; i < NUM_PPORT_COUNTERS; i++) strcpy(data + (idx++) * ETH_GSTRING_LEN, @@ -240,6 +248,9 @@ static void mlx5e_get_ethtool_stats(struct net_device *dev, for (i = 0; i < NUM_VPORT_COUNTERS; i++) data[idx++] = ((u64 *)&priv->stats.vport)[i]; + for (i = 0; i < MLX5E_NUM_Q_CNTRS(priv); i++) + data[idx++] = ((u32 *)&priv->stats.qcnt)[i]; + for (i = 0; i < NUM_PPORT_COUNTERS; i++) data[idx++] = be64_to_cpu(((__be64 *)&priv->stats.pport)[i]); |