path: root/test/test
diff options
authorAnatoly Burakov <>2018-10-02 14:34:40 +0100
committerThomas Monjalon <>2018-10-11 10:24:29 +0200
commit5282bb1c3695eb8f00d3bda3636c4da3332570ba (patch)
tree1828f81d1f41d10b4f826ed5de81373e15d2c5e9 /test/test
parent4104b2a4854473798de0d03c86793518567deba6 (diff)
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 <> Acked-by: Andrew Rybchenko <> Acked-by: Yongseok Koh <>
Diffstat (limited to 'test/test')
2 files changed, 6 insertions, 0 deletions
diff --git a/test/test/test_malloc.c b/test/test/test_malloc.c
index 4b5abb4..5e52724 100644
--- a/test/test/test_malloc.c
+++ b/test/test/test_malloc.c
@@ -711,6 +711,9 @@ check_socket_mem(const struct rte_memseg_list *msl, void *arg)
int32_t *socket = arg;
+ if (msl->external)
+ return 0;
return *socket == msl->socket_id;
diff --git a/test/test/test_memzone.c b/test/test/test_memzone.c
index 452d7cc..9fe465e 100644
--- a/test/test/test_memzone.c
+++ b/test/test/test_memzone.c
@@ -115,6 +115,9 @@ find_available_pagesz(const struct rte_memseg_list *msl, void *arg)
struct walk_arg *wa = arg;
+ if (msl->external)
+ return 0;
if (msl->page_sz == RTE_PGSIZE_2M)
wa->hugepage_2MB_avail = 1;
if (msl->page_sz == RTE_PGSIZE_1G)