ethdev: remove detachable device flag
[dpdk.git] / drivers / net / mlx4 / mlx4.c
index 52f8d51..5d35a50 100644 (file)
@@ -115,7 +115,8 @@ mlx4_dev_configure(struct rte_eth_dev *dev)
 /**
  * DPDK callback to start the device.
  *
- * Simulate device start by attaching all configured flows.
+ * Simulate device start by initializing common RSS resources and attaching
+ * all configured flows.
  *
  * @param dev
  *   Pointer to Ethernet device structure.
@@ -134,6 +135,12 @@ mlx4_dev_start(struct rte_eth_dev *dev)
                return 0;
        DEBUG("%p: attaching configured flows to all RX queues", (void *)dev);
        priv->started = 1;
+       ret = mlx4_rss_init(priv);
+       if (ret) {
+               ERROR("%p: cannot initialize RSS resources: %s",
+                     (void *)dev, strerror(-ret));
+               goto err;
+       }
        ret = mlx4_intr_install(priv);
        if (ret) {
                ERROR("%p: interrupt handler installation failed",
@@ -181,6 +188,7 @@ mlx4_dev_stop(struct rte_eth_dev *dev)
        rte_wmb();
        mlx4_flow_sync(priv, NULL);
        mlx4_intr_uninstall(priv);
+       mlx4_rss_deinit(priv);
 }
 
 /**
@@ -553,6 +561,17 @@ mlx4_pci_probe(struct rte_pci_driver *pci_drv, struct rte_pci_device *pci_dev)
                priv->pd = pd;
                priv->mtu = ETHER_MTU;
                priv->vf = vf;
+               priv->hw_csum = !!(device_attr.device_cap_flags &
+                                  IBV_DEVICE_RAW_IP_CSUM);
+               DEBUG("checksum offloading is %ssupported",
+                     (priv->hw_csum ? "" : "not "));
+               /* Only ConnectX-3 Pro supports tunneling. */
+               priv->hw_csum_l2tun =
+                       priv->hw_csum &&
+                       (device_attr.vendor_part_id ==
+                        PCI_DEVICE_ID_MELLANOX_CONNECTX3PRO);
+               DEBUG("L2 tunnel checksum offloads are %ssupported",
+                     (priv->hw_csum_l2tun ? "" : "not "));
                /* Configure the first MAC address by default. */
                if (mlx4_get_mac(priv, &mac.addr_bytes)) {
                        ERROR("cannot get MAC address, is mlx4_en loaded?"
@@ -618,7 +637,6 @@ mlx4_pci_probe(struct rte_pci_driver *pci_drv, struct rte_pci_device *pci_dev)
                eth_dev->intr_handle = &priv->intr_handle;
                priv->dev = eth_dev;
                eth_dev->dev_ops = &mlx4_dev_ops;
-               eth_dev->data->dev_flags |= RTE_ETH_DEV_DETACHABLE;
                /* Bring Ethernet device up. */
                DEBUG("forcing Ethernet interface up");
                mlx4_dev_set_link_up(priv->dev);