aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--config/odp-linux-generic.conf4
-rw-r--r--platform/linux-generic/include/odp_global_data.h1
-rw-r--r--platform/linux-generic/odp_ishm.c7
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;