bus/fslmc: restrict address translation to PA mode
authorShreyansh Jain <shreyansh.jain@nxp.com>
Thu, 29 Aug 2019 10:27:32 +0000 (15:57 +0530)
committerFerruh Yigit <ferruh.yigit@intel.com>
Tue, 8 Oct 2019 10:14:31 +0000 (12:14 +0200)
The address translation support for PA->VA is required only in
case of PA mode operation of DPDK. This was causing warning to
be reported on running any DPAA2 application in VA mode:

    Add: Incorrect entry for PA->VA Table(xxxxxxxxxx)
    Add: Lowest address: xxxxxxxxxxxx

This was caused by call to update the DPAAX table when VA mode
was enabled, in which case the VA==IOVA address.

Signed-off-by: Shreyansh Jain <shreyansh.jain@nxp.com>
Reviewed-by: Sachin Saxena <sachin.saxena@nxp.com>
drivers/bus/fslmc/fslmc_bus.c

index dfffa2a..8c155ac 100644 (file)
@@ -420,8 +420,11 @@ rte_fslmc_probe(void)
         *
         * Error is ignored as relevant logs are handled within dpaax and
         * handling for unavailable dpaax table too is transparent to caller.
+        *
+        * And, the IOVA table is only applicable in case of PA mode.
         */
-       dpaax_iova_table_populate();
+       if (rte_eal_iova_mode() == RTE_IOVA_PA)
+               dpaax_iova_table_populate();
 
        TAILQ_FOREACH(dev, &rte_fslmc_bus.device_list, next) {
                TAILQ_FOREACH(drv, &rte_fslmc_bus.driver_list, next) {
@@ -518,7 +521,8 @@ rte_fslmc_driver_unregister(struct rte_dpaa2_driver *driver)
        /* Cleanup the PA->VA Translation table; From whereever this function
         * is called from.
         */
-       dpaax_iova_table_depopulate();
+       if (rte_eal_iova_mode() == RTE_IOVA_PA)
+               dpaax_iova_table_depopulate();
 
        TAILQ_REMOVE(&fslmc_bus->driver_list, driver, next);
        /* Update Bus references */