net/ice: fix switch action number check
authorWei Zhao <wei.zhao1@intel.com>
Thu, 21 May 2020 07:34:11 +0000 (15:34 +0800)
committerFerruh Yigit <ferruh.yigit@intel.com>
Thu, 28 May 2020 15:57:07 +0000 (17:57 +0200)
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>
Tested-by: Qimai Xiao <qimaix.xiao@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
drivers/net/ice/ice_switch_filter.c

index dd3f484..20e8187 100644 (file)
@@ -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,