projects
/
cascardo
/
linux.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
net/mlx5_core: Flow counters infrastructure
[cascardo/linux.git]
/
drivers
/
net
/
ethernet
/
mellanox
/
mlx5
/
core
/
fs_core.h
diff --git
a/drivers/net/ethernet/mellanox/mlx5/core/fs_core.h
b/drivers/net/ethernet/mellanox/mlx5/core/fs_core.h
index
f37a624
..
aa41a73
100644
(file)
--- a/
drivers/net/ethernet/mellanox/mlx5/core/fs_core.h
+++ b/
drivers/net/ethernet/mellanox/mlx5/core/fs_core.h
@@
-45,8
+45,10
@@
enum fs_node_type {
};
enum fs_flow_table_type {
};
enum fs_flow_table_type {
- FS_FT_NIC_RX = 0x0,
- FS_FT_FDB = 0X4,
+ FS_FT_NIC_RX = 0x0,
+ FS_FT_ESW_EGRESS_ACL = 0x2,
+ FS_FT_ESW_INGRESS_ACL = 0x3,
+ FS_FT_FDB = 0X4,
};
enum fs_fte_status {
};
enum fs_fte_status {
@@
-79,6
+81,7
@@
struct mlx5_flow_rule {
struct mlx5_flow_table {
struct fs_node node;
u32 id;
struct mlx5_flow_table {
struct fs_node node;
u32 id;
+ u16 vport;
unsigned int max_fte;
unsigned int level;
enum fs_flow_table_type type;
unsigned int max_fte;
unsigned int level;
enum fs_flow_table_type type;
@@
-93,6
+96,28
@@
struct mlx5_flow_table {
struct list_head fwd_rules;
};
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;
/* Type of children is mlx5_flow_rule */
struct fs_fte {
struct fs_node node;
@@
-102,12
+127,13
@@
struct fs_fte {
u32 index;
u32 action;
enum fs_fte_status status;
u32 index;
u32 action;
enum fs_fte_status status;
+ struct mlx5_fc *counter;
};
/* Type of children is mlx5_flow_table/namespace */
struct fs_prio {
struct fs_node node;
};
/* Type of children is mlx5_flow_table/namespace */
struct fs_prio {
struct fs_node node;
- unsigned int
max_ft
;
+ unsigned int
num_levels
;
unsigned int start_level;
unsigned int prio;
unsigned int num_ft;
unsigned int start_level;
unsigned int prio;
unsigned int num_ft;
@@
-143,6
+169,9
@@
struct mlx5_flow_root_namespace {
struct mutex chain_lock;
};
struct mutex chain_lock;
};
+int mlx5_init_fc_stats(struct mlx5_core_dev *dev);
+void mlx5_cleanup_fc_stats(struct mlx5_core_dev *dev);
+
int mlx5_init_fs(struct mlx5_core_dev *dev);
void mlx5_cleanup_fs(struct mlx5_core_dev *dev);
int mlx5_init_fs(struct mlx5_core_dev *dev);
void mlx5_cleanup_fs(struct mlx5_core_dev *dev);