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

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