Skip to contentSkip to conversation

build: fix memory init failures with 32-bit builds

PATCH In review Bruce Richardson 3 participants 4 messages Jul 2, 2020 – Jul 5, 2020 Arm/Amlogic Meson SoC support

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 build: fix memory init failures with 32-bit builds

When building with meson, the default size of virtual address space reserved for mapping pages was globally set at 512GB, which is too big for use in 32-bit processes. To match the behaviour with "make", we configure this to be 512GB for 64-bit and 2MB for 32-bit builds.

Bugzilla ID: 498

Fixes 66cc45e293ed ("mem: replace memseg with memseg lists")
---
 config/meson.build  | 6 ++++++
 config/rte_config.h | 1 -
 2 files changed, 6 insertions(+), 1 deletion(-)
config/meson.build +6 -0
index 351e268c1..72fdabff2 100644
@@ -238,6 +238,12 @@ dpdk_conf.set('RTE_ENABLE_TRACE_FP', get_option('enable_trace_fp'))
 dpdk_conf.set('RTE_MAX_VFIO_GROUPS', 64)
 dpdk_conf.set('RTE_DRIVER_MEMPOOL_BUCKET_SIZE_KB', 64)
 dpdk_conf.set('RTE_LIBRTE_DPAA2_USE_PHYS_IOVA', true)
+if dpdk_conf.get('RTE_ARCH_64')
+	dpdk_conf.set('RTE_MAX_MEM_MB', 524288)
+else
+# for 32-bits we need smaller reserved memory areas
+	dpdk_conf.set('RTE_MAX_MEM_MB', 2048)
+endif
 
 
 compile_time_cpuflags = []
config/rte_config.h +0 -1
index e9201fd46..086acf74a 100644
@@ -38,7 +38,6 @@
 #define RTE_MAX_MEM_MB_PER_LIST 32768
 #define RTE_MAX_MEMSEG_PER_TYPE 32768
 #define RTE_MAX_MEM_MB_PER_TYPE 65536
-#define RTE_MAX_MEM_MB 524288
 #define RTE_MAX_MEMZONE 2560
 #define RTE_MAX_TAILQ 32
 #define RTE_LOG_DP_LEVEL RTE_LOG_INFO
Signature · 1 line
2.25.1
#1 lore raw
Quoted 5 lines · Bruce Richardson

When building with meson, the default size of virtual address space reserved for mapping pages was globally set at 512GB, which is too big for use in 32-bit processes. To match the behaviour with "make", we configure this to be 512GB for 64-bit and 2MB for 32-bit builds.

Oops, typo 2MB -> 2GB

Quoted 42 lines

Bugzilla ID: 498

Fixes 66cc45e293ed ("mem: replace memseg with memseg lists")
---
 config/meson.build  | 6 ++++++
 config/rte_config.h | 1 -
 2 files changed, 6 insertions(+), 1 deletion(-)
config/meson.build +6 -0
index 351e268c1..72fdabff2 100644
@@ -238,6 +238,12 @@ dpdk_conf.set('RTE_ENABLE_TRACE_FP', get_option('enable_trace_fp'))
 dpdk_conf.set('RTE_MAX_VFIO_GROUPS', 64)
 dpdk_conf.set('RTE_DRIVER_MEMPOOL_BUCKET_SIZE_KB', 64)
 dpdk_conf.set('RTE_LIBRTE_DPAA2_USE_PHYS_IOVA', true)
+if dpdk_conf.get('RTE_ARCH_64')
+	dpdk_conf.set('RTE_MAX_MEM_MB', 524288)
+else
+# for 32-bits we need smaller reserved memory areas
+	dpdk_conf.set('RTE_MAX_MEM_MB', 2048)
+endif
 
 
 compile_time_cpuflags = []
config/rte_config.h +0 -1
index e9201fd46..086acf74a 100644
@@ -38,7 +38,6 @@
 #define RTE_MAX_MEM_MB_PER_LIST 32768
 #define RTE_MAX_MEMSEG_PER_TYPE 32768
 #define RTE_MAX_MEM_MB_PER_TYPE 65536
-#define RTE_MAX_MEM_MB 524288
 #define RTE_MAX_MEMZONE 2560
 #define RTE_MAX_TAILQ 32
 #define RTE_LOG_DP_LEVEL RTE_LOG_INFO
Signature · 1 line
2.25.1
Tested-by on v1 1/1
#2 lore raw
In reply to Bruce Richardson
Quoted 10 lines · Bruce Richardson

When building with meson, the default size of virtual address space reserved for mapping pages was globally set at 512GB, which is too big for use in 32-bit processes. To match the behaviour with "make", we configure this to be 512GB for 64-bit and 2MB for 32-bit builds.

Bugzilla ID: 498

Fixes 66cc45e293ed ("mem: replace memseg with memseg lists")
#3 lore raw

02/07/2020 13:19, Ferruh Yigit:

Quoted 6 lines · Bruce Richardson
Quoted 5 lines

When building with meson, the default size of virtual address space reserved for mapping pages was globally set at 512GB, which is too big for use in 32-bit processes. To match the behaviour with "make", we configure this to be 512GB for 64-bit and 2MB for 32-bit builds.

Quoted 7 lines
Quoted 5 lines

Bugzilla ID: 498

Fixes 66cc45e293ed ("mem: replace memseg with memseg lists")

Applied with typo fixed, thanks