diff options
author | Mark Bloch <markb@mellanox.com> | 2020-01-17 18:30:32 +0000 |
---|---|---|
committer | Saeed Mahameed <saeedm@mellanox.com> | 2020-03-13 16:26:17 -0700 |
commit | 5c2aa8ae3a2ccb383647e3ade369b32e0710ef0b (patch) | |
tree | d6050025dedf029d6341bfb52337e66eb3a7639f /drivers/net/ethernet/mellanox/mlx5/core/fs_core.c | |
parent | 4110fc59eafb4fcb462ea847f00ff8c83774672e (diff) | |
download | linux-5c2aa8ae3a2ccb383647e3ade369b32e0710ef0b.tar.gz linux-5c2aa8ae3a2ccb383647e3ade369b32e0710ef0b.tar.bz2 linux-5c2aa8ae3a2ccb383647e3ade369b32e0710ef0b.zip |
net/mlx5: Accept flow rules without match
Allow passing NULL spec when creating a flow rule. Such rules will act
as "catch all" flow rules.
Signed-off-by: Mark Bloch <markb@mellanox.com>
Reviewed-by: Maor Gottlieb <maorg@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
Diffstat (limited to 'drivers/net/ethernet/mellanox/mlx5/core/fs_core.c')
-rw-r--r-- | drivers/net/ethernet/mellanox/mlx5/core/fs_core.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c b/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c index bd0b2e4f3446..c93bd55fab06 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c @@ -1892,12 +1892,16 @@ mlx5_add_flow_rules(struct mlx5_flow_table *ft, int num_dest) { struct mlx5_flow_root_namespace *root = find_root(&ft->node); + static const struct mlx5_flow_spec zero_spec = {}; struct mlx5_flow_destination gen_dest = {}; struct mlx5_flow_table *next_ft = NULL; struct mlx5_flow_handle *handle = NULL; u32 sw_action = flow_act->action; struct fs_prio *prio; + if (!spec) + spec = &zero_spec; + fs_get_obj(prio, ft->node.parent); if (flow_act->action == MLX5_FLOW_CONTEXT_ACTION_FWD_NEXT_PRIO) { if (!fwd_next_prio_supported(ft)) |