}
else
{
- f = clib_mem_alloc_aligned_no_fail (n, CLIB_CACHE_LINE_BYTES);
+ f = clib_mem_alloc_aligned_no_fail (n, VLIB_FRAME_ALIGN);
f->cpu_index = vm->cpu_index;
fi = vlib_frame_index_no_check (vm, f);
}
/* Max number of vector elements to process at once per node. */
#define VLIB_FRAME_SIZE 256
+#define VLIB_FRAME_ALIGN VLIB_MAX_CPUS
/* Calling frame (think stack frame) for a node. */
typedef struct vlib_frame_t {
uword * coremask;
} vlib_thread_registration_t;
-#define VLIB_MAX_CPUS 32
-
-/*
- * Objects passed around by "index" are cache-line aligned.
- * We can stick the owner CPU into the low 6 bits.
+/*
+ * Frames have their cpu / vlib_main_t index in the low-order N bits
+ * Make VLIB_MAX_CPUS a power-of-two, please...
*/
-#if VLIB_MAX_CPUS > 64
-#error VLIB_MAX_CPUS must be <= 64
-#endif
+
+#define VLIB_MAX_CPUS 256
#define VLIB_CPU_MASK (VLIB_MAX_CPUS - 1) /* 0x3f, max */
#define VLIB_OFFSET_MASK (~VLIB_CPU_MASK)