Skip to contentSkip to conversation

net/ice: fix FDIR rule duplication check failure

PATCH Applied Yahui Cao 3 participants 3 messages Nov 19, 2019 – Nov 20, 2019 Network drivers

lore
Share & tools
lore

Yahui Cao

author
#0 lore raw

PATCH 1/1 net/ice: fix FDIR rule duplication check failure

When FDIR filter detects duplicated rule and then returns EEXIST, ice flow will capture this error and return immediately.

Fixes 4e27d3ed02bd ("net/ice: fix flow API framework")
---
 drivers/net/ice/ice_generic_flow.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/net/ice/ice_generic_flow.c +6 -1
index 5594f8555..1d8c83418 100644
@@ -1698,6 +1698,8 @@ ice_parse_engine_create(struct ice_adapter *ad,
 	void *temp;
 
 	TAILQ_FOREACH_SAFE(parser_node, parser_list, node, temp) {
+		int ret;
+
 		if (parser_node->parser->parse_pattern_action(ad,
 				parser_node->parser->array,
 				parser_node->parser->array_len,
@@ -1712,8 +1714,11 @@ ice_parse_engine_create(struct ice_adapter *ad,
 			continue;
 		}
 
-		if (!(engine->create(ad, flow, *meta, error)))
+		ret = engine->create(ad, flow, *meta, error);
+		if (ret == 0)
 			return engine;
+		else if (ret == -EEXIST)
+			return NULL;
 	}
 	return NULL;
 }
Signature · 1 line
2.17.1
Acked-by on v1 1/1
#1 lore raw
Quoted 12 lines

-----Original Message-----
From: Cao, Yahui <[email protected]>
Sent: Wednesday, November 20, 2019 12:01 AM
To: Yang, Qiming <[email protected]>; Lu, Wenzhuo <[email protected]>
Cc: [email protected]; Zhang, Qi Z <[email protected]>; Cao, Yahui <[email protected]>; Ye, Xiaolong <[email protected]>; Wang, Ying A <[email protected]>
Subject: [PATCH] net/ice: fix FDIR rule duplication check failure

Quoted 7 lines

When FDIR filter detects duplicated rule and then returns EEXIST, ice flow will capture this error and return immediately.

Fixes 4e27d3ed02bd ("net/ice: fix flow API framework")
Applied
#2 lore raw
In reply to Yahui Cao
Quoted 40 lines · Yahui Cao

When FDIR filter detects duplicated rule and then returns EEXIST, ice flow will capture this error and return immediately.

Fixes 4e27d3ed02bd ("net/ice: fix flow API framework")

---
drivers/net/ice/ice_generic_flow.c | 7 ++++++-

1 file changed, 6 insertions(+), 1 deletion(-)
drivers/net/ice/ice_generic_flow.c +6 -1
index 5594f8555..1d8c83418 100644
@@ -1698,6 +1698,8 @@ ice_parse_engine_create(struct ice_adapter *ad,
 	void *temp;
 
 	TAILQ_FOREACH_SAFE(parser_node, parser_list, node, temp) {
+		int ret;
+
 		if (parser_node->parser->parse_pattern_action(ad,
 				parser_node->parser->array,
 				parser_node->parser->array_len,
@@ -1712,8 +1714,11 @@ ice_parse_engine_create(struct ice_adapter *ad,
 			continue;
 		}
 
-		if (!(engine->create(ad, flow, *meta, error)))
+		ret = engine->create(ad, flow, *meta, error);
+		if (ret == 0)
 			return engine;
+		else if (ret == -EEXIST)
+			return NULL;
 	}
 	return NULL;
 }
Signature · 1 line
2.17.1

Applied to dpdk-next-net-intel, Thanks.