Skip to content

Commit

Permalink
net/mlx5: DR, Allow insertion of duplicate rules
Browse files Browse the repository at this point in the history
Duplicate rules were not allowed to be configured with SW steering.
This restriction caused failures with the replace rule logic done by
upper layers.

This fix allows for multiple rules with the same match values, in
such case the first inserted rules will match.

Fixes: 41d0707 ("net/mlx5: DR, Expose steering rule functionality")
Signed-off-by: Alex Vesker <valex@mellanox.com>
Signed-off-by: Tariq Toukan <tariqt@mellanox.com>
Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
  • Loading branch information
Alex Vesker authored and Jakub Kicinski committed Oct 8, 2019
1 parent 38dc3b5 commit 0041412
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions drivers/net/ethernet/mellanox/mlx5/core/steering/dr_rule.c
Original file line number Diff line number Diff line change
Expand Up @@ -788,12 +788,10 @@ dr_rule_handle_ste_branch(struct mlx5dr_rule *rule,
* it means that all the previous stes are the same,
* if so, this rule is duplicated.
*/
if (mlx5dr_ste_is_last_in_rule(nic_matcher,
matched_ste->ste_chain_location)) {
mlx5dr_info(dmn, "Duplicate rule inserted, aborting!!\n");
return NULL;
}
return matched_ste;
if (!mlx5dr_ste_is_last_in_rule(nic_matcher, ste_location))
return matched_ste;

mlx5dr_dbg(dmn, "Duplicate rule inserted\n");
}

if (!skip_rehash && dr_rule_need_enlarge_hash(cur_htbl, dmn, nic_dmn)) {
Expand Down

0 comments on commit 0041412

Please sign in to comment.