summaryrefslogtreecommitdiff
path: root/drivers/net/mlx4/mlx4.c
diff options
context:
space:
mode:
authorAdrien Mazarguil <adrien.mazarguil@6wind.com>2018-04-26 18:26:13 +0200
committerFerruh Yigit <ferruh.yigit@intel.com>2018-05-02 19:28:48 +0200
commit84a684862f502f2d885bc5fa112da26265d5a0f4 (patch)
tree95bccfaa452b740a7455afb5d395f46a4d2f4ea6 /drivers/net/mlx4/mlx4.c
parent6f2f4948b23643d279f38d38f988b122f393270f (diff)
downloaddpdk-84a684862f502f2d885bc5fa112da26265d5a0f4.zip
dpdk-84a684862f502f2d885bc5fa112da26265d5a0f4.tar.gz
dpdk-84a684862f502f2d885bc5fa112da26265d5a0f4.tar.xz
net/mlx4: fix Rx resource leak in case of error
When creation of a flow rule fails during dev_start(), the usage count of the common RSS context is not decremented, which triggers an assertion failure in debug mode during dev_close(). This is addressed by tracking the initialization status of the common RSS context in order to add missing cleanup code. A similar issue exists in mlx4_rxq_attach(), where usage count is incremented on a Rx queue but not released in case of error. This may lead to the above issue since RSS contexts created by flow rules attach themselves to Rx queues, incrementing their usage count. Fixes: 5697a4142107 ("net/mlx4: relax Rx queue configuration order") Cc: stable@dpdk.org Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
Diffstat (limited to 'drivers/net/mlx4/mlx4.c')
-rw-r--r--drivers/net/mlx4/mlx4.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/net/mlx4/mlx4.c b/drivers/net/mlx4/mlx4.c
index 970d20d..3dd72db 100644
--- a/drivers/net/mlx4/mlx4.c
+++ b/drivers/net/mlx4/mlx4.c
@@ -61,6 +61,8 @@ const char *pmd_mlx4_init_params[] = {
NULL,
};
+static void mlx4_dev_stop(struct rte_eth_dev *dev);
+
/**
* DPDK callback for Ethernet device configuration.
*
@@ -143,8 +145,7 @@ mlx4_dev_start(struct rte_eth_dev *dev)
dev->rx_pkt_burst = mlx4_rx_burst;
return 0;
err:
- /* Rollback. */
- priv->started = 0;
+ mlx4_dev_stop(dev);
return ret;
}
@@ -194,6 +195,7 @@ mlx4_dev_close(struct rte_eth_dev *dev)
dev->tx_pkt_burst = mlx4_tx_burst_removed;
rte_wmb();
mlx4_flow_clean(priv);
+ mlx4_rss_deinit(priv);
for (i = 0; i != dev->data->nb_rx_queues; ++i)
mlx4_rx_queue_release(dev->data->rx_queues[i]);
for (i = 0; i != dev->data->nb_tx_queues; ++i)