net/mlx4: fix Rx resource leak in case of error
[dpdk.git] / drivers / net / mlx4 / mlx4.c
index 06f1770..3dd72db 100644 (file)
@@ -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)
@@ -569,7 +571,7 @@ mlx4_pci_probe(struct rte_pci_driver *pci_drv, struct rte_pci_device *pci_dev)
                             " for UDP RSS and inner VXLAN RSS");
                        /* Fake support for all possible RSS hash fields. */
                        priv->hw_rss_sup = ~UINT64_C(0);
-                       priv->hw_rss_sup = mlx4_conv_rss_hf(priv, -1);
+                       priv->hw_rss_sup = mlx4_conv_rss_types(priv, -1);
                        /* Filter out known unsupported fields. */
                        priv->hw_rss_sup &=
                                ~(uint64_t)(IBV_RX_HASH_SRC_PORT_UDP |