Skip to content

Allow using external memory without malloc

Anatoly Burakov dpdk-dev 3 versions – Applied

Status from this message: Applied, thanks

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest4 patches 4 repliesApplied
  2. v24 patches 0 repliesSuperseded
  3. v14 patches 10 repliesSuperseded

Changes in v3 from the cover letter

- Rebase on latest master

Patches in v3 Applied

#Subject and filesSizeRepliesApplied
1/4malloc: separate creating memseg list and malloc heaplib/librte_eal/common/malloc_heap.c lib/librte_eal/common/malloc_heap.h lib/librte_eal/common/rte_malloc.c+37 -170 replies
2/4malloc: separate destroying memseg list and heap datalib/librte_eal/common/malloc_heap.c lib/librte_eal/common/malloc_heap.h lib/librte_eal/common/rte_malloc.c+105 -760 replies
3/4mem: allow registering external memory areasdoc/guides/prog_guide/env_abstraction_layer.rst doc/guides/rel_notes/release_19_02.rst lib/librte_eal/common/eal_common_memory.c +2 more+199 -100 replies
4/4mem: allow usage of non-heap external memory in multiprocessdoc/guides/prog_guide/env_abstraction_layer.rst lib/librte_eal/common/eal_common_memory.c lib/librte_eal/common/include/rte_memory.h +1 more+106 -00 replies

Reviews trailers per patch

All 4 patches have a Reviewed-by or Acked-by.

PatchYongseok Koh
1/4A-b
2/4A-b
3/4A-b
4/4A-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v3 thread

Cover letter [PATCH v3 0/4] Allow using external memory without malloc

Currently, the only way to use externally allocated memory is through rte_malloc API's. While this is fine for a lot of use cases, it may not be suitable for certain other use cases like manual memory management, etc.

This patchset adds another API to register memory segments with DPDK (so that API's like ``rte_mem_virt2memseg`` could be relied on by PMD's and such), but not create a malloc heap out of them.

Aside from the obvious (not adding memory to a heap), the other major difference between this API and the ``rte_malloc_heap_*`` external memory functions is the fact that no DMA mapping is performed automatically, as well as no mem event callbacks are triggered.

This really draws a line in the sand, and there are now two ways of doing things - do everything automatically (using the ``rte_malloc_heap_*`` API's), or do everything manually (``rte_extmem_*`` and future DMA mapping API [1] that would replace ``rte_vfio_dma_map``). This way, the consistency of API is kept, and flexibility is also allowed.

[1] https://mails.dpdk.org/archives/dev/2018-November/118175.html

v3:
- Rebase on latest master

v2:
- More sanity checking of parameters

Anatoly Burakov (4):
malloc: separate creating memseg list and malloc heap
malloc: separate destroying memseg list and heap data
mem: allow registering external memory areas
mem: allow usage of non-heap external memory in multiprocess

 .../prog_guide/env_abstraction_layer.rst      |  63 +++++++--
 doc/guides/rel_notes/release_19_02.rst        |   7 +
 lib/librte_eal/common/eal_common_memory.c     | 119 +++++++++++++++++
 lib/librte_eal/common/include/rte_memory.h    | 122 ++++++++++++++++++
 lib/librte_eal/common/malloc_heap.c           | 104 +++++++++++----
 lib/librte_eal/common/malloc_heap.h           |  15 ++-
 lib/librte_eal/common/rte_malloc.c            | 116 +++++++----------
 lib/librte_eal/rte_eal_version.map            |   4 +
 8 files changed, 447 insertions(+), 103 deletions(-)
Signature · 1 line
2.17.1