summaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/mellanox/mlx5/core/fs_core.h
diff options
context:
space:
mode:
authorAmir Vadai2016-05-13 14:55:40 +0200
committerDavid S. Miller2016-05-16 19:43:51 +0200
commitbd5251dbf156b6bc0661a9409d46e47160df61dd (patch)
tree4d2fa3780ab1a0c30c6b1814245e84fe1b69e22c /drivers/net/ethernet/mellanox/mlx5/core/fs_core.h
parentnet/mlx5_core: Firmware commands to support flow counters (diff)
downloadkernel-qcow2-linux-bd5251dbf156b6bc0661a9409d46e47160df61dd.tar.gz
kernel-qcow2-linux-bd5251dbf156b6bc0661a9409d46e47160df61dd.tar.xz
kernel-qcow2-linux-bd5251dbf156b6bc0661a9409d46e47160df61dd.zip
net/mlx5_core: Introduce flow steering destination of type counter
When adding a flow steering rule with a counter, need to supply a destination of type MLX5_FLOW_DESTINATION_TYPE_COUNTER, with a pointer to a struct mlx5_fc. Also, MLX5_FLOW_CONTEXT_ACTION_COUNT bit should be set in the action. Signed-off-by: Amir Vadai <amirva@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/mellanox/mlx5/core/fs_core.h')
-rw-r--r--drivers/net/ethernet/mellanox/mlx5/core/fs_core.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/fs_core.h b/drivers/net/ethernet/mellanox/mlx5/core/fs_core.h
index 8e76cc505f5a..1989048ebdfd 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/fs_core.h
+++ b/drivers/net/ethernet/mellanox/mlx5/core/fs_core.h
@@ -96,6 +96,28 @@ struct mlx5_flow_table {
struct list_head fwd_rules;
};
+struct mlx5_fc_cache {
+ u64 packets;
+ u64 bytes;
+ u64 lastuse;
+};
+
+struct mlx5_fc {
+ struct list_head list;
+
+ /* last{packets,bytes} members are used when calculating the delta since
+ * last reading
+ */
+ u64 lastpackets;
+ u64 lastbytes;
+
+ u16 id;
+ bool deleted;
+ bool aging;
+
+ struct mlx5_fc_cache cache ____cacheline_aligned_in_smp;
+};
+
/* Type of children is mlx5_flow_rule */
struct fs_fte {
struct fs_node node;
@@ -105,6 +127,7 @@ struct fs_fte {
u32 index;
u32 action;
enum fs_fte_status status;
+ struct mlx5_fc *counter;
};
/* Type of children is mlx5_flow_table/namespace */