env/memory: use spdk_iommu_is_enabled internally

This will help keep the definition of that function fresh as things
change around it over time.

Change-Id: Id30864df132459a0ff889a725aa70abe072f3087
Signed-off-by: Seth Howell <seth.howell@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/446972
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
This commit is contained in:
Seth Howell 2019-03-04 10:24:04 -07:00 committed by Darek Stojaczyk
parent d9f92cd3e2
commit 88179a6554

View File

@ -1045,7 +1045,7 @@ spdk_vtophys_notify(void *cb_ctx, struct spdk_mem_map *map,
if (paddr == SPDK_VTOPHYS_ERROR) {
/* This is not an address that DPDK is managing. */
#if SPDK_VFIO_ENABLED
if (g_vfio.enabled && !g_vfio.noiommu_enabled) {
if (spdk_iommu_is_enabled()) {
/* We'll use the virtual address as the iova. DPDK
* currently uses physical addresses as the iovas (or counts
* up from 0 if it can't get physical addresses), so
@ -1088,7 +1088,7 @@ spdk_vtophys_notify(void *cb_ctx, struct spdk_mem_map *map,
* This is not an address that DPDK is managing. If vfio is enabled,
* we need to unmap the range from the IOMMU
*/
if (g_vfio.enabled && !g_vfio.noiommu_enabled) {
if (spdk_iommu_is_enabled()) {
uint64_t buffer_len = VALUE_2MB;
paddr = spdk_mem_map_translate(map, (uint64_t)vaddr, &buffer_len);
if (buffer_len != VALUE_2MB) {