net/mlx: support IOVA VA mode
[dpdk.git] / drivers / net / mlx4 / mlx4.c
index fe559c0..f7cd0c9 100644 (file)
@@ -60,6 +60,9 @@ static rte_spinlock_t mlx4_shared_data_lock = RTE_SPINLOCK_INITIALIZER;
 /* Process local data for secondary processes. */
 static struct mlx4_local_data mlx4_local_data;
 
+/** Driver-specific log messages type. */
+int mlx4_logtype;
+
 /** Configuration structure for device arguments. */
 struct mlx4_conf {
        struct {
@@ -841,7 +844,7 @@ mlx4_pci_probe(struct rte_pci_driver *pci_drv, struct rte_pci_device *pci_dev)
                struct ibv_pd *pd = NULL;
                struct mlx4_priv *priv = NULL;
                struct rte_eth_dev *eth_dev = NULL;
-               struct ether_addr mac;
+               struct rte_ether_addr mac;
                char name[RTE_ETH_NAME_MAX_LEN];
 
                /* If port is not enabled, skip. */
@@ -945,7 +948,7 @@ mlx4_pci_probe(struct rte_pci_driver *pci_drv, struct rte_pci_device *pci_dev)
                priv->device_attr = device_attr;
                priv->port = port;
                priv->pd = pd;
-               priv->mtu = ETHER_MTU;
+               priv->mtu = RTE_ETHER_MTU;
                priv->vf = vf;
                priv->hw_csum = !!(device_attr.device_cap_flags &
                                   IBV_DEVICE_RAW_IP_CSUM);
@@ -1133,8 +1136,8 @@ 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,
+       .drv_flags = RTE_PCI_DRV_INTR_LSC | RTE_PCI_DRV_INTR_RMV |
+                    RTE_PCI_DRV_IOVA_AS_VA,
 };
 
 #ifdef RTE_IBVERBS_LINK_DLOPEN
@@ -1272,6 +1275,11 @@ glue_error:
  */
 RTE_INIT(rte_mlx4_pmd_init)
 {
+       /* Initialize driver log type. */
+       mlx4_logtype = rte_log_register("pmd.net.mlx4");
+       if (mlx4_logtype >= 0)
+               rte_log_set_level(mlx4_logtype, RTE_LOG_NOTICE);
+
        /*
         * MLX4_DEVICE_FATAL_CLEANUP tells ibv_destroy functions we
         * want to get success errno value in case of calling them