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 a5340c53957b3174c89d03ecf2c61e9ba98ac57c (commit) from 813cd2df67ae0591b0f792eff82854c5c9c642ca (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 a5340c53957b3174c89d03ecf2c61e9ba98ac57c Author: Matias Elo matias.elo@nokia.com Date: Thu Apr 12 13:12:12 2018 +0300
linux-gen: dpdk: allocate huge page memory for all numa nodes
Allocate DPDK memory for all numa nodes in the system.
Fixes bug: https://bugs.linaro.org/show_bug.cgi?id=3657
Signed-off-by: Matias Elo matias.elo@nokia.com Reviewed-by: Dmitry Eremin-Solenikov dmitry.ereminsolenikov@linaro.org Reviewed-by: Bill Fischofer bill.fischofer@linaro.org Signed-off-by: Maxim Uvarov maxim.uvarov@linaro.org
diff --git a/platform/linux-generic/pktio/dpdk.c b/platform/linux-generic/pktio/dpdk.c index 7bccab87..0550416b 100644 --- a/platform/linux-generic/pktio/dpdk.c +++ b/platform/linux-generic/pktio/dpdk.c @@ -49,6 +49,13 @@ #include <rte_string_fns.h> #include <rte_version.h>
+/* NUMA is not supported on all platforms */ +#ifdef RTE_EAL_NUMA_AWARE_HUGEPAGES +#include <numa.h> +#else +#define numa_num_configured_nodes() 1 +#endif + #if RTE_VERSION < RTE_VERSION_NUM(17, 5, 0, 0) #define rte_log_set_global_level rte_set_log_level #endif @@ -1086,6 +1093,7 @@ static int dpdk_pktio_init(void) int32_t masklen; int mem_str_len; int cmd_len; + int numa_nodes; cpu_set_t original_cpuset; struct rte_config *cfg;
@@ -1120,21 +1128,29 @@ static int dpdk_pktio_init(void) return -1; }
- mem_str_len = snprintf(NULL, 0, "%d", DPDK_MEMORY_MB); + mem_str_len = snprintf(NULL, 0, "%d,", DPDK_MEMORY_MB); + numa_nodes = numa_num_configured_nodes(); + + char mem_str[mem_str_len * numa_nodes]; + + for (i = 0; i < numa_nodes; i++) + sprintf(&mem_str[i * mem_str_len], "%d,", DPDK_MEMORY_MB); + mem_str[mem_str_len * numa_nodes - 1] = '\0';
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(cmdline) + strlen(" "); + cmd_len = strlen("odpdpdk -c --socket-mem ") + masklen + + strlen(mem_str) + 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 %s", - mask_str, DPDK_MEMORY_MB, cmdline); + cmd_len = snprintf(full_cmd, cmd_len, + "odpdpdk -c %s --socket-mem %s %s", mask_str, + mem_str, cmdline);
for (i = 0, dpdk_argc = 1; i < cmd_len; ++i) { if (isspace(full_cmd[i]))
-----------------------------------------------------------------------
Summary of changes: platform/linux-generic/pktio/dpdk.c | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-)
hooks/post-receive