net/mlx5e: Present SW stats when state is not opened
authorEran Ben Elisha <eranbe@mellanox.com>
Tue, 29 May 2018 07:54:47 +0000 (10:54 +0300)
committerSaeed Mahameed <saeedm@mellanox.com>
Fri, 1 Jun 2018 23:48:14 +0000 (16:48 -0700)
commit8bfaf07f780683948a3183d3b14a76dfd50bf899
treefdef3609ad237511fa25bf7477ccb947455fa36b
parentc90262f8468acfed573e195de9443007dad27451
net/mlx5e: Present SW stats when state is not opened

The driver can present all SW stats even when the state not opened.
Fixed get strings, count and stats to support it.

In addition, fix tc2txq to hold a static mapping which doesn't depend on
the amount of open channels, and cannot have the same value on two
different cells  while moving between configurations.
Example:
- OOB 16 channels
- Change to 2 channels, 8 TCs
- tc2txq[15][0] == tc2txq[1][7] == 15
This will cause multiple appearances of the same TX index in statistics
output.

Fixes: 76c3810bade3 ("net/mlx5e: Avoid reset netdev stats on configuration changes")
Signed-off-by: Eran Ben Elisha <eranbe@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
drivers/net/ethernet/mellanox/mlx5/core/en_main.c
drivers/net/ethernet/mellanox/mlx5/core/en_stats.c