Skip to contentSkip to conversation

net/ice: fixed wrong return value

PATCH In review Qiming Yang 4 participants 6 messages Jul 9, 2019 – Jul 15, 2019 Network drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net/ice: fixed wrong return value

Fixed error return value check and wrong error message.

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
#1 lore raw

Hi,

09/07/2019 06:08, Qiming Yang:

Quoted 5 lines

Fixed error return value check and wrong error message.

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

Comments about the formatting of the title:

The verb must be in infinitive form: "fix".

The title must say which behaviour is fixed, not the code detail (we don't care in the title if it because of a return value or variable assignment). Here it is about fixing flow rule validation, right?

One more thing, the word "wrong" can always be avoided after "fix", because we know you are not fixing something which worked perfectly :)

Do not hesitate to share these tips around you. Thank you

#2 lore raw

Hi, Thomas
Thanks for the comments. Will change it.

Qiming
-----Original Message-----
From: Thomas Monjalon [mailto:[email protected]]
Sent: Wednesday, July 10, 2019 3:30 PM
To: Yang, Qiming <[email protected]>
Cc: [email protected]; Yigit, Ferruh <[email protected]>
Subject: Re: [dpdk-dev] [PATCH] net/ice: fixed wrong return value

Hi,

09/07/2019 06:08, Qiming Yang:

Quoted 5 lines

Fixed error return value check and wrong error message.

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

Comments about the formatting of the title:

The verb must be in infinitive form: "fix".

The title must say which behaviour is fixed, not the code detail (we don't care in the title if it because of a return value or variable assignment). Here it is about fixing flow rule validation, right?

One more thing, the word "wrong" can always be avoided after "fix", because we know you are not fixing something which worked perfectly :)

Do not hesitate to share these tips around you.
Thank you

#3 lore raw

PATCH v3 1/1 net/ice: fix flow validation fail

In reply to Qiming Yang

ice_flow_valid_attr will return zero on success and a negative value on error. Current return value check logical is opposite to the expected behavior. 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
Acked-by on v3 1/1
#4 lore raw

Re: [dpdk-dev] [PATCH v3] net/ice: fix flow validation fail

Quoted 46 lines

-----Original Message-----
From: dev [mailto:[email protected]] On Behalf Of Qiming Yang
Sent: Monday, July 15, 2019 10:24 AM
To: [email protected]
Cc: Yang, Qiming <[email protected]>; [email protected]
Subject: [dpdk-dev] [PATCH v3] net/ice: fix flow validation fail

ice_flow_valid_attr will return zero on success and a negative value on error. Current return value check logical is opposite to the expected behavior. 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 +1 -1
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;
 		}
drivers/net/ice/ice_generic_flow.c +1 -2
 		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);
--
Quoted 1 line

2.7.4

Applied
#5 lore raw

Re: [dpdk-dev] [PATCH v3] net/ice: fix flow validation fail

Quoted 22 lines

-----Original Message-----
From: dev [mailto:[email protected]] On Behalf Of Xing, Beilei
Sent: Monday, July 15, 2019 11:20 AM
To: Yang, Qiming <[email protected]>; [email protected]
Cc: Yang, Qiming <[email protected]>; [email protected]
Subject: Re: [dpdk-dev] [PATCH v3] net/ice: fix flow validation fail

Quoted 11 lines

-----Original Message-----
From: dev [mailto:[email protected]] On Behalf Of Qiming Yang
Sent: Monday, July 15, 2019 10:24 AM
To: [email protected]
Cc: Yang, Qiming <[email protected]>; [email protected]
Subject: [dpdk-dev] [PATCH v3] net/ice: fix flow validation fail

ice_flow_valid_attr will return zero on success and a negative value on error. Current return value check logical is opposite to the expected behavior. This patch fixed this issue.

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

---

Applied to dpdk-next-net-intel.

Thanks
Qi