net/ice: fix flow validation
authorQiming Yang <qiming.yang@intel.com>
Mon, 15 Jul 2019 02:23:56 +0000 (10:23 +0800)
committerFerruh Yigit <ferruh.yigit@intel.com>
Tue, 23 Jul 2019 12:31:34 +0000 (14:31 +0200)
ice_flow_valid_attr will return zero on success and a negative value
on error.
Current return value check logic is opposite of the expected behavior.
This patch fixes 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>
drivers/net/ice/ice_generic_flow.c

index d5ff278..e6a2c4b 100644 (file)
@@ -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);