Memory Hotplug for DPDK
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v6 Latest70 patches 11 repliesIn review
- v570 patches 3 repliesSuperseded
- v470 patches 5 repliesSuperseded
Earlier versions · 3
| Version | Posted | Patches | Replies | Status |
|---|---|---|---|---|
| v3 | 68 patches | 14 replies | Superseded | |
| v2 | 41 patches | 33 replies | Superseded | |
| v1 | 41 patches | 32 replies | Superseded |
Changes in v6 from the cover letter
- Compile fix in bnx2x
- Added PPC64 DMA window creation to appropriate patch
- C++-tyle comment fixes
- Commit message renames to be more specific about affected areas
Patches in v6 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/70 | eal: move get_virtual_area out of linuxapp eal_memory.clib/ lib/ lib/ | +161 | 0 replies | |
| 2/70 | malloc: move all locking to heaplib/ lib/ lib/ +1 more | +48 | 0 replies | |
| 3/70 | malloc: make heap a doubly-linked listlib/ lib/ lib/ +1 more | +179 | 0 replies | |
| 4/70 | malloc: add function to dump heap contentslib/ lib/ lib/ +4 more | +83 | 0 replies | |
| 5/70 | test: add command to dump malloc heap contentstest/ | +3 | 0 replies | |
| 6/70 | malloc: make malloc_elem_join_adjacent_free publiclib/ lib/ | +6 | 0 replies | |
| 7/70 | malloc: make elem_free_list_remove publiclib/ lib/ | +9 | 0 replies | |
| 8/70 | malloc: make free return resulting elementlib/ lib/ lib/ | +5 | 0 replies | |
| 9/70 | malloc: replace panics with error messageslib/ | +5 | 0 replies | |
| 10/70 | malloc: add support for contiguous allocationlib/ lib/ lib/ +3 more | +133 | 0 replies | |
| 11/70 | memzone: enable reserving IOVA-contiguous memzoneslib/ lib/ | +28 | 0 replies | |
| 12/70 | ethdev: use contiguous allocation for DMA memorylib/ | +2 | 0 replies | |
| 13/70 | crypto/qat: use contiguous allocation for DMA memorydrivers/ | +2 | 0 replies | |
| 14/70 | net/avf: use contiguous allocation for DMA memorydrivers/ | +2 | 0 replies | |
| 15/70 | net/bnx2x: use contiguous allocation for DMA memorydrivers/ drivers/ | +4 | 0 replies | |
| 16/70 | net/bnxt: use contiguous allocation for DMA memorydrivers/ drivers/ drivers/ | +19 | 0 replies | |
| 17/70 | net/cxgbe: use contiguous allocation for DMA memorydrivers/ | +2 | 0 replies | |
| 18/70 | net/ena: use contiguous allocation for DMA memorydrivers/ | +6 | 0 replies | |
| 19/70 | net/enic: use contiguous allocation for DMA memorydrivers/ | +4 | 0 replies | |
| 20/70 | net/i40e: use contiguous allocation for DMA memorydrivers/ drivers/ | +4 | 0 replies | |
| 21/70 | net/qede: use contiguous allocation for DMA memorydrivers/ | +4 | 0 replies | |
| 22/70 | net/virtio: use contiguous allocation for DMA memorydrivers/ | +4 | 0 replies | |
| 23/70 | net/vmxnet3: use contiguous allocation for DMA memorydrivers/ | +3 | 0 replies | |
| 24/70 | mempool: add support for the new allocation methodslib/ | +127 | 4 replies | |
| 25/70 | eal: add function to walk all memsegslib/ lib/ lib/ | +47 | 0 replies | |
| 26/70 | bus/fslmc: use memseg walk instead of iterationdrivers/ | +41 | 0 replies | |
| 27/70 | bus/pci: use memseg walk instead of iterationdrivers/ drivers/ drivers/ | +20 | 0 replies | |
| 28/70 | net/mlx5: use memseg walk instead of iterationdrivers/ drivers/ | +18 | 0 replies | |
| 29/70 | eal: use memseg walk instead of iterationlib/ lib/ lib/ +1 more | +81 | 0 replies | |
| 30/70 | mempool: use memseg walk instead of iterationlib/ lib/ lib/ | +18 | 0 replies | |
| 31/70 | test: use memseg walk instead of iterationtest/ test/ test/ | +74 | 0 replies | |
| 32/70 | vfio/type1: use memseg walk instead of iterationlib/ | +21 | 0 replies | |
| 33/70 | vfio/spapr: use memseg walk instead of iterationlib/ | +63 | 0 replies | |
| 34/70 | eal: add contig walk functionlib/ lib/ lib/ | +65 | 0 replies | |
| 35/70 | virtio: use memseg contig walk instead of iterationdrivers/ | +35 | 0 replies | |
| 36/70 | eal: add iova2virt functionlib/ lib/ lib/ | +43 | 0 replies | |
| 37/70 | bus/dpaa: use iova2virt instead of memseg iterationdrivers/ drivers/ drivers/ +1 more | +10 | 0 replies | |
| 38/70 | bus/fslmc: use iova2virt instead of memseg iterationdrivers/ drivers/ drivers/ +3 more | +16 | 0 replies | |
| 39/70 | crypto/dpaa_sec: use iova2virt instead of memseg iterationdrivers/ | +1 | 0 replies | |
| 40/70 | eal: add virt2memseg functionlib/ lib/ lib/ | +49 | 0 replies | |
| 41/70 | bus/fslmc: use virt2memseg instead of iterationdrivers/ | +4 | 0 replies | |
| 42/70 | crypto/dpaa_sec: use virt2memseg instead of iterationdrivers/ | +5 | 0 replies | |
| 43/70 | net/mlx4: use virt2memseg instead of iterationdrivers/ | +7 | 0 replies | |
| 44/70 | net/mlx5: use virt2memseg instead of iterationdrivers/ | +8 | 3 replies | |
| 45/70 | memzone: use walk instead of iteration for dumpinglib/ | +21 | 0 replies | |
| 46/70 | vfio: allow to map other memory regionslib/ lib/ lib/ +2 more | +705 | 0 replies | |
| 47/70 | eal: add legacy memory optionlib/ lib/ lib/ +3 more | +38 | 0 replies | |
| 48/70 | eal: add shared indexed file-backed arraylib/ lib/ lib/ +5 more | +1246 | 0 replies | |
| 49/70 | eal: replace memseg with memseg listsconfig/ config/ config/ +34 more | +1587 | 0 replies | |
| 50/70 | eal: replace memzone array with fbarraydrivers/ drivers/ lib/ +5 more | +103 | 0 replies | |
| 51/70 | mem: add support for mapping hugepages at runtimelib/ lib/ lib/ +4 more | +491 | 3 replies | |
| 52/70 | mem: add support for unmapping pages at runtimelib/ lib/ lib/ | +176 | 0 replies | |
| 53/70 | eal: add single file segments command-line optionlib/ lib/ lib/ +2 more | +297 | 0 replies | |
| 54/70 | mem: add internal API to check if memory is contiguouslib/ lib/ lib/ +3 more | +105 | 0 replies | |
| 55/70 | mem: prepare memseg lists for multiprocess synclib/ lib/ lib/ +1 more | +262 | 0 replies | |
| 56/70 | eal: read hugepage counts from node-specific sysfs pathlib/ | +74 | 0 replies | |
| 57/70 | eal: make use of memory hotplug for initlib/ | +59 | 0 replies | |
| 58/70 | eal: share hugepage info primary and secondarylib/ lib/ lib/ +7 more | +217 | 0 replies | |
| 59/70 | eal: add secondary process init with memory hotpluglib/ lib/ | +16 | 0 replies | |
| 60/70 | malloc: enable memory hotplug supportlib/ lib/ lib/ +3 more | +439 | 0 replies | |
| 61/70 | malloc: add support for multiprocess memory hotpluglib/ lib/ lib/ +6 more | +1126 | 0 replies | |
| 62/70 | malloc: add support for callbacks on memory eventslib/ lib/ lib/ +2 more | +245 | 0 replies | |
| 63/70 | malloc: enable callbacks on alloc/free and mp synclib/ lib/ lib/ | +64 | 0 replies | |
| 64/70 | vfio: enable support for mem event callbackslib/ | +138 | 0 replies | |
| 65/70 | bus/fslmc: move vfio DMA map into bus probedrivers/ drivers/ drivers/ | +11 | 0 replies | |
| 66/70 | bus/fslmc: enable support for mem event callbacks for vfiodrivers/ | +135 | 0 replies | |
| 67/70 | eal: enable non-legacy memory modelib/ | +0 | 0 replies | |
| 68/70 | eal: add memory validator callbacklib/ lib/ lib/ +2 more | +238 | 0 replies | |
| 69/70 | malloc: enable validation before new page allocationlib/ | +9 | 0 replies | |
| 70/70 | mem: prevent preallocated pages from being freedlib/ lib/ lib/ +1 more | +48 | 0 replies |
Reviews trailers per patch
7 of 70 patches have a Reviewed-by or Acked-by.
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 11 reviewers.
Cover letter [PATCH v6 00/70] Memory Hotplug for DPDK
This patchset introduces dynamic memory allocation for DPDK (aka memory hotplug). Based upon RFC submitted in December [1].
Deprecation notices relevant to this patchset:
- General outline of memory hotplug changes [2]
The vast majority of changes are in the EAL and malloc, the external API disruption is minimal: a new flag is added to memzone API for contiguous memory allocation, a few API additions in rte_memory due to switch to memseg_lists as opposed to memsegs, and a few new convenience API's. Every other API change is internal to EAL, and all of the memory allocation/freeing is handled through rte_malloc, with no externally visible API changes.
Quick outline of all changes done as part of this patchset:
* Malloc heap adjusted to handle holes in address space
* Single memseg list replaced by multiple memseg lists
* VA space for hugepages is preallocated in advance
* Added alloc/free for pages happening as needed on rte_malloc/rte_free
* Added contiguous memory allocation API's for rte_memzone
* Added convenience API calls to walk over memsegs
* Integrated Pawel Wodkowski's patch for registering/unregistering memory with VFIO [3]
* Callbacks for registering memory allocations
* Callbacks for allowing/disallowing allocations above specified limit
* Multiprocess support done via DPDK IPC introduced in 18.02
The biggest difference is a "memseg" now represents a single page (as opposed to being a big contiguous block of pages). As a consequence, both memzones and malloc elements are no longer guaranteed to be physically contiguous, unless the user asks for it at reserve time. To preserve whatever functionality that was dependent on previous behavior, a legacy memory option is also provided, however it is expected (or perhaps vainly hoped) to be temporary solution.
Why multiple memseg lists instead of one? Since memseg is a single page now, the list of memsegs will get quite big, and we need to locate pages somehow when we allocate and free them. We could of course just walk the list and allocate one contiguous chunk of VA space for memsegs, but this implementation uses separate lists instead in order to speed up many operations with memseg lists.
For v6, the following limitations are present:
- VFIO support for multiple processes is not well-tested; work is ongoing to validate VFIO for all use cases
- There are known problems with PPC64 VFIO code, expected to be addressed in separate patches
- For DPAA and FSLMC platforms, performance will be heavily degraded for IOVA as PA cases; separate patches are expected to address the issue
v6:
- Compile fix in bnx2x
- Added PPC64 DMA window creation to appropriate patch
- C++-tyle comment fixes
- Commit message renames to be more specific about affected areas
v5:
- Fixed missing DMA window creation on PPC64 for VFIO
- fslmc VFIO fixes
- Added new user DMA map code to keep track of user DMA maps when hotplug is in use (also used on PPC64 on remap)
- A few checkpatch and commit message fixes here and there
v4:
- Fixed bug in memzone lookup
- Added draft fslmc VFIO code
- Rebased on latest master + dependent patchset
- Documented limitations for *_walk() functions
v3:
- Lots of compile fixes
- Fixes for multiprocess synchronization
- Introduced support for sPAPR IOMMU, courtesy of Gowrishankar @ IBM
- Fixes for mempool size calculation
- Added convenience memseg walk() API's
- Added alloc validation callback
v2: - fixed deadlock at init
- reverted rte_panic changes at init, this is now handled inside IPC
[1] http://dpdk.org/dev/patchwork/bundle/aburakov/Memory_RFC/
[2] http://dpdk.org/dev/patchwork/patch/34002/
[3] http://dpdk.org/dev/patchwork/patch/24484/
Anatoly Burakov (70):
eal: move get_virtual_area out of linuxapp eal_memory.c
malloc: move all locking to heap
malloc: make heap a doubly-linked list
malloc: add function to dump heap contents
test: add command to dump malloc heap contents
malloc: make malloc_elem_join_adjacent_free public
malloc: make elem_free_list_remove public
malloc: make free return resulting element
malloc: replace panics with error messages
malloc: add support for contiguous allocation
memzone: enable reserving IOVA-contiguous memzones
ethdev: use contiguous allocation for DMA memory crypto/qat: use contiguous allocation for DMA memory net/avf: use contiguous allocation for DMA memory net/bnx2x: use contiguous allocation for DMA memory net/bnxt: use contiguous allocation for DMA memory net/cxgbe: use contiguous allocation for DMA memory net/ena: use contiguous allocation for DMA memory net/enic: use contiguous allocation for DMA memory net/i40e: use contiguous allocation for DMA memory net/qede: use contiguous allocation for DMA memory net/virtio: use contiguous allocation for DMA memory net/vmxnet3: use contiguous allocation for DMA memory
mempool: add support for the new allocation methods
eal: add function to walk all memsegs
bus/fslmc: use memseg walk instead of iteration bus/pci: use memseg walk instead of iteration net/mlx5: use memseg walk instead of iteration
eal: use memseg walk instead of iteration
mempool: use memseg walk instead of iteration
test: use memseg walk instead of iteration vfio/type1: use memseg walk instead of iteration vfio/spapr: use memseg walk instead of iteration
eal: add contig walk function
virtio: use memseg contig walk instead of iteration
eal: add iova2virt function
bus/dpaa: use iova2virt instead of memseg iteration bus/fslmc: use iova2virt instead of memseg iteration crypto/dpaa_sec: use iova2virt instead of memseg iteration
eal: add virt2memseg function
bus/fslmc: use virt2memseg instead of iteration crypto/dpaa_sec: use virt2memseg instead of iteration net/mlx4: use virt2memseg instead of iteration net/mlx5: use virt2memseg instead of iteration
memzone: use walk instead of iteration for dumping
vfio: allow to map other memory regions
eal: add legacy memory option
eal: add shared indexed file-backed array
eal: replace memseg with memseg lists
eal: replace memzone array with fbarray
mem: add support for mapping hugepages at runtime
mem: add support for unmapping pages at runtime
eal: add single file segments command-line option
mem: add internal API to check if memory is contiguous
mem: prepare memseg lists for multiprocess sync
eal: read hugepage counts from node-specific sysfs path
eal: make use of memory hotplug for init
eal: share hugepage info primary and secondary
eal: add secondary process init with memory hotplug
malloc: enable memory hotplug support
malloc: add support for multiprocess memory hotplug
malloc: add support for callbacks on memory events
malloc: enable callbacks on alloc/free and mp sync
vfio: enable support for mem event callbacks bus/fslmc: move vfio DMA map into bus probe bus/fslmc: enable support for mem event callbacks for vfio
eal: enable non-legacy memory mode
eal: add memory validator callback
malloc: enable validation before new page allocation
mem: prevent preallocated pages from being freed
config/common_base | 15 +- config/defconfig_i686-native-linuxapp-gcc | 3 + config/defconfig_i686-native-linuxapp-icc | 3 + config/defconfig_x86_x32-native-linuxapp-gcc | 3 + config/rte_config.h | 7 +- doc/guides/rel_notes/deprecation.rst | 9 - drivers/bus/dpaa/rte_dpaa_bus.h | 12 +- drivers/bus/fslmc/fslmc_bus.c | 11 + drivers/bus/fslmc/fslmc_vfio.c | 195 +++- drivers/bus/fslmc/portal/dpaa2_hw_pvt.h | 27 +- drivers/bus/pci/Makefile | 3 + drivers/bus/pci/linux/pci.c | 28 +- drivers/bus/pci/meson.build | 3 + drivers/crypto/dpaa_sec/dpaa_sec.c | 30 +- drivers/crypto/qat/qat_qp.c | 23 +- drivers/event/dpaa2/Makefile | 3 + drivers/mempool/dpaa/Makefile | 3 + drivers/mempool/dpaa/meson.build | 3 + drivers/mempool/dpaa2/Makefile | 3 + drivers/mempool/dpaa2/meson.build | 3 + drivers/net/avf/avf_ethdev.c | 4 +- drivers/net/bnx2x/bnx2x.c | 4 +- drivers/net/bnx2x/bnx2x_rxtx.c | 3 +- drivers/net/bnxt/bnxt_ethdev.c | 17 +- drivers/net/bnxt/bnxt_ring.c | 9 +- drivers/net/bnxt/bnxt_vnic.c | 8 +- drivers/net/cxgbe/sge.c | 3 +- drivers/net/dpaa/Makefile | 3 + drivers/net/dpaa2/Makefile | 3 + drivers/net/dpaa2/dpaa2_ethdev.c | 1 - drivers/net/dpaa2/meson.build | 3 + drivers/net/ena/Makefile | 3 + drivers/net/ena/base/ena_plat_dpdk.h | 9 +- drivers/net/ena/ena_ethdev.c | 10 +- drivers/net/enic/enic_main.c | 9 +- drivers/net/i40e/i40e_ethdev.c | 4 +- drivers/net/i40e/i40e_rxtx.c | 4 +- drivers/net/mlx4/mlx4_mr.c | 18 +- drivers/net/mlx5/Makefile | 3 + drivers/net/mlx5/mlx5.c | 25 +- drivers/net/mlx5/mlx5_mr.c | 19 +- drivers/net/qede/base/bcm_osal.c | 7 +- drivers/net/virtio/virtio_ethdev.c | 8 +- drivers/net/virtio/virtio_user/vhost_kernel.c | 83 +- drivers/net/vmxnet3/vmxnet3_ethdev.c | 5 +- lib/librte_eal/bsdapp/eal/Makefile | 4 + lib/librte_eal/bsdapp/eal/eal.c | 83 +- lib/librte_eal/bsdapp/eal/eal_hugepage_info.c | 65 +- lib/librte_eal/bsdapp/eal/eal_memalloc.c | 48 + lib/librte_eal/bsdapp/eal/eal_memory.c | 224 +++- lib/librte_eal/bsdapp/eal/meson.build | 1 + lib/librte_eal/common/Makefile | 2 +- lib/librte_eal/common/eal_common_fbarray.c | 859 ++++++++++++++++ lib/librte_eal/common/eal_common_memalloc.c | 359 +++++++ lib/librte_eal/common/eal_common_memory.c | 824 ++++++++++++++- lib/librte_eal/common/eal_common_memzone.c | 235 +++-- lib/librte_eal/common/eal_common_options.c | 15 +- lib/librte_eal/common/eal_filesystem.h | 30 + lib/librte_eal/common/eal_hugepages.h | 11 +- lib/librte_eal/common/eal_internal_cfg.h | 12 +- lib/librte_eal/common/eal_memalloc.h | 79 ++ lib/librte_eal/common/eal_options.h | 4 + lib/librte_eal/common/eal_private.h | 33 + lib/librte_eal/common/include/rte_eal_memconfig.h | 28 +- lib/librte_eal/common/include/rte_fbarray.h | 353 +++++++ lib/librte_eal/common/include/rte_malloc.h | 10 + lib/librte_eal/common/include/rte_malloc_heap.h | 6 + lib/librte_eal/common/include/rte_memory.h | 258 ++++- lib/librte_eal/common/include/rte_memzone.h | 12 +- lib/librte_eal/common/include/rte_vfio.h | 41 + lib/librte_eal/common/malloc_elem.c | 433 ++++++-- lib/librte_eal/common/malloc_elem.h | 43 +- lib/librte_eal/common/malloc_heap.c | 704 ++++++++++++- lib/librte_eal/common/malloc_heap.h | 15 +- lib/librte_eal/common/malloc_mp.c | 744 ++++++++++++++ lib/librte_eal/common/malloc_mp.h | 86 ++ lib/librte_eal/common/meson.build | 4 + lib/librte_eal/common/rte_malloc.c | 85 +- lib/librte_eal/linuxapp/eal/Makefile | 5 + lib/librte_eal/linuxapp/eal/eal.c | 62 +- lib/librte_eal/linuxapp/eal/eal_hugepage_info.c | 218 +++- lib/librte_eal/linuxapp/eal/eal_memalloc.c | 1123 +++++++++++++++++++++ lib/librte_eal/linuxapp/eal/eal_memory.c | 1120 ++++++++++++-------- lib/librte_eal/linuxapp/eal/eal_vfio.c | 870 ++++++++++++++-- lib/librte_eal/linuxapp/eal/eal_vfio.h | 12 + lib/librte_eal/linuxapp/eal/meson.build | 1 + lib/librte_eal/rte_eal_version.map | 30 +- lib/librte_ether/rte_ethdev.c | 3 +- lib/librte_mempool/Makefile | 3 + lib/librte_mempool/meson.build | 3 + lib/librte_mempool/rte_mempool.c | 149 ++- test/test/commands.c | 3 + test/test/test_malloc.c | 30 +- test/test/test_memory.c | 27 +- test/test/test_memzone.c | 62 +- 95 files changed, 8797 insertions(+), 1286 deletions(-) create mode 100644 lib/librte_eal/bsdapp/eal/eal_memalloc.c create mode 100644 lib/librte_eal/common/eal_common_fbarray.c create mode 100644 lib/librte_eal/common/eal_common_memalloc.c create mode 100644 lib/librte_eal/common/eal_memalloc.h create mode 100644 lib/librte_eal/common/include/rte_fbarray.h create mode 100644 lib/librte_eal/common/malloc_mp.c create mode 100644 lib/librte_eal/common/malloc_mp.h create mode 100644 lib/librte_eal/linuxapp/eal/eal_memalloc.c
Signature · 1 line
2.7.4