]> git.baikalelectronics.ru Git - kernel.git/commit
net/mlx5e: Optimize update stats work
authorGal Pressman <galp@mellanox.com>
Wed, 10 May 2017 12:10:33 +0000 (15:10 +0300)
committerSaeed Mahameed <saeedm@mellanox.com>
Thu, 15 Jun 2017 21:19:32 +0000 (00:19 +0300)
commit91b20b88b88931a13ebb5aad33a69e34a6df337d
treedada90898c8a8354418e0d022a381935e168e386
parent9f9d716cf0c55c5970c4c31dae055e626066eab0
net/mlx5e: Optimize update stats work

Unlike ethtool stats, get_stats ndo provides information cached by
update stats work that is running in the background without updating
them explicitly.
We cannot update all counters inside the ndo because some
updates require firmware commands that cannot be performed under a
spinlock.

update_stats work does not need to update ALL counters, since only
some of them are needed by ndo_get_stats.
This patch will allow for a minimal run of update_stats using an extra
parameter which will update necessary counters only and cut 13
firmware commands in each iteration of the work.

Work duration previous to this patch: ~4200us.
Work duration after this patch: ~700us (17% of the original time).

Signed-off-by: Gal Pressman <galp@mellanox.com>
Reviewed-by: Eran Ben Elisha <eranbe@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
Cc: kernel-team@fb.com
drivers/net/ethernet/mellanox/mlx5/core/en.h
drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c
drivers/net/ethernet/mellanox/mlx5/core/en_main.c