summaryrefslogtreecommitdiffstats
path: root/include/linux/mlx5/fs.h
diff options
context:
space:
mode:
authorAmir Vadai2016-05-13 14:55:41 +0200
committerDavid S. Miller2016-05-16 19:43:51 +0200
commit43a335e055bb7ebdc8a68ce7362ef26ef5bda92b (patch)
tree0441f14934b5e341f12df45bc86bbca9c3dc3d03 /include/linux/mlx5/fs.h
parentnet/mlx5_core: Introduce flow steering destination of type counter (diff)
downloadkernel-qcow2-linux-43a335e055bb7ebdc8a68ce7362ef26ef5bda92b.tar.gz
kernel-qcow2-linux-43a335e055bb7ebdc8a68ce7362ef26ef5bda92b.tar.xz
kernel-qcow2-linux-43a335e055bb7ebdc8a68ce7362ef26ef5bda92b.zip
net/mlx5_core: Flow counters infrastructure
If a counter has the aging flag set when created, it is added to a list of counters that will be queried periodically from a workqueue. query result and last use timestamp are cached. add/del counter must be very efficient since thousands of such operations might be issued in a second. There is only a single reference to counters without aging, therefore no need for locks. But, counters with aging enabled are stored in a list. In order to make code as lockless as possible, all the list manipulation and access to hardware is done from a single context - the periodic counters query thread. The hardware supports multiple counters per FTE, however currently we are using one counter for each FTE. Signed-off-by: Amir Vadai <amirva@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux/mlx5/fs.h')
-rw-r--r--include/linux/mlx5/fs.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/linux/mlx5/fs.h b/include/linux/mlx5/fs.h
index c8b9ede1c20a..4b7a107d9c19 100644
--- a/include/linux/mlx5/fs.h
+++ b/include/linux/mlx5/fs.h
@@ -127,4 +127,9 @@ int mlx5_modify_rule_destination(struct mlx5_flow_rule *rule,
struct mlx5_flow_destination *dest);
struct mlx5_fc *mlx5_flow_rule_counter(struct mlx5_flow_rule *rule);
+struct mlx5_fc *mlx5_fc_create(struct mlx5_core_dev *dev, bool aging);
+void mlx5_fc_destroy(struct mlx5_core_dev *dev, struct mlx5_fc *counter);
+void mlx5_fc_query_cached(struct mlx5_fc *counter,
+ u64 *bytes, u64 *packets, u64 *lastuse);
+
#endif