net/mlx5: DR, Allow insertion of duplicate rules

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: 41d0707415 ("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>
This commit is contained in:
Alex Vesker 2019-10-07 16:13:25 +03:00 committed by Jakub Kicinski
parent 38dc3b5f56
commit 0041412694
1 changed files with 4 additions and 6 deletions

View File

@ -788,12 +788,10 @@ again:
* it means that all the previous stes are the same, * it means that all the previous stes are the same,
* if so, this rule is duplicated. * if so, this rule is duplicated.
*/ */
if (mlx5dr_ste_is_last_in_rule(nic_matcher, if (!mlx5dr_ste_is_last_in_rule(nic_matcher, ste_location))
matched_ste->ste_chain_location)) { return matched_ste;
mlx5dr_info(dmn, "Duplicate rule inserted, aborting!!\n");
return NULL; mlx5dr_dbg(dmn, "Duplicate rule inserted\n");
}
return matched_ste;
} }
if (!skip_rehash && dr_rule_need_enlarge_hash(cur_htbl, dmn, nic_dmn)) { if (!skip_rehash && dr_rule_need_enlarge_hash(cur_htbl, dmn, nic_dmn)) {