net/ice: fix switch action number check

Message ID 20200521073411.16778-1-wei.zhao1@intel.com (mailing list archive)
State Accepted, archived
Delegated to: xiaolong ye
Headers
Series net/ice: fix switch action number check |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-nxp-Performance success Performance Testing PASS
ci/travis-robot success Travis build: passed
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-testing fail Testing issues
ci/Intel-compilation success Compilation OK

Commit Message

Zhao1, Wei May 21, 2020, 7:34 a.m. UTC
  The action number for switch filter should be 1, any
other such as 0 or more than 1 is invalid.

Fixes: 3428c6b6ec1f ("net/ice: add action number check for switch")
Cc: stable@dpdk.org

Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
---
 drivers/net/ice/ice_switch_filter.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Zhao1, Wei May 21, 2020, 8:03 a.m. UTC | #1
add Qimai

> -----Original Message-----
> From: Zhao1, Wei <wei.zhao1@intel.com>
> Sent: Thursday, May 21, 2020 3:34 PM
> To: dev@dpdk.org
> Cc: stable@dpdk.org; Zhang, Qi Z <qi.z.zhang@intel.com>; Ye, Xiaolong
> <xiaolong.ye@intel.com>; Zhao1, Wei <wei.zhao1@intel.com>
> Subject: [PATCH] net/ice: fix switch action number check
> 
> The action number for switch filter should be 1, any other such as 0 or more
> than 1 is invalid.
> 
> Fixes: 3428c6b6ec1f ("net/ice: add action number check for switch")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
> ---
>  drivers/net/ice/ice_switch_filter.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ice/ice_switch_filter.c
> b/drivers/net/ice/ice_switch_filter.c
> index dd3f4847a..20e8187d3 100644
> --- a/drivers/net/ice/ice_switch_filter.c
> +++ b/drivers/net/ice/ice_switch_filter.c
> @@ -1388,7 +1388,7 @@ ice_switch_check_action(const struct
> rte_flow_action *actions,
>  		}
>  	}
> 
> -	if (actions_num > 1) {
> +	if (actions_num != 1) {
>  		rte_flow_error_set(error,
>  				   EINVAL, RTE_FLOW_ERROR_TYPE_ACTION,
>  				   actions,
> --
> 2.19.1
  
Xiao, QimaiX May 21, 2020, 9:21 a.m. UTC | #2
Tested-by: Xiao, QimaiX <qimaix.xiao@intel.com>

Regards,
Xiao Qimai

> -----Original Message-----
> From: dev <dev-bounces@dpdk.org> On Behalf Of Wei Zhao
> Sent: Thursday, May 21, 2020 3:34 PM
> To: dev@dpdk.org
> Cc: stable@dpdk.org; Zhang, Qi Z <qi.z.zhang@intel.com>; Ye, Xiaolong
> <xiaolong.ye@intel.com>; Zhao1, Wei <wei.zhao1@intel.com>
> Subject: [dpdk-dev] [PATCH] net/ice: fix switch action number check
> 
> The action number for switch filter should be 1, any other such as 0 or more
> than 1 is invalid.
> 
> Fixes: 3428c6b6ec1f ("net/ice: add action number check for switch")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
> ---
>  drivers/net/ice/ice_switch_filter.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ice/ice_switch_filter.c
> b/drivers/net/ice/ice_switch_filter.c
> index dd3f4847a..20e8187d3 100644
> --- a/drivers/net/ice/ice_switch_filter.c
> +++ b/drivers/net/ice/ice_switch_filter.c
> @@ -1388,7 +1388,7 @@ ice_switch_check_action(const struct
> rte_flow_action *actions,
>  		}
>  	}
> 
> -	if (actions_num > 1) {
> +	if (actions_num != 1) {
>  		rte_flow_error_set(error,
>  				   EINVAL, RTE_FLOW_ERROR_TYPE_ACTION,
>  				   actions,
> --
> 2.19.1
  
Xiaolong Ye May 25, 2020, 1:50 a.m. UTC | #3
On 05/21, Wei Zhao wrote:
>The action number for switch filter should be 1, any
>other such as 0 or more than 1 is invalid.
>
>Fixes: 3428c6b6ec1f ("net/ice: add action number check for switch")
>Cc: stable@dpdk.org
>
>Signed-off-by: Wei Zhao <wei.zhao1@intel.com>
>---
> drivers/net/ice/ice_switch_filter.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
>diff --git a/drivers/net/ice/ice_switch_filter.c b/drivers/net/ice/ice_switch_filter.c
>index dd3f4847a..20e8187d3 100644
>--- a/drivers/net/ice/ice_switch_filter.c
>+++ b/drivers/net/ice/ice_switch_filter.c
>@@ -1388,7 +1388,7 @@ ice_switch_check_action(const struct rte_flow_action *actions,
> 		}
> 	}
> 
>-	if (actions_num > 1) {
>+	if (actions_num != 1) {
> 		rte_flow_error_set(error,
> 				   EINVAL, RTE_FLOW_ERROR_TYPE_ACTION,
> 				   actions,
>-- 
>2.19.1
>

Applied to dpdk-next-net-intel, Thanks.
  
Qi Zhang May 25, 2020, 1:53 a.m. UTC | #4
> -----Original Message-----
> From: Zhao1, Wei <wei.zhao1@intel.com>
> Sent: Thursday, May 21, 2020 3:34 PM
> To: dev@dpdk.org
> Cc: stable@dpdk.org; Zhang, Qi Z <qi.z.zhang@intel.com>; Ye, Xiaolong
> <xiaolong.ye@intel.com>; Zhao1, Wei <wei.zhao1@intel.com>
> Subject: [PATCH] net/ice: fix switch action number check
> 
> The action number for switch filter should be 1, any other such as 0 or more
> than 1 is invalid.
> 
> Fixes: 3428c6b6ec1f ("net/ice: add action number check for switch")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Wei Zhao <wei.zhao1@intel.com>

Acked-by: Qi Zhang <qi.z.zhang@intel.com>
  

Patch

diff --git a/drivers/net/ice/ice_switch_filter.c b/drivers/net/ice/ice_switch_filter.c
index dd3f4847a..20e8187d3 100644
--- a/drivers/net/ice/ice_switch_filter.c
+++ b/drivers/net/ice/ice_switch_filter.c
@@ -1388,7 +1388,7 @@  ice_switch_check_action(const struct rte_flow_action *actions,
 		}
 	}
 
-	if (actions_num > 1) {
+	if (actions_num != 1) {
 		rte_flow_error_set(error,
 				   EINVAL, RTE_FLOW_ERROR_TYPE_ACTION,
 				   actions,