Blame SOURCES/0007-mlx5-Allow-insertion-of-duplicate-rules-using-DR-API.patch

764884
From 981c7553f55c8200e00e845224b283059dc07c92 Mon Sep 17 00:00:00 2001
764884
From: Alex Vesker <valex@mellanox.com>
764884
Date: Sun, 6 Oct 2019 11:22:37 +0300
764884
Subject: [PATCH rdma-core 07/13] mlx5: Allow insertion of duplicate rules
764884
 using DR API
764884
764884
[ Upstream commit b7c0d4d4611ac14f18024a6388d75f672aa7457a ]
764884
764884
Duplicate rules were not allowed to be configured with SW steering,
764884
unlike when working over root, fix to allow that.
764884
764884
This functionality is useful for replacing rules without dropping
764884
packets.
764884
764884
Fixes: a91e8c2bbedf ('mlx5: Expose steering rule functionality')
764884
Signed-off-by: Alex Vesker <valex@mellanox.com>
764884
Reviewed-by: Erez Shitrit <erezsh@mellanox.com>
764884
Signed-off-by: Yishai Hadas <yishaih@mellanox.com>
764884
Signed-off-by: Nicolas Morey-Chaisemartin <nmoreychaisemartin@suse.com>
764884
---
764884
 providers/mlx5/dr_rule.c | 10 ++++------
764884
 1 file changed, 4 insertions(+), 6 deletions(-)
764884
764884
diff --git a/providers/mlx5/dr_rule.c b/providers/mlx5/dr_rule.c
764884
index 1b873744..1e2d1813 100644
764884
--- a/providers/mlx5/dr_rule.c
764884
+++ b/providers/mlx5/dr_rule.c
764884
@@ -815,12 +815,10 @@ again:
764884
 			 * it means that all the previous stes are the same,
764884
 			 * if so, this rule is duplicated.
764884
 			 */
764884
-			if (dr_ste_is_last_in_rule(nic_matcher, matched_ste->ste_chain_location)) {
764884
-				dr_dbg(dmn, "Duplicate rule inserted, aborting\n");
764884
-				errno = EINVAL;
764884
-				return NULL;
764884
-			}
764884
-			return matched_ste;
764884
+			if (!dr_ste_is_last_in_rule(nic_matcher, ste_location))
764884
+				return matched_ste;
764884
+
764884
+			dr_dbg(dmn, "Duplicate rule inserted\n");
764884
 		}
764884
 
764884
 		if (!skip_rehash && dr_rule_need_enlarge_hash(cur_htbl, dmn, nic_dmn)) {
764884
-- 
764884
2.20.1
764884