diff options
author | Matias Elo <matias.elo@nokia.com> | 2019-01-17 11:12:16 +0200 |
---|---|---|
committer | Maxim Uvarov <maxim.uvarov@linaro.org> | 2019-01-18 13:41:45 +0300 |
commit | 45caf39520a1f7aac3e40265bc46bc4dba695cbc (patch) | |
tree | 7e565db76d551689c9d809d879d282b8d55eab62 | |
parent | de255937275a99cebe62f159f3fc7c4b70bc04bb (diff) |
linux-gen: dpdk: add a fallback value for the number of numa nodes
numa_num_configured_nodes() may return 0 on some platforms. In that case
use 1 as a replacement value.
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-- | platform/linux-generic/pktio/dpdk.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/platform/linux-generic/pktio/dpdk.c b/platform/linux-generic/pktio/dpdk.c index 1edd2488e..1d3220578 100644 --- a/platform/linux-generic/pktio/dpdk.c +++ b/platform/linux-generic/pktio/dpdk.c @@ -1197,7 +1197,11 @@ static int dpdk_pktio_init(void) } mem_str_len = snprintf(NULL, 0, "%d,", DPDK_MEMORY_MB); + + /* numa_num_configured_nodes() may return 0 on some platforms */ numa_nodes = numa_num_configured_nodes(); + if (numa_nodes <= 0) + numa_nodes = 1; char mem_str[mem_str_len * numa_nodes]; |