diff options
author | Maor Gottlieb <maorg@mellanox.com> | 2015-12-10 15:12:42 (GMT) |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-12-12 05:15:24 (GMT) |
commit | 0c56b97503fdf027488897db5709e2557aa1592a (patch) | |
tree | dabeab960ede87f0f4ddf84f794bb577832b1f0b /drivers/net/ethernet/mellanox/mlx5/core/fs_core.h | |
parent | 5e1626c09c615005e1edf9f971c20a35dc74efaa (diff) | |
download | linux-0c56b97503fdf027488897db5709e2557aa1592a.tar.xz |
net/mlx5_core: Introduce flow steering API
Introducing the following objects:
mlx5_flow_root_namespace: represent the root of specific flow table
type tree(e.g NIC receive, FDB, etc..)
mlx5_flow_group: define the mask of the flow specification.
fs_fte(flow steering flow table entry): defines the value of the
flow specification.
The following describes the relationships between the tree objects:
root_namespace --> priorities -->namespaces -->
priorities -->flow-tables --> flow-groups -->
flow-entries --> destinations
When we create new object(flow table/flow group/flow table entry), we
call to the FW command and then we add the related sw object to the tree.
When we destroy object, e.g. call to mlx5_destroy_flow_table, we use
the tree node destructor for destroying the FW object and remove the
node from the tree.
Signed-off-by: Maor Gottlieb <maorg@mellanox.com>
Signed-off-by: Moni Shoua <monis@mellanox.com>
Signed-off-by: Matan Barak <matanb@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@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.h | 23 |
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 b033714..6c27b8e 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/fs_core.h +++ b/drivers/net/ethernet/mellanox/mlx5/core/fs_core.h @@ -69,13 +69,16 @@ struct mlx5_flow_rule { struct mlx5_flow_destination dest_attr; }; +/* Type of children is mlx5_flow_group */ struct mlx5_flow_table { struct fs_node node; u32 id; + unsigned int max_fte; unsigned int level; enum fs_flow_table_type type; }; +/* Type of children is mlx5_flow_rule */ struct fs_fte { struct fs_node node; u32 val[MLX5_ST_SZ_DW(fte_match_param)]; @@ -83,15 +86,19 @@ struct fs_fte { u32 flow_tag; u32 index; u32 action; + enum fs_fte_status status; }; +/* Type of children is mlx5_flow_table/namespace */ struct fs_prio { struct fs_node node; unsigned int max_ft; unsigned int start_level; unsigned int prio; + unsigned int num_ft; }; +/* Type of children is fs_prio */ struct mlx5_flow_namespace { /* parent == NULL => root ns */ struct fs_node node; @@ -102,6 +109,22 @@ struct mlx5_flow_group_mask { u32 match_criteria[MLX5_ST_SZ_DW(fte_match_param)]; }; +/* Type of children is fs_fte */ +struct mlx5_flow_group { + struct fs_node node; + struct mlx5_flow_group_mask mask; + u32 start_index; + u32 max_ftes; + u32 num_ftes; + u32 id; +}; + +struct mlx5_flow_root_namespace { + struct mlx5_flow_namespace ns; + enum fs_flow_table_type table_type; + struct mlx5_core_dev *dev; +}; + #define fs_get_obj(v, _node) {v = container_of((_node), typeof(*v), node); } #define fs_list_for_each_entry(pos, root) \ |