[v3] net/ice: fix flow validation fail

Message ID 20190715022356.73350-1-qiming.yang@intel.com (mailing list archive)
State Accepted, archived
Delegated to: Qi Zhang
Headers
Series [v3] net/ice: fix flow validation fail |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/intel-Performance-Testing success Performance Testing PASS
ci/Intel-compilation success Compilation OK
ci/mellanox-Performance-Testing success Performance Testing PASS

Commit Message

Qiming Yang July 15, 2019, 2:23 a.m. UTC
  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")
Cc: stable@dpdk.org

Signed-off-by: Qiming Yang <qiming.yang@intel.com>
---
 drivers/net/ice/ice_generic_flow.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
  

Comments

Xing, Beilei July 15, 2019, 3:19 a.m. UTC | #1
> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Qiming Yang
> Sent: Monday, July 15, 2019 10:24 AM
> To: dev@dpdk.org
> Cc: Yang, Qiming <qiming.yang@intel.com>; stable@dpdk.org
> 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")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Qiming Yang <qiming.yang@intel.com>
> ---
>  drivers/net/ice/ice_generic_flow.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/ice/ice_generic_flow.c
> b/drivers/net/ice/ice_generic_flow.c
> index d5ff278..e6a2c4b 100644
> --- a/drivers/net/ice/ice_generic_flow.c
> +++ b/drivers/net/ice/ice_generic_flow.c
> @@ -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);
> --
> 2.7.4

Acked-by: Beilei Xing <beilei.xing@intel.com>
  
Qi Zhang July 15, 2019, 5:59 a.m. UTC | #2
> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Xing, Beilei
> Sent: Monday, July 15, 2019 11:20 AM
> To: Yang, Qiming <qiming.yang@intel.com>; dev@dpdk.org
> Cc: Yang, Qiming <qiming.yang@intel.com>; stable@dpdk.org
> Subject: Re: [dpdk-dev] [PATCH v3] net/ice: fix flow validation fail
> 
> 
> 
> > -----Original Message-----
> > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Qiming Yang
> > Sent: Monday, July 15, 2019 10:24 AM
> > To: dev@dpdk.org
> > Cc: Yang, Qiming <qiming.yang@intel.com>; stable@dpdk.org
> > 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")
> > Cc: stable@dpdk.org
> >
> > Signed-off-by: Qiming Yang <qiming.yang@intel.com>
> > ---
> Acked-by: Beilei Xing <beilei.xing@intel.com>

Applied to dpdk-next-net-intel.

Thanks
Qi
  

Patch

diff --git a/drivers/net/ice/ice_generic_flow.c b/drivers/net/ice/ice_generic_flow.c
index d5ff278..e6a2c4b 100644
--- a/drivers/net/ice/ice_generic_flow.c
+++ b/drivers/net/ice/ice_generic_flow.c
@@ -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);