[v2,35/66] net/ice/base: check new FD filter duplicate location

Message ID 20190611155221.2703-36-leyi.rong@intel.com
State Superseded, archived
Delegated to: Qi Zhang
Headers show
Series
  • shared code update
Related show

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation fail Compilation issues

Commit Message

Leyi Rong June 11, 2019, 3:51 p.m.
Function ice_fdir_is_dup_fltr tests if new Flow Director rule
is not a duplicate.

Signed-off-by: Karol Kolacinski <karol.kolacinski@intel.com>
Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Signed-off-by: Leyi Rong <leyi.rong@intel.com>
---
 drivers/net/ice/base/ice_fdir.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

Patch

diff --git a/drivers/net/ice/base/ice_fdir.c b/drivers/net/ice/base/ice_fdir.c
index bde676a8f..9ef91b3b8 100644
--- a/drivers/net/ice/base/ice_fdir.c
+++ b/drivers/net/ice/base/ice_fdir.c
@@ -692,8 +692,13 @@  bool ice_fdir_is_dup_fltr(struct ice_hw *hw, struct ice_fdir_fltr *input)
 				ret = ice_fdir_comp_rules(rule, input, false);
 			else
 				ret = ice_fdir_comp_rules(rule, input, true);
-			if (ret)
-				break;
+			if (ret) {
+				if (rule->fltr_id == input->fltr_id &&
+				    rule->q_index != input->q_index)
+					ret = false;
+				else
+					break;
+			}
 		}
 	}