net/mlx5: handle a single RSS hash key for all protocols
[dpdk.git] / drivers / net / mlx5 / mlx5.c
index 97d6a21..46c89c6 100644 (file)
@@ -198,10 +198,8 @@ mlx5_dev_close(struct rte_eth_dev *dev)
              ((priv->ctx != NULL) ? priv->ctx->device->name : ""));
        /* In case mlx5_dev_stop() has not been called. */
        priv_dev_interrupt_handler_uninstall(priv, dev);
-       priv_special_flow_disable_all(priv);
-       priv_mac_addrs_disable(priv);
        priv_destroy_hash_rxqs(priv);
-       priv_flow_flush(priv, &priv->flows);
+       priv_dev_traffic_disable(priv, dev);
        /* Prevent crashes when queues are still in use. */
        dev->rx_pkt_burst = removed_rx_burst;
        dev->tx_pkt_burst = removed_tx_burst;
@@ -227,11 +225,8 @@ mlx5_dev_close(struct rte_eth_dev *dev)
                claim_zero(ibv_close_device(priv->ctx));
        } else
                assert(priv->ctx == NULL);
-       if (priv->rss_conf != NULL) {
-               for (i = 0; (i != hash_rxq_init_n); ++i)
-                       rte_free((*priv->rss_conf)[i]);
-               rte_free(priv->rss_conf);
-       }
+       if (priv->rss_conf.rss_key != NULL)
+               rte_free(priv->rss_conf.rss_key);
        if (priv->reta_idx != NULL)
                rte_free(priv->reta_idx);
        priv_socket_uninit(priv);
@@ -818,19 +813,6 @@ mlx5_pci_probe(struct rte_pci_driver *pci_drv, struct rte_pci_device *pci_dev)
                                priv->txq_inline = MLX5_WQE_SIZE_MAX -
                                                   MLX5_WQE_SIZE;
                }
-               /* Allocate and register default RSS hash keys. */
-               priv->rss_conf = rte_calloc(__func__, hash_rxq_init_n,
-                                           sizeof((*priv->rss_conf)[0]), 0);
-               if (priv->rss_conf == NULL) {
-                       err = ENOMEM;
-                       goto port_error;
-               }
-               err = rss_hash_rss_conf_new_key(priv,
-                                               rss_hash_default_key,
-                                               rss_hash_default_key_len,
-                                               ETH_RSS_PROTO_MASK);
-               if (err)
-                       goto port_error;
                /* Configure the first MAC address by default. */
                if (priv_get_mac(priv, &mac.addr_bytes)) {
                        ERROR("cannot get MAC address, is mlx5_en loaded?"
@@ -843,10 +825,6 @@ mlx5_pci_probe(struct rte_pci_driver *pci_drv, struct rte_pci_device *pci_dev)
                     mac.addr_bytes[0], mac.addr_bytes[1],
                     mac.addr_bytes[2], mac.addr_bytes[3],
                     mac.addr_bytes[4], mac.addr_bytes[5]);
-               /* Register MAC address. */
-               claim_zero(priv_mac_addr_add(priv, 0,
-                                            (const uint8_t (*)[ETHER_ADDR_LEN])
-                                            mac.addr_bytes));
 #ifndef NDEBUG
                {
                        char ifname[IF_NAMESIZE];
@@ -883,6 +861,8 @@ mlx5_pci_probe(struct rte_pci_driver *pci_drv, struct rte_pci_device *pci_dev)
                eth_dev->device->driver = &mlx5_driver.driver;
                priv->dev = eth_dev;
                eth_dev->dev_ops = &mlx5_dev_ops;
+               /* Register MAC address. */
+               claim_zero(mlx5_mac_addr_add(eth_dev, &mac, 0, 0));
                TAILQ_INIT(&priv->flows);
                TAILQ_INIT(&priv->ctrl_flows);
 
@@ -902,10 +882,8 @@ mlx5_pci_probe(struct rte_pci_driver *pci_drv, struct rte_pci_device *pci_dev)
                continue;
 
 port_error:
-               if (priv) {
-                       rte_free(priv->rss_conf);
+               if (priv)
                        rte_free(priv);
-               }
                if (pd)
                        claim_zero(ibv_dealloc_pd(pd));
                if (ctx)