eal: add warning for incompatibe requested IOVA mode

Message ID 20230606153921.8074-1-viacheslavo@nvidia.com (mailing list archive)
State Accepted, archived
Delegated to: Thomas Monjalon
Headers
Series eal: add warning for incompatibe requested IOVA mode |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/loongarch-compilation success Compilation OK
ci/loongarch-unit-testing success Unit Testing PASS
ci/github-robot: build success github build: passed
ci/iol-aarch64-compile-testing success Testing PASS
ci/iol-x86_64-unit-testing success Testing PASS
ci/iol-testing success Testing PASS
ci/iol-unit-testing success Testing PASS
ci/iol-aarch-unit-testing success Testing PASS
ci/iol-abi-testing success Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-x86_64-compile-testing success Testing PASS
ci/Intel-compilation success Compilation OK
ci/intel-Functional success Functional PASS
ci/intel-Testing success Testing PASS

Commit Message

Slava Ovsiienko June 6, 2023, 3:39 p.m. UTC
  The DPDK can be compiled to be run in IOVA VA mode with
'enable_iova_as_pa=false' meson option. It disables support
of the physical address field in the mbufs and application
can not be run in 'IOVA as PA mode'.

The patch adds warning if some bus requires the 'IOVA as PA'
mode in runtime and the 'enable_iova_as_pa=false' meson option
was configured on build.

Signed-off-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
---
 lib/eal/common/eal_common_bus.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
  

Comments

Burakov, Anatoly June 12, 2023, 9:55 a.m. UTC | #1
On 6/6/2023 4:39 PM, Viacheslav Ovsiienko wrote:
> The DPDK can be compiled to be run in IOVA VA mode with
> 'enable_iova_as_pa=false' meson option. It disables support
> of the physical address field in the mbufs and application
> can not be run in 'IOVA as PA mode'.
> 
> The patch adds warning if some bus requires the 'IOVA as PA'
> mode in runtime and the 'enable_iova_as_pa=false' meson option
> was configured on build.
> 
> Signed-off-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
> ---

Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
  
Thomas Monjalon June 12, 2023, 5:29 p.m. UTC | #2
12/06/2023 11:55, Burakov, Anatoly:
> On 6/6/2023 4:39 PM, Viacheslav Ovsiienko wrote:
> > The DPDK can be compiled to be run in IOVA VA mode with
> > 'enable_iova_as_pa=false' meson option. It disables support
> > of the physical address field in the mbufs and application
> > can not be run in 'IOVA as PA mode'.
> > 
> > The patch adds warning if some bus requires the 'IOVA as PA'
> > mode in runtime and the 'enable_iova_as_pa=false' meson option
> > was configured on build.
> > 
> > Signed-off-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
> 
> Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>

Applied, thanks.
  

Patch

diff --git a/lib/eal/common/eal_common_bus.c b/lib/eal/common/eal_common_bus.c
index deb9fb8a12..acac14131a 100644
--- a/lib/eal/common/eal_common_bus.c
+++ b/lib/eal/common/eal_common_bus.c
@@ -239,9 +239,13 @@  rte_bus_get_iommu_class(void)
 			rte_bus_name(bus),
 			bus_iova_mode == RTE_IOVA_DC ? "DC" :
 			(bus_iova_mode == RTE_IOVA_PA ? "PA" : "VA"));
-		if (bus_iova_mode == RTE_IOVA_PA)
+		if (bus_iova_mode == RTE_IOVA_PA) {
 			buses_want_pa = true;
-		else if (bus_iova_mode == RTE_IOVA_VA)
+			if (!RTE_IOVA_IN_MBUF)
+				RTE_LOG(WARNING, EAL,
+					"Bus %s wants IOVA as PA not compatible with 'enable_iova_as_pa=false' build option.\n",
+					rte_bus_name(bus));
+		} else if (bus_iova_mode == RTE_IOVA_VA)
 			buses_want_va = true;
 	}
 	if (buses_want_va && !buses_want_pa) {