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 f8e019e23d8348506c1121c73d63ee4e1b584e6e (commit) via 8acc1daf215ee62beba7c333dc0818d9a9c52010 (commit) via cca78664b864d7fb3d99412147275d1b6ef582be (commit) from b7b947ed8562822aa88db1a67233e40ec4dfa812 (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 f8e019e23d8348506c1121c73d63ee4e1b584e6e Author: Matias Elo matias.elo@nokia.com Date: Wed Sep 19 11:07:14 2018 +0300
linux-gen: shm: reserve internal shms using single VA flag
Reserve internal shm blocks using single VA flag when the reservation is done after global init. Enables process mode support.
Signed-off-by: Matias Elo matias.elo@nokia.com Reviewed-by: Bill Fischofer bill.fischofer@linaro.org Signed-off-by: Maxim Uvarov maxim.uvarov@linaro.org
diff --git a/platform/linux-generic/odp_pool.c b/platform/linux-generic/odp_pool.c index 7f5dfa8b..5cb423b9 100644 --- a/platform/linux-generic/odp_pool.c +++ b/platform/linux-generic/odp_pool.c @@ -19,6 +19,7 @@ #include <odp_config_internal.h> #include <odp_debug_internal.h> #include <odp_ring_internal.h> +#include <odp_global_data.h>
#include <string.h> #include <stdio.h> @@ -186,7 +187,7 @@ int odp_pool_term_local(void) return 0; }
-static pool_t *reserve_pool(void) +static pool_t *reserve_pool(uint32_t shmflags) { int i; pool_t *pool; @@ -203,7 +204,7 @@ static pool_t *reserve_pool(void) pool->ring_shm = odp_shm_reserve(ring_name, sizeof(pool_ring_t), - ODP_CACHE_LINE_SIZE, 0); + ODP_CACHE_LINE_SIZE, shmflags); if (odp_unlikely(pool->ring_shm == ODP_SHM_INVALID)) { ODP_ERR("Unable to alloc pool ring %d\n", i); LOCK(&pool->lock); @@ -415,7 +416,7 @@ static odp_pool_t pool_create(const char *name, odp_pool_param_t *params, if (uarea_size) uarea_size = ROUNDUP_CACHE_LINE(uarea_size);
- pool = reserve_pool(); + pool = reserve_pool(shmflags);
if (pool == NULL) { ODP_ERR("No more free pools"); @@ -594,6 +595,8 @@ odp_pool_t odp_pool_create(const char *name, odp_pool_param_t *params)
if (params->type == ODP_POOL_PACKET) shm_flags = ODP_SHM_PROC; + if (odp_global_data.shm_single_va) + shm_flags |= ODP_SHM_SINGLE_VA;
return pool_create(name, params, shm_flags); } diff --git a/platform/linux-generic/odp_timer.c b/platform/linux-generic/odp_timer.c index 0d2ecd27..87d42f7c 100644 --- a/platform/linux-generic/odp_timer.c +++ b/platform/linux-generic/odp_timer.c @@ -57,6 +57,7 @@ #include <odp/api/timer.h> #include <odp_timer_internal.h> #include <odp/api/plat/queue_inlines.h> +#include <odp_global_data.h>
/* Inlined API functions */ #include <odp/api/plat/event_inlines.h> @@ -256,6 +257,10 @@ static odp_timer_pool_t timer_pool_new(const char *name, { uint32_t i, tp_idx; size_t sz0, sz1, sz2; + uint32_t flags = ODP_SHM_SW_ONLY; + + if (odp_global_data.shm_single_va) + flags |= ODP_SHM_SINGLE_VA;
odp_ticketlock_lock(&timer_global.lock);
@@ -282,7 +287,7 @@ static odp_timer_pool_t timer_pool_new(const char *name, sz2 = ROUNDUP_CACHE_LINE(sizeof(_odp_timer_t) * param->num_timers); odp_shm_t shm = odp_shm_reserve(name, sz0 + sz1 + sz2, - ODP_CACHE_LINE_SIZE, ODP_SHM_SW_ONLY); + ODP_CACHE_LINE_SIZE, flags); if (odp_unlikely(shm == ODP_SHM_INVALID)) ODP_ABORT("%s: timer pool shm-alloc(%zuKB) failed\n", name, (sz0 + sz1 + sz2) / 1024); diff --git a/platform/linux-generic/pktio/ipc.c b/platform/linux-generic/pktio/ipc.c index 3b54962f..553ac4c3 100644 --- a/platform/linux-generic/pktio/ipc.c +++ b/platform/linux-generic/pktio/ipc.c @@ -423,7 +423,7 @@ static int ipc_pktio_open(odp_pktio_t id ODP_UNUSED, snprintf(name, sizeof(name), "%s_info", dev); shm = odp_shm_reserve(name, sizeof(struct pktio_info), ODP_CACHE_LINE_SIZE, - _ODP_ISHM_EXPORT | _ODP_ISHM_LOCK); + ODP_SHM_EXPORT | ODP_SHM_SINGLE_VA); if (ODP_SHM_INVALID == shm) { _ring_destroy("ipc_rx_cache"); ODP_ERR("can not create shm %s\n", name); diff --git a/platform/linux-generic/pktio/ring.c b/platform/linux-generic/pktio/ring.c index bb0d6780..6e03b44c 100644 --- a/platform/linux-generic/pktio/ring.c +++ b/platform/linux-generic/pktio/ring.c @@ -79,6 +79,7 @@ #include <inttypes.h> #include <odp_packet_io_ring_internal.h> #include <odp_errno_define.h> +#include <odp_global_data.h>
#include <odp/api/plat/cpu_inlines.h>
@@ -171,6 +172,8 @@ _ring_create(const char *name, unsigned count, unsigned flags) shm_flag = ODP_SHM_PROC | ODP_SHM_EXPORT; else shm_flag = 0; + if (odp_global_data.shm_single_va) + shm_flag |= ODP_SHM_SINGLE_VA;
/* count must be a power of 2 */ if (!RING_VAL_IS_POWER_2(count) || (count > _RING_SZ_MASK)) {
commit 8acc1daf215ee62beba7c333dc0818d9a9c52010 Author: Matias Elo matias.elo@nokia.com Date: Mon Sep 24 14:49:39 2018 +0300
linux-gen: shm: increase pre-reserved virtual address space size
Larger address space is required due to the internal shm allocations in process mode.
Signed-off-by: Matias Elo matias.elo@nokia.com Reviewed-by: Bill Fischofer bill.fischofer@linaro.org Signed-off-by: Maxim Uvarov maxim.uvarov@linaro.org
diff --git a/platform/linux-generic/include/odp_config_internal.h b/platform/linux-generic/include/odp_config_internal.h index 14fa4f6c..99c31af7 100644 --- a/platform/linux-generic/include/odp_config_internal.h +++ b/platform/linux-generic/include/odp_config_internal.h @@ -141,7 +141,7 @@ extern "C" { * all ODP threads (when the _ODP_ISHM_SINGLE_VA flag is used). * In bytes. */ -#define ODP_CONFIG_ISHM_VA_PREALLOC_SZ (536870912L) +#define ODP_CONFIG_ISHM_VA_PREALLOC_SZ (1024 * 1024 * 1024L)
/* * Maximum event burst size
commit cca78664b864d7fb3d99412147275d1b6ef582be Author: Matias Elo matias.elo@nokia.com Date: Wed Sep 19 10:41:14 2018 +0300
linux-gen: shm: add option for allocating internal shm using single VA
Enables using ODP in process mode.
Signed-off-by: Matias Elo matias.elo@nokia.com Reviewed-by: Bill Fischofer bill.fischofer@linaro.org Signed-off-by: Maxim Uvarov maxim.uvarov@linaro.org
diff --git a/config/odp-linux-generic.conf b/config/odp-linux-generic.conf index 4fe02cf2..4db9ed48 100644 --- a/config/odp-linux-generic.conf +++ b/config/odp-linux-generic.conf @@ -33,6 +33,10 @@ shm: { # When using process mode threads, this value should be set to 0 # because the current implementation won't work properly otherwise. num_cached_hp = 0 + + # Allocate internal shared memory using a single virtual address space. + # Set to 1 to enable using process mode. + single_va = 0 }
# DPDK pktio options diff --git a/platform/linux-generic/include/odp_global_data.h b/platform/linux-generic/include/odp_global_data.h index 1ddc49ea..7b9e4653 100644 --- a/platform/linux-generic/include/odp_global_data.h +++ b/platform/linux-generic/include/odp_global_data.h @@ -44,6 +44,7 @@ struct odp_global_data_s { int shm_dir_from_env; uint64_t shm_max_memory; uint64_t shm_max_size; + int shm_single_va; pid_t main_pid; char uid[UID_MAXLEN]; odp_log_func_t log_fn; diff --git a/platform/linux-generic/odp_ishm.c b/platform/linux-generic/odp_ishm.c index 80423ace..1ed60c5f 100644 --- a/platform/linux-generic/odp_ishm.c +++ b/platform/linux-generic/odp_ishm.c @@ -301,8 +301,15 @@ static void hp_init(void) char filename[ISHM_FILENAME_MAXLEN]; char dir[ISHM_FILENAME_MAXLEN]; int count; + int single_va = 0; void *addr;
+ if (_odp_libconfig_lookup_ext_int("shm", NULL, "single_va", + &single_va)) { + odp_global_data.shm_single_va = single_va; + ODP_DBG("Shm single VA: %d\n", odp_global_data.shm_single_va); + } + if (!_odp_libconfig_lookup_ext_int("shm", NULL, "num_cached_hp", &count)) { return;
-----------------------------------------------------------------------
Summary of changes: config/odp-linux-generic.conf | 4 ++++ platform/linux-generic/include/odp_config_internal.h | 2 +- platform/linux-generic/include/odp_global_data.h | 1 + platform/linux-generic/odp_ishm.c | 7 +++++++ platform/linux-generic/odp_pool.c | 9 ++++++--- platform/linux-generic/odp_timer.c | 7 ++++++- platform/linux-generic/pktio/ipc.c | 2 +- platform/linux-generic/pktio/ring.c | 3 +++ 8 files changed, 29 insertions(+), 6 deletions(-)
hooks/post-receive