numam-dpdk/lib
Takeshi Yoshimura 986f2134c3 vfio: fix mapping failures in ppc64le
ppc64le failed when using large physical memory. I found problems in my two
commits in the past.

In commit e072d16f89 ("vfio: fix expanding DMA area in ppc64le"), I added
a sanity check using a mapped address to resolve an issue around expanding
IOMMU window, but this was not enough, since memory allocation can return
memory anywhere dependent on memory fragmentation. DPDK may still skip DMA
mapping and attempts to unmap non-mapped DMA during expanding IOMMU window.
As a result, SPDK apps using large physical memory frequently failed to
proceed the communication with NVMe and/or went into an infinite loop.

The root cause of the bug was in a gap between memory segments managed by
DPDK and firmware-level DMA mapping. DPDK's memory segments don't contain
the state of DMA mapping, and so, the memesg_walk cannot determine if an
iterated memory segment is mapped or not. This resulted in incorrect DMA
maps and unmaps.

At this time, I added the code to avoid iterating non-mapped memory
segments during DMA mapping. The memseg_walk iterates over memory segments
marked as "used", and so, the code sets memory segments that will be
mapped or unmapped as "free" transiently.

The commit db90b4969e ("vfio: retry creating sPAPR DMA window") allows
retring different page levels and sizes to create DMA window. However, this
allows page sizes different from hugepage sizes. This inconsistency caused
failures at the time of DMA mapping after the window creation. This patch
fixes to retry only different page levels.

Fixes: e072d16f89 ("vfio: fix expanding DMA area in ppc64le")
Fixes: db90b4969e ("vfio: retry creating sPAPR DMA window")
Cc: stable@dpdk.org

Signed-off-by: Takeshi Yoshimura <tyos@jp.ibm.com>
Reviewed-by: David Christensen <drc@linux.vnet.ibm.com>
2020-02-05 21:57:21 +01:00
..
librte_acl build: align symbols with global ABI version 2019-11-20 23:05:39 +01:00
librte_bbdev build: remove individual library versions 2019-11-20 23:05:39 +01:00
librte_bitratestats build: align symbols with global ABI version 2019-11-20 23:05:39 +01:00
librte_bpf bpf/arm: fix clang build 2019-11-21 00:30:39 +01:00
librte_cfgfile cfgfile: fix symbols map 2020-01-20 00:29:49 +01:00
librte_cmdline build: align symbols with global ABI version 2019-11-20 23:05:39 +01:00
librte_compressdev build: remove individual library versions 2019-11-20 23:05:39 +01:00
librte_cryptodev cryptodev: revert Chacha20-Poly1305 AEAD algorithm 2020-02-05 15:14:46 +01:00
librte_distributor build: remove unneeded function versioning 2020-02-05 21:27:29 +01:00
librte_eal vfio: fix mapping failures in ppc64le 2020-02-05 21:57:21 +01:00
librte_efd build: align symbols with global ABI version 2019-11-20 23:05:39 +01:00
librte_ethdev lib: use common macro RTE_DIM 2020-02-05 14:37:41 +01:00
librte_eventdev eventdev: use custom element size rings 2020-01-19 19:32:50 +01:00
librte_fib remove blank lines at end of file 2019-11-26 00:12:08 +01:00
librte_flow_classify build: remove individual library versions 2019-11-20 23:05:39 +01:00
librte_gro build: align symbols with global ABI version 2019-11-20 23:05:39 +01:00
librte_gso build: align symbols with global ABI version 2019-11-20 23:05:39 +01:00
librte_hash hash: fix lock-free flag doxygen 2020-02-05 19:42:24 +01:00
librte_ip_frag lib: use common macro RTE_DIM 2020-02-05 14:37:41 +01:00
librte_ipsec build: remove individual library versions 2019-11-20 23:05:39 +01:00
librte_jobstats build: align symbols with global ABI version 2019-11-20 23:05:39 +01:00
librte_kni kni: fix build with Linux 4.9.x 2019-11-28 14:48:24 +01:00
librte_kvargs build: align symbols with global ABI version 2019-11-20 23:05:39 +01:00
librte_latencystats latency: fix calculation for multi-thread 2020-01-20 01:32:50 +01:00
librte_lpm build: remove unneeded function versioning 2020-02-05 21:27:29 +01:00
librte_mbuf mbuf: create pool with external memory buffers 2020-01-20 23:36:38 +01:00
librte_member build: align symbols with global ABI version 2019-11-20 23:05:39 +01:00
librte_mempool mempool: remove memory wastage on non-x86 2020-01-20 16:37:27 +01:00
librte_meter meter: remove experimental flag from RFC4115 trTCM API 2020-01-20 16:37:27 +01:00
librte_metrics build: align symbols with global ABI version 2019-11-20 23:05:39 +01:00
librte_net build: align symbols with global ABI version 2019-11-20 23:05:39 +01:00
librte_pci build: align symbols with global ABI version 2019-11-20 23:05:39 +01:00
librte_pdump pdump: use dynamic log type 2020-02-05 19:42:24 +01:00
librte_pipeline build: align symbols with global ABI version 2019-11-20 23:05:39 +01:00
librte_port lib: use common macro RTE_DIM 2020-02-05 14:37:41 +01:00
librte_power power: fix error log on guest message polling 2019-11-26 00:29:24 +01:00
librte_rawdev build: align symbols with global ABI version 2019-11-20 23:05:39 +01:00
librte_rcu build: remove individual library versions 2019-11-20 23:05:39 +01:00
librte_reorder build: align symbols with global ABI version 2019-11-20 23:05:39 +01:00
librte_rib build: remove individual library versions 2019-11-20 23:05:39 +01:00
librte_ring ring: support configurable element size 2020-01-19 19:32:48 +01:00
librte_sched build: align symbols with global ABI version 2019-11-20 23:05:39 +01:00
librte_security build: align symbols with global ABI version 2019-11-20 23:05:39 +01:00
librte_stack build: remove individual library versions 2019-11-20 23:05:39 +01:00
librte_table build: align symbols with global ABI version 2019-11-20 23:05:39 +01:00
librte_telemetry lib: use common macro RTE_DIM 2020-02-05 14:37:41 +01:00
librte_timer build: remove unneeded function versioning 2020-02-05 21:27:29 +01:00
librte_vhost vhost: fix deadlock on port deletion 2020-01-17 19:46:26 +01:00
Makefile vhost: fix build dependency on hash lib 2019-11-08 23:15:05 +01:00
meson.build build: fix soname info for 19.11 compatibility 2019-12-19 16:18:21 +01:00