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, api-next has been updated via ef13af84fb6e8649679b06585bec9dead71cfbe5 (commit) via bf4660cc53039e11f11c3bcf5f8c536a23844f52 (commit) via beaf855847ba00fe180629b4fad1b93b59ca1f0f (commit) from 32d6c59d28b39dbe1835f19f3ec0d422091ad5b0 (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 ef13af84fb6e8649679b06585bec9dead71cfbe5 Author: Christophe Milard christophe.milard@linaro.org Date: Tue Nov 8 10:49:30 2016 +0100
doc: shm: defining behaviour when blocks have same name
Defining the reserve and lookup behaviour when multiple blocks are reserved using the same name.
Signed-off-by: Christophe Milard christophe.milard@linaro.org Reviewed-by: Bill Fischofer bill.fischofer@linaro.org Signed-off-by: Maxim Uvarov maxim.uvarov@linaro.org
diff --git a/doc/users-guide/users-guide.adoc b/doc/users-guide/users-guide.adoc index 078dd7c..9a427fa 100755 --- a/doc/users-guide/users-guide.adoc +++ b/doc/users-guide/users-guide.adoc @@ -594,7 +594,9 @@ resource. Blocks of shared memory can be created using the `odp_shm_reserve()` API call. The call expects a shared memory block name, a block size, an alignment requirement, and optional flags as parameters. It returns a `odp_shm_t` -handle. The size and alignment requirement are given in bytes. +handle. The size and alignment requirement are given in bytes. The provided +name does not have to be unique, i.e. a given name can be used multiple times, +when reserving different blocks.
.creating a block of shared memory [source,c] @@ -670,7 +672,9 @@ block is to use the `odp_shm_lookup()` API function call. This nevertheless requires the calling ODP thread to provide the name of the shared memory block: `odp_shm_lookup()` will return `ODP_SHM_INVALID` if no shared memory block -with the provided name is known by ODP. +with the provided name is known by ODP. When multiple blocks were reserved +using the same name, the lookup function will return the handle of any +of these blocks.
.retrieving a block handle and address from another ODP task [source,c]
commit bf4660cc53039e11f11c3bcf5f8c536a23844f52 Author: Christophe Milard christophe.milard@linaro.org Date: Tue Nov 8 10:49:29 2016 +0100
test: api: shm: test using the same block name multiple times
Make sure that many memory blocks can be created with the name.
Signed-off-by: Christophe Milard christophe.milard@linaro.org Reviewed-by: Bill Fischofer bill.fischofer@linaro.org Signed-off-by: Maxim Uvarov maxim.uvarov@linaro.org
diff --git a/test/common_plat/validation/api/shmem/shmem.c b/test/common_plat/validation/api/shmem/shmem.c index 6ea92d9..0e757a7 100644 --- a/test/common_plat/validation/api/shmem/shmem.c +++ b/test/common_plat/validation/api/shmem/shmem.c @@ -111,6 +111,7 @@ void shmem_test_basic(void) { pthrd_arg thrdarg; odp_shm_t shm; + odp_shm_t shm2; shared_test_data_t *shared_test_data; odp_cpumask_t unused;
@@ -120,7 +121,15 @@ void shmem_test_basic(void) CU_ASSERT(odp_shm_to_u64(shm) != odp_shm_to_u64(ODP_SHM_INVALID));
+ /* also check that another reserve with same name is accepted: */ + shm2 = odp_shm_reserve(MEM_NAME, + sizeof(shared_test_data_t), ALIGN_SIZE, 0); + CU_ASSERT(ODP_SHM_INVALID != shm2); + CU_ASSERT(odp_shm_to_u64(shm2) != + odp_shm_to_u64(ODP_SHM_INVALID)); + CU_ASSERT(0 == odp_shm_free(shm)); + CU_ASSERT(0 == odp_shm_free(shm2)); CU_ASSERT(ODP_SHM_INVALID == odp_shm_lookup(MEM_NAME));
shm = odp_shm_reserve(MEM_NAME,
commit beaf855847ba00fe180629b4fad1b93b59ca1f0f Author: Christophe Milard christophe.milard@linaro.org Date: Tue Nov 8 10:49:28 2016 +0100
linux-gen: _ishm: accept multiple usage of same block name
This is following the request that using the same name for multiple memory blocks should be allowed on north API. The change made here will affect any _ishm users (i.e. both north and south API), which is probably better for consistency.
Signed-off-by: Christophe Milard christophe.milard@linaro.org Reviewed-by: Bill Fischofer bill.fischofer@linaro.org Signed-off-by: Maxim Uvarov maxim.uvarov@linaro.org
diff --git a/platform/linux-generic/_ishm.c b/platform/linux-generic/_ishm.c index 7d9c213..449e357 100644 --- a/platform/linux-generic/_ishm.c +++ b/platform/linux-generic/_ishm.c @@ -777,14 +777,6 @@ int _odp_ishm_reserve(const char *name, uint64_t size, int fd, page_sz = odp_sys_page_size(); page_hp_size = odp_sys_huge_page_size();
- /* check if name already exists */ - if (name && (find_block_by_name(name) >= 0)) { - /* Found a block with the same name */ - odp_spinlock_unlock(&ishm_tbl->lock); - ODP_ERR("name "%s" already used.\n", name); - return -1; - } - /* grab a new entry: */ for (new_index = 0; new_index < ISHM_MAX_NB_BLOCKS; new_index++) { if (ishm_tbl->block[new_index].len == 0) {
-----------------------------------------------------------------------
Summary of changes: doc/users-guide/users-guide.adoc | 8 ++++++-- platform/linux-generic/_ishm.c | 8 -------- test/common_plat/validation/api/shmem/shmem.c | 9 +++++++++ 3 files changed, 15 insertions(+), 10 deletions(-)
hooks/post-receive