eal/linux: select IOVA as VA mode for default case
authorJerin Jacob <jerinj@marvell.com>
Mon, 22 Jul 2019 12:56:53 +0000 (14:56 +0200)
committerThomas Monjalon <thomas@monjalon.net>
Mon, 22 Jul 2019 15:47:27 +0000 (17:47 +0200)
When bus layer reports the preferred mode as RTE_IOVA_DC then
select the RTE_IOVA_VA mode:

- All drivers work in RTE_IOVA_VA mode, irrespective of physical
address availability.

- By default, a mempool asks for IOVA-contiguous memory using
RTE_MEMZONE_IOVA_CONTIG. This is slow in RTE_IOVA_PA mode and it
may affect the application boot time.

Signed-off-by: Jerin Jacob <jerinj@marvell.com>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
Signed-off-by: David Marchand <david.marchand@redhat.com>
doc/guides/prog_guide/env_abstraction_layer.rst
lib/librte_eal/linux/eal/eal.c

index 1d63675..1487ea5 100644 (file)
@@ -445,11 +445,29 @@ kernels.
 - if the preferred mode is RTE_IOVA_PA but there is no access to Physical
   Addresses, then EAL init fails early, since later probing of the devices
   would fail anyway,
 - if the preferred mode is RTE_IOVA_PA but there is no access to Physical
   Addresses, then EAL init fails early, since later probing of the devices
   would fail anyway,
-- if the preferred mode is RTE_IOVA_DC then based on the Physical Addresses
-  availability, the preferred mode is adjusted to RTE_IOVA_PA or RTE_IOVA_VA.
+- if the preferred mode is RTE_IOVA_DC then EAL selects the RTE_IOVA_VA mode.
   In the case when the buses had disagreed on the IOVA Mode at the first step,
   part of the buses won't work because of this decision.
 
   In the case when the buses had disagreed on the IOVA Mode at the first step,
   part of the buses won't work because of this decision.
 
+.. note::
+
+    The RTE_IOVA_VA mode is selected as the default for the following reasons:
+
+    - All drivers are expected to work in RTE_IOVA_VA mode, irrespective of
+      physical address availability.
+    - By default, the mempool, first asks for IOVA-contiguous memory using
+      ``RTE_MEMZONE_IOVA_CONTIG``. This is slow in RTE_IOVA_PA mode and it may
+      affect the application boot time.
+    - It is easy to enable large amount of IOVA-contiguous memory use-cases
+      with IOVA in VA mode.
+
+    It is expected that all PCI drivers work in both RTE_IOVA_PA and
+    RTE_IOVA_VA modes.
+
+    If a PCI driver does not support RTE_IOVA_PA mode, the
+    ``RTE_PCI_DRV_NEED_IOVA_AS_VA`` flag is used to dictate that this PCI
+    driver can only work in RTE_IOVA_VA mode.
+
 IOVA Mode Configuration
 ~~~~~~~~~~~~~~~~~~~~~~~
 
 IOVA Mode Configuration
 ~~~~~~~~~~~~~~~~~~~~~~~
 
index 2e5499f..34db787 100644 (file)
@@ -1061,10 +1061,8 @@ rte_eal_init(int argc, char **argv)
                enum rte_iova_mode iova_mode = rte_bus_get_iommu_class();
 
                if (iova_mode == RTE_IOVA_DC) {
                enum rte_iova_mode iova_mode = rte_bus_get_iommu_class();
 
                if (iova_mode == RTE_IOVA_DC) {
-                       iova_mode = phys_addrs ? RTE_IOVA_PA : RTE_IOVA_VA;
-                       RTE_LOG(DEBUG, EAL,
-                               "Buses did not request a specific IOVA mode, using '%s' based on physical addresses availability.\n",
-                               phys_addrs ? "PA" : "VA");
+                       iova_mode = RTE_IOVA_VA;
+                       RTE_LOG(DEBUG, EAL, "Buses did not request a specific IOVA mode, select IOVA as VA mode.\n");
                }
 #ifdef RTE_LIBRTE_KNI
                /* Workaround for KNI which requires physical address to work */
                }
 #ifdef RTE_LIBRTE_KNI
                /* Workaround for KNI which requires physical address to work */