From 88179a65549a46c55409f3a3de4fa085bfdb368e Mon Sep 17 00:00:00 2001 From: Seth Howell Date: Mon, 4 Mar 2019 10:24:04 -0700 Subject: [PATCH] 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 Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/446972 Tested-by: SPDK CI Jenkins Reviewed-by: Jim Harris Reviewed-by: Darek Stojaczyk --- lib/env_dpdk/memory.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/env_dpdk/memory.c b/lib/env_dpdk/memory.c index ed26a7295..d2d520c28 100644 --- a/lib/env_dpdk/memory.c +++ b/lib/env_dpdk/memory.c @@ -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) {