Increase number of per-cpu mheaps to 256 31/331/2
authorDamjan Marion <damarion@cisco.com>
Sat, 6 Feb 2016 18:16:21 +0000 (19:16 +0100)
committerGerrit Code Review <gerrit@fd.io>
Tue, 16 Feb 2016 17:50:48 +0000 (17:50 +0000)
It also includes check to ensure that number of
per-cpu mheaps is not lower than number of cpus.

Change-Id: Ibc68b34dda130f922243f9ea15b03e44bbcac269
Signed-off-by: Damjan Marion <damarion@cisco.com>
vlib/vlib/threads.h
vppinfra/vppinfra/mem.h
vppinfra/vppinfra/mem_mheap.c

index 98f19c4..6c16878 100644 (file)
@@ -50,6 +50,10 @@ typedef struct vlib_thread_registration_ {
 
 #define VLIB_MAX_CPUS 256
 
 
 #define VLIB_MAX_CPUS 256
 
+#if VLIB_MAX_CPUS > CLIB_MAX_MHEAPS
+#error Please increase number of per-cpu mheaps
+#endif
+
 #define VLIB_CPU_MASK (VLIB_MAX_CPUS - 1) /* 0x3f, max */
 #define VLIB_OFFSET_MASK (~VLIB_CPU_MASK)
 
 #define VLIB_CPU_MASK (VLIB_MAX_CPUS - 1) /* 0x3f, max */
 #define VLIB_OFFSET_MASK (~VLIB_CPU_MASK)
 
index 938f2d2..301bcdd 100644 (file)
 #include <vppinfra/string.h>        /* memcpy, memset */
 #include <vppinfra/valgrind.h>
 
 #include <vppinfra/string.h>        /* memcpy, memset */
 #include <vppinfra/valgrind.h>
 
+#define CLIB_MAX_MHEAPS 256
+
 /* Per CPU heaps. */
 /* Per CPU heaps. */
-extern void * clib_per_cpu_mheaps[32];
+extern void * clib_per_cpu_mheaps[CLIB_MAX_MHEAPS];
 
 always_inline void * clib_mem_get_per_cpu_heap (void)
 {
 
 always_inline void * clib_mem_get_per_cpu_heap (void)
 {
index e25ae35..5718c8c 100644 (file)
@@ -50,7 +50,7 @@ clib_smp_main_t clib_smp_main = {
   .n_tls_4k_pages = 1,
 };
 
   .n_tls_4k_pages = 1,
 };
 
-void * clib_per_cpu_mheaps[32];
+void * clib_per_cpu_mheaps[CLIB_MAX_MHEAPS];
 
 void clib_mem_exit (void)
 {
 
 void clib_mem_exit (void)
 {