eal/freebsd: fix IOVA mode selection
authorDmitry Kozlyuk <dkozlyuk@nvidia.com>
Tue, 2 Nov 2021 10:08:15 +0000 (12:08 +0200)
committerThomas Monjalon <thomas@monjalon.net>
Wed, 3 Nov 2021 17:32:19 +0000 (18:32 +0100)
commit9790fc2149b7dc727526a13ff2bbeab09577aaef
tree9f5e361f1d66effade823b88ac60f61d7bd38bac
parent6b70c6b31f13b4ac1f7431aa8cccd62fdaf84548
eal/freebsd: fix IOVA mode selection

FreeBSD EAL selected IOVA mode PA even in --no-huge mode
where PA are not available. Memory zones were created with IOVA
equal to RTE_BAD_IOVA with no indication this field is not usable.

Change IOVA mode detection:
1. Always allow to force --iova-mode=va.
2. In --no-huge mode, disallow forcing --iova-mode=pa, and select VA.
3. Otherwise select IOVA mode according to bus requests, default to PA.
In case contigmem is inaccessible, memory initialization will fail
with a message indicating the cause.

Fixes: c2361bab70c5 ("eal: compute IOVA mode based on PA availability")
Cc: stable@dpdk.org
Signed-off-by: Dmitry Kozlyuk <dkozlyuk@nvidia.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
lib/eal/freebsd/eal.c