[dpdk-dev] [PATCH v1 25/30] bus/fslmc: update PA-VA dpaax library only in PA mode

Sachin Saxena sachin.saxena at nxp.com
Tue Aug 27 09:07:25 CEST 2019


From: Shreyansh Jain <shreyansh.jain at nxp.com>

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 at nxp.com>
Reviewed-by: Sachin Saxena <sachin.saxena at nxp.com>
---
 drivers/bus/fslmc/fslmc_bus.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/bus/fslmc/fslmc_bus.c b/drivers/bus/fslmc/fslmc_bus.c
index 9b2dd51c4..aa90d686f 100644
--- a/drivers/bus/fslmc/fslmc_bus.c
+++ b/drivers/bus/fslmc/fslmc_bus.c
@@ -421,8 +421,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) {
@@ -519,7 +522,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 */
-- 
2.17.1



More information about the dev mailing list