Skip to contentSkip to conversation

net/ice: fix flow validation fail issue

PATCH Superseded Qiming Yang 2 participants 2 messages Jul 12, 2019 Network drivers

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 net/ice: fix flow validation fail issue

The return value of function ice_flow_valid_attr should be non-zero. This patch fixed this issue.

Fixes d76116a4678f ("net/ice: add generic flow API")
---
 drivers/net/ice/ice_generic_flow.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/ice/ice_generic_flow.c +2 -2
index d5ff278..e6a2c4b 100644
@@ -549,7 +549,7 @@ static int ice_flow_valid_action(struct rte_eth_dev *dev,
 			rte_flow_error_set(error, EINVAL,
 					   RTE_FLOW_ERROR_TYPE_ACTION,
 					   actions, "Invalid queue ID for"
-					   " ethertype_filter.");
+					   " switch filter.");
 			return -rte_errno;
 		}
 		break;
@@ -596,7 +596,7 @@ ice_flow_validate(struct rte_eth_dev *dev,
 	}
 
 	ret = ice_flow_valid_attr(attr, error);
-	if (!ret)
+	if (ret)
 		return ret;
 
 	inset = ice_flow_valid_pattern(pattern, error);
Signature · 1 line
2.7.4
Reviewed-by on v2 1/1
#1 lore raw

Hi, qiming

Quoted 3 lines · Qiming Yang

The return value of function ice_flow_valid_attr should be non-zero. This patch fixed this issue.

Minor nit about the title, 'issue' is never needed after word 'fix', what about

net/ice: fix flow validation failure ?

And for the commit log, it's unclear to me, I think what you want to say is function ice_flow_valid_attr will return a negative value on error, right?

Quoted 33 lines
Fixes d76116a4678f ("net/ice: add generic flow API")

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

1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/ice/ice_generic_flow.c +2 -2
index d5ff278..e6a2c4b 100644
@@ -549,7 +549,7 @@ static int ice_flow_valid_action(struct rte_eth_dev *dev,
 			rte_flow_error_set(error, EINVAL,
 					   RTE_FLOW_ERROR_TYPE_ACTION,
 					   actions, "Invalid queue ID for"
-					   " ethertype_filter.");
+					   " switch filter.");
 			return -rte_errno;
 		}
 		break;
@@ -596,7 +596,7 @@ ice_flow_validate(struct rte_eth_dev *dev,
 	}
 
 	ret = ice_flow_valid_attr(attr, error);
-	if (!ret)
+	if (ret)
 		return ret;
 
 	inset = ice_flow_valid_pattern(pattern, error);
Signature · 1 line
2.7.4

For the patch,