aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJere Leppänen <jere.leppanen@nokia.com>2022-04-12 17:24:04 +0300
committerMatias Elo <matias.elo@nokia.com>2022-04-25 15:47:57 +0300
commitf9e87457be6d910353169cb2b4b4d5240fe69a44 (patch)
tree1f2f599d328d4e4d051a3e68e3be54b2375eb9c0
parentbdbb756041c5a446c296796cd9a50090f796b318 (diff)
linux-dpdk: init: in process mode, use --legacy-mem EAL option
In process mode, use the --legacy-mem EAL option, in order to ensure that all memory is allocated at process start time. The memory mappings are inherited by forked processes. This allows us to support the ODP_SHM_SINGLE_VA flag. Increase dpdk.process_mode_memory_mb in the configuration file from 512 to 768, so that all tests have enough memory in process mode. Signed-off-by: Jere Leppänen <jere.leppanen@nokia.com> Reviewed-by: Matias Elo <matias.elo@nokia.com>
-rw-r--r--config/odp-linux-dpdk.conf2
-rw-r--r--platform/linux-dpdk/odp_init.c4
2 files changed, 3 insertions, 3 deletions
diff --git a/config/odp-linux-dpdk.conf b/config/odp-linux-dpdk.conf
index 89d50d034..cc122e7cd 100644
--- a/config/odp-linux-dpdk.conf
+++ b/config/odp-linux-dpdk.conf
@@ -52,7 +52,7 @@ dpdk: {
# NOTE: Process mode is not officially supported by DPDK. Application
# should reserve all shared resources and configure the system before
# forking child processes for the best success probability.
- process_mode_memory_mb = 512
+ process_mode_memory_mb = 768
# PCI devices configuration.
#
diff --git a/platform/linux-dpdk/odp_init.c b/platform/linux-dpdk/odp_init.c
index a69aabff2..3ae981b68 100644
--- a/platform/linux-dpdk/odp_init.c
+++ b/platform/linux-dpdk/odp_init.c
@@ -213,7 +213,7 @@ static int _odp_init_dpdk(const char *cmdline)
free(pci_cmd);
return -1;
}
- cmdlen = snprintf(NULL, 0, "odpdpdk -m %" PRIu32 " %s ", mem_prealloc,
+ cmdlen = snprintf(NULL, 0, "odpdpdk --legacy-mem -m %" PRIu32 " %s ", mem_prealloc,
cmdline) + pcicmdlen + ealcmdlen;
if (pci_cmd != NULL)
@@ -227,7 +227,7 @@ static int _odp_init_dpdk(const char *cmdline)
/* First argument is facility log, simply bind it to odpdpdk for now. In
* process mode DPDK memory has to be preallocated. */
if (odp_global_ro.init_param.mem_model == ODP_MEM_MODEL_PROCESS)
- cmdlen = snprintf(full_cmdline, cmdlen, "odpdpdk -m %" PRIu32 " %s %s %s",
+ cmdlen = snprintf(full_cmdline, cmdlen, "odpdpdk --legacy-mem -m %" PRIu32 " %s %s %s",
mem_prealloc, cmdline, pci_str, eal_str);
else
cmdlen = snprintf(full_cmdline, cmdlen, "odpdpdk %s %s %s",