From 2d718da0438ca6ccc466eac78ed59b5d7df515a0 Mon Sep 17 00:00:00 2001 From: Darek Stojaczyk Date: Mon, 15 Oct 2018 08:14:28 +0200 Subject: [PATCH] env: use dynamic memory management for DPDK 18.05.1+ With all SPDK patches in place, we can now enable dynamic memory management for all DPDK versions >= 18.05.1 Hugepages can be still reserved with [-s|--mem-size ] option at application startup, but once we use them all up, instead of failing user allocations with -ENOMEM, we'll try to dynamically reserve even more. This allows starting DPDK with `--mem-size 0` and using only as many hugepages as it was actually necessary. Change-Id: I9e6f58ea50af2234f96a53e7a32d9e14d2df65ff Signed-off-by: Darek Stojaczyk Reviewed-on: https://review.gerrithub.io/426828 Tested-by: SPDK CI Jenkins Chandler-Test-Pool: SPDK Automated Test System Reviewed-by: Jim Harris Reviewed-by: Shuhei Matsumoto Reviewed-by: Ben Walker --- lib/env_dpdk/init.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/env_dpdk/init.c b/lib/env_dpdk/init.c index a9ac91275f..1a2fafe152 100644 --- a/lib/env_dpdk/init.c +++ b/lib/env_dpdk/init.c @@ -267,8 +267,8 @@ spdk_build_eal_cmdline(const struct spdk_env_opts *opts) } } -#if RTE_VERSION >= RTE_VERSION_NUM(18, 05, 0, 0) - /* SPDK holds off with using the new memory management model just yet */ +#if RTE_VERSION >= RTE_VERSION_NUM(18, 05, 0, 0) && RTE_VERSION < RTE_VERSION_NUM(18, 5, 1, 0) + /* Dynamic memory management is buggy in DPDK 18.05.0. Don't use it. */ args = spdk_push_arg(args, &argcount, _sprintf_alloc("--legacy-mem")); if (args == NULL) { return -1;