Skip to content

Commit 0041412

Browse files
alexveskerJakub Kicinski
authored andcommitted
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: 41d0707 ("net/mlx5: DR, Expose steering rule functionality") Signed-off-by: Alex Vesker <[email protected]> Signed-off-by: Tariq Toukan <[email protected]> Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 38dc3b5 commit 0041412

File tree

1 file changed

+4
-6
lines changed
  • drivers/net/ethernet/mellanox/mlx5/core/steering

1 file changed

+4
-6
lines changed

drivers/net/ethernet/mellanox/mlx5/core/steering/dr_rule.c

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -788,12 +788,10 @@ dr_rule_handle_ste_branch(struct mlx5dr_rule *rule,
788788
* it means that all the previous stes are the same,
789789
* if so, this rule is duplicated.
790790
*/
791-
if (mlx5dr_ste_is_last_in_rule(nic_matcher,
792-
matched_ste->ste_chain_location)) {
793-
mlx5dr_info(dmn, "Duplicate rule inserted, aborting!!\n");
794-
return NULL;
795-
}
796-
return matched_ste;
791+
if (!mlx5dr_ste_is_last_in_rule(nic_matcher, ste_location))
792+
return matched_ste;
793+
794+
mlx5dr_dbg(dmn, "Duplicate rule inserted\n");
797795
}
798796

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

0 commit comments

Comments
 (0)