X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fvlib%2Fnode.h;h=fd792dc3fa6ab53a0f3f60b973fcbc8d4cd6e51a;hb=06111a837;hp=aae5103908dc900d992d50b40ce1cdf64461f0d0;hpb=982e44fcc482cc9bc08e46c2a36ab66b0861bacb;p=vpp.git diff --git a/src/vlib/node.h b/src/vlib/node.h index aae5103908d..fd792dc3fa6 100644 --- a/src/vlib/node.h +++ b/src/vlib/node.h @@ -166,25 +166,25 @@ typedef struct _vlib_node_registration } vlib_node_registration_t; #ifndef CLIB_MARCH_VARIANT -#define VLIB_REGISTER_NODE(x,...) \ - __VA_ARGS__ vlib_node_registration_t x; \ -static void __vlib_add_node_registration_##x (void) \ - __attribute__((__constructor__)) ; \ -static void __vlib_add_node_registration_##x (void) \ -{ \ - vlib_main_t * vm = vlib_get_main(); \ - x.next_registration = vm->node_main.node_registrations; \ - vm->node_main.node_registrations = &x; \ -} \ -static void __vlib_rm_node_registration_##x (void) \ - __attribute__((__destructor__)) ; \ -static void __vlib_rm_node_registration_##x (void) \ -{ \ - vlib_main_t * vm = vlib_get_main(); \ - VLIB_REMOVE_FROM_LINKED_LIST (vm->node_main.node_registrations, \ - &x, next_registration); \ -} \ -__VA_ARGS__ vlib_node_registration_t x +#define VLIB_REGISTER_NODE(x, ...) \ + __VA_ARGS__ vlib_node_registration_t x; \ + static void __vlib_add_node_registration_##x (void) \ + __attribute__ ((__constructor__)); \ + static void __vlib_add_node_registration_##x (void) \ + { \ + vlib_global_main_t *vgm = vlib_get_global_main (); \ + x.next_registration = vgm->node_registrations; \ + vgm->node_registrations = &x; \ + } \ + static void __vlib_rm_node_registration_##x (void) \ + __attribute__ ((__destructor__)); \ + static void __vlib_rm_node_registration_##x (void) \ + { \ + vlib_global_main_t *vgm = vlib_get_global_main (); \ + VLIB_REMOVE_FROM_LINKED_LIST (vgm->node_registrations, &x, \ + next_registration); \ + } \ + __VA_ARGS__ vlib_node_registration_t x #else #define VLIB_REGISTER_NODE(x,...) \ STATIC_ASSERT (sizeof(# __VA_ARGS__) != 7,"node " #x " must not be declared as static"); \ @@ -216,7 +216,7 @@ static __clib_unused vlib_node_registration_t __clib_unused_##x r->next_registration = node.node_fn_registrations; \ node.node_fn_registrations = r; \ } \ - uword CLIB_CPU_OPTIMIZED CLIB_MARCH_SFX (node##_fn) + uword CLIB_MARCH_SFX (node##_fn) unformat_function_t unformat_vlib_node_variant; @@ -439,12 +439,12 @@ vlib_next_frame_init (vlib_next_frame_t * nf) /* A frame pending dispatch by main loop. */ typedef struct { - /* Node and runtime for this frame. */ - u32 node_runtime_index; - /* Frame index (in the heap). */ vlib_frame_t *frame; + /* Node and runtime for this frame. */ + u32 node_runtime_index; + /* Start of next frames for this node. */ u32 next_frame_index; @@ -730,9 +730,6 @@ typedef struct /* Time of last node runtime stats clear. */ f64 time_last_runtime_stats_clear; - /* Node registrations added by constructors */ - vlib_node_registration_t *node_registrations; - /* Node index from error code */ u32 *node_by_error;