net/mlx4: remove NDEBUG flag
[dpdk.git] / drivers / net / mlx4 / mlx4.c
index aa4d43f..122d37c 100644 (file)
@@ -248,6 +248,9 @@ mlx4_dev_configure(struct rte_eth_dev *dev)
        struct rte_flow_error error;
        int ret;
 
+       if (dev->data->dev_conf.rxmode.mq_mode & ETH_MQ_RX_RSS_FLAG)
+               dev->data->dev_conf.rxmode.offloads |= DEV_RX_OFFLOAD_RSS_HASH;
+
        /* Prepare internal flow rules. */
        ret = mlx4_flow_sync(priv, &error);
        if (ret) {
@@ -302,7 +305,7 @@ mlx4_dev_start(struct rte_eth_dev *dev)
                      (void *)dev, strerror(-ret));
                goto err;
        }
-#ifndef NDEBUG
+#ifdef RTE_LIBRTE_MLX4_DEBUG
        mlx4_mr_dump_dev(dev);
 #endif
        ret = mlx4_rxq_intr_enable(priv);
@@ -715,7 +718,7 @@ mlx4_init_once(void)
                ret = mlx4_mp_init_primary();
                if (ret)
                        goto out;
-               sd->init_done = true;
+               sd->init_done = 1;
                break;
        case RTE_PROC_SECONDARY:
                if (ld->init_done)
@@ -724,7 +727,7 @@ mlx4_init_once(void)
                if (ret)
                        goto out;
                ++sd->secondary_cnt;
-               ld->init_done = true;
+               ld->init_done = 1;
                break;
        default:
                break;
@@ -763,6 +766,7 @@ mlx4_pci_probe(struct rte_pci_driver *pci_drv, struct rte_pci_device *pci_dev)
        };
        unsigned int vf;
        int i;
+       char ifname[IF_NAMESIZE];
 
        (void)pci_drv;
        err = mlx4_init_once();
@@ -1002,17 +1006,15 @@ mlx4_pci_probe(struct rte_pci_driver *pci_drv, struct rte_pci_device *pci_dev)
                     mac.addr_bytes[4], mac.addr_bytes[5]);
                /* Register MAC address. */
                priv->mac[0] = mac;
-#ifndef NDEBUG
-               {
-                       char ifname[IF_NAMESIZE];
-
-                       if (mlx4_get_ifname(priv, &ifname) == 0)
-                               DEBUG("port %u ifname is \"%s\"",
-                                     priv->port, ifname);
-                       else
-                               DEBUG("port %u ifname is unknown", priv->port);
+
+               if (mlx4_get_ifname(priv, &ifname) == 0) {
+                       DEBUG("port %u ifname is \"%s\"",
+                             priv->port, ifname);
+                       priv->if_index = if_nametoindex(ifname);
+               } else {
+                       DEBUG("port %u ifname is unknown", priv->port);
                }
-#endif
+
                /* Get actual MTU if possible. */
                mlx4_mtu_get(priv, &priv->mtu);
                DEBUG("port %u MTU is %u", priv->port, priv->mtu);
@@ -1142,8 +1144,7 @@ static struct rte_pci_driver mlx4_driver = {
        },
        .id_table = mlx4_pci_id_map,
        .probe = mlx4_pci_probe,
-       .drv_flags = RTE_PCI_DRV_INTR_LSC | RTE_PCI_DRV_INTR_RMV |
-                    RTE_PCI_DRV_IOVA_AS_VA,
+       .drv_flags = RTE_PCI_DRV_INTR_LSC | RTE_PCI_DRV_INTR_RMV,
 };
 
 #ifdef RTE_IBVERBS_LINK_DLOPEN
@@ -1304,7 +1305,7 @@ RTE_INIT(rte_mlx4_pmd_init)
                return;
        assert(mlx4_glue);
 #endif
-#ifndef NDEBUG
+#ifdef RTE_LIBRTE_MLX4_DEBUG
        /* Glue structure must not contain any NULL pointers. */
        {
                unsigned int i;