Commit e04a0183 authored by Maor Gottlieb's avatar Maor Gottlieb Committed by Doug Ledford

net/mlx5: Consolidate flow rules regardless their flow tag

Flow rules with same match criteria and value should be mapped to
the same flow table entry regardless the flow tag identifier.

Flow tag is part of flow table entry context and not of the
destination, therefore we should return error when we try to add
destination to flow table entry with different flow tag.
Signed-off-by: default avatarMaor Gottlieb <maorg@mellanox.com>
Signed-off-by: default avatarLeon Romanovsky <leon@kernel.org>
Signed-off-by: default avatarDoug Ledford <dledford@redhat.com>
parent 5abb0da9
...@@ -1232,10 +1232,18 @@ static struct mlx5_flow_handle *add_rule_fg(struct mlx5_flow_group *fg, ...@@ -1232,10 +1232,18 @@ static struct mlx5_flow_handle *add_rule_fg(struct mlx5_flow_group *fg,
fs_for_each_fte(fte, fg) { fs_for_each_fte(fte, fg) {
nested_lock_ref_node(&fte->node, FS_MUTEX_CHILD); nested_lock_ref_node(&fte->node, FS_MUTEX_CHILD);
if (compare_match_value(&fg->mask, match_value, &fte->val) && if (compare_match_value(&fg->mask, match_value, &fte->val) &&
(flow_act->action & fte->action) && (flow_act->action & fte->action)) {
flow_act->flow_tag == fte->flow_tag) {
int old_action = fte->action; int old_action = fte->action;
if (fte->flow_tag != flow_act->flow_tag) {
mlx5_core_warn(get_dev(&fte->node),
"FTE flow tag %u already exists with different flow tag %u\n",
fte->flow_tag,
flow_act->flow_tag);
handle = ERR_PTR(-EEXIST);
goto unlock_fte;
}
fte->action |= flow_act->action; fte->action |= flow_act->action;
handle = add_rule_fte(fte, fg, dest, dest_num, handle = add_rule_fte(fte, fg, dest, dest_num,
old_action != flow_act->action); old_action != flow_act->action);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment