numam-spdk/lib/env_dpdk
Darek Stojaczyk f666018041 env_dpdk/memory: aggregate adjacent vfio mappings
In the past, memory in spdk could have been unregistered in
different chunks than it was registered, so to account
for that the vtophys code used to register each hugepage
(2MB chunk of memory) separately to the VFIO driver. This
really made the code generally simple.

Now that memory in spdk can only be unregistered in the same
chunks it was registered in, we no longer have to register
each hugepage to VFIO separately. We could register the
entire memory region with just a single VFIO ioctl instead,
so that's we'll do now.

This serves as an optimization as we obviously send less
ioctls now, but most importantly it prevents SPDK from
reaching a VFIO registrations limit that was introduced
in Linux 5.1. [1]

The default limit is 65535, which results in SPDK being able to
make only the first 128GB of memory DMA-able. This is most
problematic for vhost where we need to register the memory
of all the VMs.

Fixes #915

[1] 492855939bdb59c6f947b0b5b44af9ad82b7e38c
("vfio/type1: Limit DMA mappings per container")

Signed-off-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/432442 (master)

(cherry picked from commit be04cfc342)
Change-Id: Ida40306b2684e20daa2fd8d12e0df2eef5a4bff1
Signed-off-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/467143
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
2019-09-09 21:55:22 +00:00
..
env_internal.h env/dpdk: add spdk_pci_fini() 2019-03-28 14:50:46 +00:00
env.c env: define minimum alignment for dma-able memory 2019-07-23 04:00:05 +00:00
env.mk mk: force --no-as-needed for spdk libs. 2019-09-06 02:19:41 +00:00
init.c env_dpdk: set crypto log level to ERR 2019-05-13 15:46:50 +00:00
Makefile lib/env_dpdk: Added VMD PCI driver object 2019-05-29 20:35:11 +00:00
memory.c env_dpdk/memory: aggregate adjacent vfio mappings 2019-09-09 21:55:22 +00:00
pci_ioat.c ioat: add device IDs for new CB-DMA engines 2019-02-26 06:50:52 +00:00
pci_nvme.c pci: remove nvme-specific attach functions 2018-12-07 17:24:19 +00:00
pci_virtio.c pci: remove virtio-specific attach functions 2018-12-07 17:24:19 +00:00
pci_vmd.c lib/env_dpdk: Added VMD PCI driver object 2019-05-29 20:35:11 +00:00
pci.c env_dpdk/pci: make spdk_pci_device_detach() synchronous again 2019-07-16 10:56:28 +00:00
threads.c env: drop DPDK 16.07 support 2018-11-30 19:59:34 +00:00