This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "".
The branch, master has been updated via 291afb1577f2954b94f7dfbec31e3d3768de8a81 (commit) via cac506f75c63ddc7b8a983a34000d90ebc65095c (commit) via a0ab1025cde22c089d8f286a6babe99d1bb3fbd4 (commit) via 1974bcc6decc9d1cda9e728f17931c02139fb6b8 (commit) from 6d832e408b848c739cd1ce07584322619030936a (commit)
Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below.
- Log ----------------------------------------------------------------- commit 291afb1577f2954b94f7dfbec31e3d3768de8a81 Author: Matias Elo matias.elo@nokia.com Date: Mon Mar 18 14:51:09 2019 +0200
api: increment version to v1.21.2
Increment minor version number to reflect backward compatible API changes.
Signed-off-by: Matias Elo matias.elo@nokia.com Reviewed-by: Stanislaw Kardach skardach@marvell.com Reviewed-by: Petri Savolainen petri.savolainen@nokia.com
diff --git a/configure.ac b/configure.ac index 923d98dff..f4ad79f5f 100644 --- a/configure.ac +++ b/configure.ac @@ -4,7 +4,7 @@ AC_PREREQ([2.5]) ########################################################################## m4_define([odpapi_generation_version], [1]) m4_define([odpapi_major_version], [21]) -m4_define([odpapi_minor_version], [1]) +m4_define([odpapi_minor_version], [2]) m4_define([odpapi_point_version], [0]) m4_define([odpapi_version], [odpapi_generation_version.odpapi_major_version.odpapi_minor_version.odpapi_point_version])
commit cac506f75c63ddc7b8a983a34000d90ebc65095c Author: Matias Elo matias.elo@nokia.com Date: Mon Feb 18 14:53:01 2019 +0200
validation: shm: add validation test for new ODP_SHM_HP flag
Signed-off-by: Matias Elo matias.elo@nokia.com Reviewed-by: Stanislaw Kardach skardach@marvell.com Reviewed-by: Petri Savolainen petri.savolainen@nokia.com
diff --git a/test/validation/api/shmem/shmem.c b/test/validation/api/shmem/shmem.c index 91235851e..4e2c13a22 100644 --- a/test/validation/api/shmem/shmem.c +++ b/test/validation/api/shmem/shmem.c @@ -1,4 +1,5 @@ -/* Copyright (c) 2014-2018, Linaro Limited +/* Copyright (c) 2019, Nokia + * Copyright (c) 2014-2018, Linaro Limited * All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause @@ -213,6 +214,45 @@ static void shmem_test_basic(void) CU_ASSERT(0 == odp_shm_free(shm)); }
+/* + * test reserving memory from huge pages + */ +static void shmem_test_hp(void) +{ + odp_shm_t shm; + odp_shm_info_t info; + int i; + int num_sizes = odp_sys_huge_page_size_all(NULL, 0); + + CU_ASSERT_FATAL(num_sizes >= 0); + + shm = odp_shm_reserve(MEM_NAME, sizeof(shared_test_data_t), + ALIGN_SIZE, ODP_SHM_HP); + if (shm == ODP_SHM_INVALID) { + printf(" No huge pages available\n"); + return; + } + + /* Make sure that the memory is reserved from huge pages */ + + CU_ASSERT_FATAL(num_sizes > 0); + CU_ASSERT_FATAL(odp_shm_info(shm, &info) == 0); + + uint64_t hp_sizes[num_sizes]; + + CU_ASSERT_FATAL(odp_sys_huge_page_size_all(hp_sizes, num_sizes) == + num_sizes); + + for (i = 0; i < num_sizes; i++) { + if (hp_sizes[i] == info.page_size) + break; + } + + CU_ASSERT(i < num_sizes); + + CU_ASSERT(odp_shm_free(shm) == 0); +} + /* * maximum size reservation */ @@ -821,6 +861,7 @@ static void shmem_test_stress(void)
odp_testinfo_t shmem_suite[] = { ODP_TEST_INFO(shmem_test_basic), + ODP_TEST_INFO(shmem_test_hp), ODP_TEST_INFO(shmem_test_max_reserve), ODP_TEST_INFO(shmem_test_reserve_after_fork), ODP_TEST_INFO(shmem_test_singleva_after_fork),
commit a0ab1025cde22c089d8f286a6babe99d1bb3fbd4 Author: Matias Elo matias.elo@nokia.com Date: Mon Feb 18 14:05:37 2019 +0200
linux-gen: shm: implement new ODP_SHM_HP flag
Internal _ODP_ISHM_USE_HP flag is replaced with API ODP_SHM_HP flag. This makes internal _odp_shm_reserve() wrapper function unnecessary.
Signed-off-by: Matias Elo matias.elo@nokia.com Reviewed-by: Stanislaw Kardach skardach@marvell.com Reviewed-by: Petri Savolainen petri.savolainen@nokia.com
diff --git a/platform/linux-generic/include/odp_shm_internal.h b/platform/linux-generic/include/odp_shm_internal.h index c98f07deb..9e51ffad1 100644 --- a/platform/linux-generic/include/odp_shm_internal.h +++ b/platform/linux-generic/include/odp_shm_internal.h @@ -1,4 +1,5 @@ -/* Copyright (c) 2016-2018, Linaro Limited +/* Copyright (c) 2019, Nokia + * Copyright (c) 2016-2018, Linaro Limited * All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause @@ -20,7 +21,6 @@ extern "C" { #define _ODP_ISHM_SINGLE_VA 1 #define _ODP_ISHM_LOCK 2 #define _ODP_ISHM_EXPORT 4 /* create export descr file in /tmp */ -#define _ODP_ISHM_USE_HP 8 /* allocate memory from huge pages */
/** * Shared memory block info @@ -34,9 +34,6 @@ typedef struct _odp_ishm_info_t { uint32_t user_flags;/**< user specific flags */ } _odp_ishm_info_t;
-odp_shm_t _odp_shm_reserve(const char *name, uint64_t size, uint32_t align, - uint32_t flags, uint32_t extra_flags); - int _odp_ishm_reserve(const char *name, uint64_t size, int fd, uint32_t align, uint64_t offset, uint32_t flags, uint32_t user_flags); int _odp_ishm_free_by_index(int block_index); diff --git a/platform/linux-generic/odp_ishm.c b/platform/linux-generic/odp_ishm.c index 14255eccc..aa4d497a5 100644 --- a/platform/linux-generic/odp_ishm.c +++ b/platform/linux-generic/odp_ishm.c @@ -1,4 +1,5 @@ -/* Copyright (c) 2016-2018, Linaro Limited +/* Copyright (c) 2019, Nokia + * Copyright (c) 2016-2018, Linaro Limited * All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause @@ -1114,7 +1115,7 @@ int _odp_ishm_reserve(const char *name, uint64_t size, int fd, }
/* Otherwise, Try first huge pages when possible and needed: */ - if ((fd < 0) && page_hp_size && ((flags & _ODP_ISHM_USE_HP) || + if ((fd < 0) && page_hp_size && ((user_flags & ODP_SHM_HP) || size > ishm_tbl->huge_page_limit)) { /* at least, alignment in VA should match page size, but user * can request more: If the user requirement exceeds the page @@ -1168,6 +1169,11 @@ int _odp_ishm_reserve(const char *name, uint64_t size, int fd,
/* Try normal pages if huge pages failed */ if (fd < 0) { + if (user_flags & ODP_SHM_HP) { + odp_spinlock_unlock(&ishm_tbl->lock); + ODP_ERR("Unable to allocate memory from huge pages\n"); + return -1; + } /* at least, alignment in VA should match page size, but user * can request more: If the user requirement exceeds the page * size then we have to make sure the block will be mapped at diff --git a/platform/linux-generic/odp_pool.c b/platform/linux-generic/odp_pool.c index 7f4bb795a..feb25cf39 100644 --- a/platform/linux-generic/odp_pool.c +++ b/platform/linux-generic/odp_pool.c @@ -1,4 +1,5 @@ -/* Copyright (c) 2013-2018, Linaro Limited +/* Copyright (c) 2019, Nokia + * Copyright (c) 2013-2018, Linaro Limited * All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause @@ -384,7 +385,6 @@ static odp_pool_t pool_create(const char *name, odp_pool_param_t *params, uint32_t max_len; uint32_t ring_size; uint32_t num_extra = 0; - uint32_t extra_shm_flags = 0; int name_len; const char *postfix = "_uarea"; char uarea_name[ODP_POOL_NAME_LEN + sizeof(postfix)]; @@ -514,7 +514,7 @@ static odp_pool_t pool_create(const char *name, odp_pool_param_t *params, return ODP_POOL_INVALID; } if (dpdk_obj_size != block_size) - extra_shm_flags |= _ODP_ISHM_USE_HP; + shmflags |= ODP_SHM_HP; block_size = dpdk_obj_size; }
@@ -548,8 +548,8 @@ static odp_pool_t pool_create(const char *name, odp_pool_param_t *params, pool->ext_desc = NULL; pool->ext_destroy = NULL;
- shm = _odp_shm_reserve(pool->name, pool->shm_size, - ODP_PAGE_SIZE, shmflags, extra_shm_flags); + shm = odp_shm_reserve(pool->name, pool->shm_size, ODP_PAGE_SIZE, + shmflags);
pool->shm = shm;
diff --git a/platform/linux-generic/odp_shared_memory.c b/platform/linux-generic/odp_shared_memory.c index b1bbdeb7b..d92b22587 100644 --- a/platform/linux-generic/odp_shared_memory.c +++ b/platform/linux-generic/odp_shared_memory.c @@ -1,4 +1,5 @@ -/* Copyright (c) 2013-2018, Linaro Limited +/* Copyright (c) 2019, Nokia + * Copyright (c) 2013-2018, Linaro Limited * All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause @@ -44,22 +45,6 @@ static uint32_t get_ishm_flags(uint32_t flags) return f; }
-odp_shm_t _odp_shm_reserve(const char *name, uint64_t size, uint32_t align, - uint32_t flags, uint32_t extra_flags) -{ - int block_index; - uint32_t flgs = 0; /* internal ishm flags */ - - flgs = get_ishm_flags(flags); - flgs |= extra_flags; - - block_index = _odp_ishm_reserve(name, size, -1, align, 0, flgs, flags); - if (block_index >= 0) - return to_handle(block_index); - else - return ODP_SHM_INVALID; -} - int odp_shm_capability(odp_shm_capability_t *capa) { memset(capa, 0, sizeof(odp_shm_capability_t)); @@ -74,7 +59,16 @@ int odp_shm_capability(odp_shm_capability_t *capa) odp_shm_t odp_shm_reserve(const char *name, uint64_t size, uint64_t align, uint32_t flags) { - return _odp_shm_reserve(name, size, align, flags, 0); + int block_index; + uint32_t flgs = 0; /* internal ishm flags */ + + flgs = get_ishm_flags(flags); + + block_index = _odp_ishm_reserve(name, size, -1, align, 0, flgs, flags); + if (block_index >= 0) + return to_handle(block_index); + else + return ODP_SHM_INVALID; }
odp_shm_t odp_shm_import(const char *remote_name,
commit 1974bcc6decc9d1cda9e728f17931c02139fb6b8 Author: Matias Elo matias.elo@nokia.com Date: Mon Feb 18 13:31:21 2019 +0200
api: shm: add ODP_SHM_HP flag
When set, this flag guarantees that the memory reserved by odp_shm_reserve() is allocated from huge pages. If enough huge page memory is not available the call will fail.
Signed-off-by: Matias Elo matias.elo@nokia.com Reviewed-by: Stanislaw Kardach skardach@marvell.com Reviewed-by: Petri Savolainen petri.savolainen@nokia.com
diff --git a/include/odp/api/spec/shared_memory.h b/include/odp/api/spec/shared_memory.h index 05c8de401..0882c4a1c 100644 --- a/include/odp/api/spec/shared_memory.h +++ b/include/odp/api/spec/shared_memory.h @@ -1,4 +1,5 @@ -/* Copyright (c) 2013-2018, Linaro Limited +/* Copyright (c) 2019, Nokia + * Copyright (c) 2013-2018, Linaro Limited * All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause @@ -39,11 +40,17 @@ extern "C" { * Maximum shared memory block name length in chars including null char */
-/* - * Shared memory flags: + /* Shared memory flags */ + +/** + * Application SW only, no HW access + */ +#define ODP_SHM_SW_ONLY 0x1 + +/** + * Share with external processes */ -#define ODP_SHM_SW_ONLY 0x1 /**< Application SW only, no HW access */ -#define ODP_SHM_PROC 0x2 /**< Share with external processes */ +#define ODP_SHM_PROC 0x2
/** * Single virtual address @@ -62,6 +69,15 @@ extern "C" { */ #define ODP_SHM_EXPORT 0x08
+/** + * Use huge pages + * + * When set, this flag guarantees that the memory reserved by odp_shm_reserve() + * is allocated from huge pages. The reserve call will return failure if enough + * huge page memory is not available. + */ +#define ODP_SHM_HP 0x10 + /** * Shared memory block info */
-----------------------------------------------------------------------
Summary of changes: configure.ac | 2 +- include/odp/api/spec/shared_memory.h | 26 +++++++++++--- platform/linux-generic/include/odp_shm_internal.h | 7 ++-- platform/linux-generic/odp_ishm.c | 10 ++++-- platform/linux-generic/odp_pool.c | 10 +++--- platform/linux-generic/odp_shared_memory.c | 30 +++++++--------- test/validation/api/shmem/shmem.c | 43 ++++++++++++++++++++++- 7 files changed, 91 insertions(+), 37 deletions(-)
hooks/post-receive