Revert "env_dpdk: Detect DPDK's iova mode when programming the IOMMU"
This reverts commit a68effe709
.
Reason: introduces assertion:
vhost: rte_vhost_compat.c:103: vhost_session_mem_unregister: Assertion `false' failed.
Reported in GH issue 1085.
Change-Id: I00926844c1e00f19547f03487156f7b4238b446c
Signed-off-by: Karol Latecki <karol.latecki@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/476133
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
This commit is contained in:
parent
5c5b167a0d
commit
ebe62e1453
@ -1013,8 +1013,13 @@ 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 (spdk_iommu_is_enabled() && rte_eal_get_configuration()->iova_mode == RTE_IOVA_VA) {
|
||||
/* We'll use the virtual address as the iova to match DPDK. */
|
||||
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
|
||||
* the range of user space virtual addresses and physical
|
||||
* addresses will never overlap.
|
||||
*/
|
||||
paddr = (uint64_t)vaddr;
|
||||
rc = vtophys_iommu_map_dma((uint64_t)vaddr, paddr, len);
|
||||
if (rc) {
|
||||
@ -1066,16 +1071,6 @@ spdk_vtophys_notify(void *cb_ctx, struct spdk_mem_map *map,
|
||||
DEBUG_PRINT("invalid paddr 0x%" PRIx64 " - must be 2MB aligned\n", paddr);
|
||||
return -EINVAL;
|
||||
}
|
||||
#if SPDK_VFIO_ENABLED
|
||||
/* If the IOMMU is on, but DPDK is using iova-mode=pa, we want to register this memory
|
||||
* with the IOMMU using the physical address to match. */
|
||||
if (spdk_iommu_is_enabled()) {
|
||||
rc = vtophys_iommu_map_dma((uint64_t)vaddr, paddr, VALUE_2MB);
|
||||
if (rc) {
|
||||
return -EFAULT;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
rc = spdk_mem_map_set_translation(map, (uint64_t)vaddr, VALUE_2MB, paddr);
|
||||
if (rc != 0) {
|
||||
|
Loading…
Reference in New Issue
Block a user