mem: allow memseg lists to be marked as external
authorAnatoly Burakov <anatoly.burakov@intel.com>
Tue, 2 Oct 2018 13:34:40 +0000 (14:34 +0100)
committerThomas Monjalon <thomas@monjalon.net>
Thu, 11 Oct 2018 08:24:29 +0000 (10:24 +0200)
commit5282bb1c3695eb8f00d3bda3636c4da3332570ba
tree1828f81d1f41d10b4f826ed5de81373e15d2c5e9
parent4104b2a4854473798de0d03c86793518567deba6
mem: allow memseg lists to be marked as external

When we allocate and use DPDK memory, we need to be able to
differentiate between DPDK hugepage segments and segments that
were made part of DPDK but are externally allocated. Add such
a property to memseg lists.

This breaks the ABI, so document the change in release notes.
This also breaks a few internal assumptions about memory
contiguousness, so adjust malloc code in a few places.

All current calls for memseg walk functions were adjusted to
ignore external segments where it made sense.

Mempools is a special case, because we may be asked to allocate
a mempool on a specific socket, and we need to ignore all page
sizes on other heaps or other sockets. Previously, this
assumption of knowing all page sizes was not a problem, but it
will be now, so we have to match socket ID with page size when
calculating minimum page size for a mempool.

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Acked-by: Andrew Rybchenko <arybchenko@solarflare.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
19 files changed:
doc/guides/rel_notes/deprecation.rst
doc/guides/rel_notes/release_18_11.rst
drivers/bus/fslmc/fslmc_vfio.c
drivers/net/mlx5/mlx5.c
drivers/net/virtio/virtio_user/vhost_kernel.c
lib/librte_eal/bsdapp/eal/eal.c
lib/librte_eal/bsdapp/eal/eal_memory.c
lib/librte_eal/common/eal_common_memory.c
lib/librte_eal/common/include/rte_eal_memconfig.h
lib/librte_eal/common/include/rte_memory.h
lib/librte_eal/common/malloc_elem.c
lib/librte_eal/common/malloc_heap.c
lib/librte_eal/common/rte_malloc.c
lib/librte_eal/linuxapp/eal/eal.c
lib/librte_eal/linuxapp/eal/eal_memalloc.c
lib/librte_eal/linuxapp/eal/eal_vfio.c
lib/librte_mempool/rte_mempool.c
test/test/test_malloc.c
test/test/test_memzone.c