for (i = 0; i < vec_len (rt->errors); i++)
rt->errors[i] = vlib_error_set (n->index, i);
- ASSERT (vec_len (n->runtime_data) <= sizeof (rt->runtime_data));
+ ASSERT (sizeof (vlib_node_runtime_t) == 2 * CLIB_CACHE_LINE_BYTES);
+ ASSERT (vec_len (n->runtime_data) <= sizeof (vlib_node_runtime_t) -
+ STRUCT_OFFSET_OF (vlib_node_runtime_t, runtime_data));
+
if (vec_len (n->runtime_data) > 0)
clib_memcpy (rt->runtime_data, n->runtime_data,
vec_len (n->runtime_data));
typedef struct vlib_node_runtime_t
{
+ CLIB_CACHE_LINE_ALIGN_MARK (cacheline0);
/* Node function to call. */
vlib_node_function_t *function;
u16 cpu_index;
/* Function dependent node-runtime. */
- uword runtime_data[(128
- - 1 * sizeof (vlib_node_function_t *)
- - 1 * sizeof (vlib_error_t *)
- - 11 * sizeof (u32)
- - 5 * sizeof (u16)) / sizeof (uword)];
+ u8 runtime_data[0];
}
vlib_node_runtime_t;
vec_free (n->runtime_data);
vec_add (n->runtime_data, runtime_data, n_runtime_data_bytes);
- ASSERT (vec_len (n->runtime_data) <= sizeof (r->runtime_data));
+ ASSERT (vec_len (n->runtime_data) <= sizeof (vlib_node_runtime_t) -
+ STRUCT_OFFSET_OF (vlib_node_runtime_t, runtime_data));
+
if (vec_len (n->runtime_data) > 0)
clib_memcpy (r->runtime_data, n->runtime_data, vec_len (n->runtime_data));
}