aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--DEPENDENCIES5
-rw-r--r--platform/linux-generic/pktio/dpdk.c11
2 files changed, 13 insertions, 3 deletions
diff --git a/DEPENDENCIES b/DEPENDENCIES
index 9fee177b6..0091f24ce 100644
--- a/DEPENDENCIES
+++ b/DEPENDENCIES
@@ -209,6 +209,11 @@ Prerequisites for building the OpenDataPlane (ODP) API
$ cd <odp_dir>
$ sudo ./test/performance/odp_l2fwd -i 0,1 -c 2 -m 0
+ Additionally, DPDK command line options can be passed to the application
+ using ODP_PKTIO_DPDK_PARAMS environment variable. For example, allocate
+ 1024MB of memory:
+ $ sudo ODP_PKTIO_DPDK_PARAMS="-m 1024" ./test/performance/odp_l2fwd -i 0 -c 1
+
4.0 Packages needed to build API tests
Cunit test framework version 2.1-3 is required
diff --git a/platform/linux-generic/pktio/dpdk.c b/platform/linux-generic/pktio/dpdk.c
index 848425ddf..57625dce7 100644
--- a/platform/linux-generic/pktio/dpdk.c
+++ b/platform/linux-generic/pktio/dpdk.c
@@ -326,6 +326,7 @@ static int dpdk_pktio_init(void)
int i;
odp_cpumask_t mask;
char mask_str[ODP_CPUMASK_STR_SIZE];
+ const char *cmdline;
int32_t masklen;
int mem_str_len;
int cmd_len;
@@ -365,15 +366,19 @@ static int dpdk_pktio_init(void)
mem_str_len = snprintf(NULL, 0, "%d", DPDK_MEMORY_MB);
+ cmdline = getenv("ODP_PKTIO_DPDK_PARAMS");
+ if (cmdline == NULL)
+ cmdline = "";
+
/* masklen includes the terminating null as well */
cmd_len = strlen("odpdpdk -c -m ") + masklen + mem_str_len +
- strlen(" ");
+ strlen(cmdline) + strlen(" ");
char full_cmd[cmd_len];
/* first argument is facility log, simply bind it to odpdpdk for now.*/
- cmd_len = snprintf(full_cmd, cmd_len, "odpdpdk -c %s -m %d",
- mask_str, DPDK_MEMORY_MB);
+ cmd_len = snprintf(full_cmd, cmd_len, "odpdpdk -c %s -m %d %s",
+ mask_str, DPDK_MEMORY_MB, cmdline);
for (i = 0, dpdk_argc = 1; i < cmd_len; ++i) {
if (isspace(full_cmd[i]))