net/mlx5: fix inconsistent return value in flow director
authorYaacov Hazan <yaacovh@mellanox.com>
Wed, 14 Sep 2016 11:53:48 +0000 (13:53 +0200)
committerBruce Richardson <bruce.richardson@intel.com>
Fri, 30 Sep 2016 10:27:18 +0000 (12:27 +0200)
The return value in DPDK is negative errno on failure.
Since internal functions in mlx driver return positive
values need to negate this value when it returned to
dpdk layer.

Fixes: 76f5c99 ("mlx5: support flow director")

Signed-off-by: Yaacov Hazan <yaacovh@mellanox.com>
drivers/net/mlx5/mlx5_fdir.c

index 73eb00e..8207573 100644 (file)
@@ -955,7 +955,7 @@ mlx5_dev_filter_ctrl(struct rte_eth_dev *dev,
                     enum rte_filter_op filter_op,
                     void *arg)
 {
-       int ret = -EINVAL;
+       int ret = EINVAL;
        struct priv *priv = dev->data->dev_private;
 
        switch (filter_type) {
@@ -970,5 +970,5 @@ mlx5_dev_filter_ctrl(struct rte_eth_dev *dev,
                break;
        }
 
-       return ret;
+       return -ret;
 }