summaryrefslogtreecommitdiff
path: root/drivers/net/mlx5/mlx5.c
diff options
context:
space:
mode:
authorViacheslav Ovsiienko <viacheslavo@mellanox.com>2019-02-21 09:02:16 +0000
committerFerruh Yigit <ferruh.yigit@intel.com>2019-03-08 17:52:22 +0100
commit4fb27c1dfe054972bec62fdeb6fc91680ccb3f3c (patch)
tree7ec16ebba8c38e5dce5248826674445e39d392a7 /drivers/net/mlx5/mlx5.c
parent82a9eab70d80741177fb934d37e6b28d7e22d1e1 (diff)
downloaddpdk-next-eventdev-4fb27c1dfe054972bec62fdeb6fc91680ccb3f3c.zip
dpdk-next-eventdev-4fb27c1dfe054972bec62fdeb6fc91680ccb3f3c.tar.gz
dpdk-next-eventdev-4fb27c1dfe054972bec62fdeb6fc91680ccb3f3c.tar.xz
net/mlx5: fix flow priorities probing error path
The mlx5 PMD probes the Verbs flow priorities supported with ibv_create_flow() function. If rdma-core or kernel fails for some reason, the returned error causes the drop queue is not destroyed, and pd is locked by not freed resource. Also the mlx5_flow_discover_priorities() returned negative value as error, and this code was reported "as is", without sign changing (eventually causing assert(err > 0)). Fixes: 2815702baea7 ("net/mlx5: replace verbs priorities by flow") Cc: stable@dpdk.org Signed-off-by: Viacheslav Ovsiienko <viacheslavo@mellanox.com> Acked-by: Shahaf Shuler <shahafs@mellanox.com>
Diffstat (limited to 'drivers/net/mlx5/mlx5.c')
-rw-r--r--drivers/net/mlx5/mlx5.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c
index 9706e35..740c5e2 100644
--- a/drivers/net/mlx5/mlx5.c
+++ b/drivers/net/mlx5/mlx5.c
@@ -1243,8 +1243,10 @@ mlx5_dev_spawn(struct rte_device *dpdk_dev,
priv->config = config;
/* Supported Verbs flow priority number detection. */
err = mlx5_flow_discover_priorities(eth_dev);
- if (err < 0)
+ if (err < 0) {
+ err = -err;
goto error;
+ }
priv->config.flow_prio = err;
/*
* Once the device is added to the list of memory event