]> git.baikalelectronics.ru Git - kernel.git/commit
net/mlx5e: Introduce stats group API
authorKamal Heib <kamalh@mellanox.com>
Wed, 23 Aug 2017 11:42:03 +0000 (14:42 +0300)
committerSaeed Mahameed <saeedm@mellanox.com>
Tue, 31 Oct 2017 21:20:46 +0000 (14:20 -0700)
commit1f6d3729834797cc4987bdcb2ceeae5712fd39c2
tree56b7467a6accb597253ec75e3a540475b0378bcb
parent3a14f72286fab0a3f9c0f5d14065a46c30dbfe39
net/mlx5e: Introduce stats group API

Currently the mlx5e driver has multiple groups of stats, each group is
used for different purposes and it may depend on hardware capabilities
or not. The problem with the current implementation is that there is no
clear API to create a new group of stats.

This change define a new API to create a group of stats and simplifies
the way of handling them by defining a new struct "mlx5e_stats_grp" which
have the following three function pointers:
- get_num_stats() - return the number of counters in the group.
- fill_strings() - fill counters strings within the group.
- fill_stats() - fill counters values within the group.

The above function pointers are used within the ethtool callbaks while
calling "ethtool -S" from userspace. This change also switch the SW
group to use the new API.

Signed-off-by: Kamal Heib <kamalh@mellanox.com>
Reviewed-by: Gal Pressman <galp@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
drivers/net/ethernet/mellanox/mlx5/core/Makefile
drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c
drivers/net/ethernet/mellanox/mlx5/core/en_stats.c [new file with mode: 0644]
drivers/net/ethernet/mellanox/mlx5/core/en_stats.h