net/mlx5: Introduce bulk reading of flow counters
authorAmir Vadai <amir@vadai.me>
Thu, 14 Jul 2016 07:32:38 +0000 (10:32 +0300)
committerDavid S. Miller <davem@davemloft.net>
Thu, 14 Jul 2016 20:34:28 +0000 (13:34 -0700)
commita351a1b03bf169f77891060be30036ef71cbe618
tree11fc79d3f0a0559a6b88d89ed9411b8680a22673
parent29cc6679076a00a6ce193004dcf2d14ae7c428a5
net/mlx5: Introduce bulk reading of flow counters

This commit utilize the ability of ConnectX-4 to bulk read flow counters.
Few bulk counter queries could be done instead of issuing thousands of
firmware commands per second to get statistics of all flows set to HW,
such as those programmed when we offload tc filters.

Counters are stored sorted by hardware id, and queried in blocks (id +
number of counters).

Due to hardware requirement, start of block and number of counters in a
block must be four aligned.

Reviewed-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: Amir Vadai <amir@vadai.me>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlx5/core/fs_cmd.c
drivers/net/ethernet/mellanox/mlx5/core/fs_cmd.h
drivers/net/ethernet/mellanox/mlx5/core/fs_counters.c
include/linux/mlx5/mlx5_ifc.h