diff options
author | Matias Elo <matias.elo@nokia.com> | 2018-09-19 10:41:14 +0300 |
---|---|---|
committer | Maxim Uvarov <maxim.uvarov@linaro.org> | 2018-10-15 15:30:31 +0300 |
commit | a180f2bd8de9a99af5d8f0d1b263f860a6230018 (patch) | |
tree | c29ce70923ec68ab2ea844b5c05dbafddc59ac19 | |
parent | 0e685e208d264343b60c3a7f7928daafa3fd5a3f (diff) |
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>
-rw-r--r-- | config/odp-linux-generic.conf | 4 | ||||
-rw-r--r-- | platform/linux-generic/include/odp_global_data.h | 1 | ||||
-rw-r--r-- | platform/linux-generic/odp_ishm.c | 7 |
3 files changed, 12 insertions, 0 deletions
diff --git a/config/odp-linux-generic.conf b/config/odp-linux-generic.conf index 4fe02cf29..4db9ed489 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 1ddc49ea3..7b9e46530 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 80423ace3..1ed60c5f9 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; |