e9842275b0e7ae9cc6fe926ded2cb539dd840cb1
[vpp.git] / vlib / vlib / node.h
1 /*
2  * Copyright (c) 2015 Cisco and/or its affiliates.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at:
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 /*
16  * node.h: VLIB processing nodes
17  *
18  * Copyright (c) 2008 Eliot Dresselhaus
19  *
20  * Permission is hereby granted, free of charge, to any person obtaining
21  * a copy of this software and associated documentation files (the
22  * "Software"), to deal in the Software without restriction, including
23  * without limitation the rights to use, copy, modify, merge, publish,
24  * distribute, sublicense, and/or sell copies of the Software, and to
25  * permit persons to whom the Software is furnished to do so, subject to
26  * the following conditions:
27  *
28  * The above copyright notice and this permission notice shall be
29  * included in all copies or substantial portions of the Software.
30  *
31  *  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
32  *  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
33  *  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
34  *  NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
35  *  LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
36  *  OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
37  *  WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
38  */
39
40 #ifndef included_vlib_node_h
41 #define included_vlib_node_h
42
43 #include <vppinfra/cpu.h>
44 #include <vppinfra/longjmp.h>
45 #include <vppinfra/timing_wheel.h>
46 #include <vlib/trace.h>         /* for vlib_trace_filter_t */
47
48 /* Forward declaration. */
49 struct vlib_node_runtime_t;
50 struct vlib_frame_t;
51
52 /* Internal nodes (including output nodes) move data from node to
53    node (or out of the graph for output nodes). */
54 typedef uword (vlib_node_function_t) (struct vlib_main_t * vm,
55                                       struct vlib_node_runtime_t * node,
56                                       struct vlib_frame_t * frame);
57
58 typedef enum {
59   /* An internal node on the call graph (could be output). */
60   VLIB_NODE_TYPE_INTERNAL,
61
62   /* Nodes which input data into the processing graph.
63      Input nodes are called for each iteration of main loop. */
64   VLIB_NODE_TYPE_INPUT,
65
66   /* Nodes to be called before all input nodes.
67      Used, for example, to clean out driver TX rings before
68      processing input. */
69   VLIB_NODE_TYPE_PRE_INPUT,
70
71   /* "Process" nodes which can be suspended and later resumed. */
72   VLIB_NODE_TYPE_PROCESS,
73
74   VLIB_N_NODE_TYPE,
75 } vlib_node_type_t;
76
77 typedef struct _vlib_node_registration {
78   /* Vector processing function for this node. */
79   vlib_node_function_t * function;
80
81   /* Node name. */
82   char * name;
83
84   /* Name of sibling (if applicable). */
85   char * sibling_of;
86
87   /* Node index filled in by registration. */
88   u32 index;
89
90   /* Type of this node. */
91   vlib_node_type_t type;
92
93   /* Error strings indexed by error code for this node. */
94   char ** error_strings;
95
96   /* Buffer format/unformat for this node. */
97   format_function_t * format_buffer;
98   unformat_function_t * unformat_buffer;
99
100   /* Trace format/unformat for this node. */
101   format_function_t * format_trace;
102   unformat_function_t * unformat_trace;
103
104   /* Function to validate incoming frames. */
105   u8 * (* validate_frame) (struct vlib_main_t * vm,
106                            struct vlib_node_runtime_t *,
107                            struct vlib_frame_t * f);
108
109   /* Per-node runtime data. */
110   void * runtime_data;
111
112   /* Process stack size. */
113   u16 process_log2_n_stack_bytes;
114
115   /* Number of bytes of per-node run time data. */
116   u8 runtime_data_bytes;
117
118   /* State for input nodes. */
119   u8 state;
120
121   /* Node flags. */
122   u16 flags;
123
124   /* Size of scalar and vector arguments in bytes. */
125   u16 scalar_size, vector_size;
126
127   /* Number of error codes used by this node. */
128   u16 n_errors;
129
130   /* Number of next node names that follow. */
131   u16 n_next_nodes;
132
133   /* Constructor link-list, don't ask... */
134   struct _vlib_node_registration * next_registration;
135
136   /* Names of next nodes which this node feeds into. */
137   char * next_nodes[];
138
139 } vlib_node_registration_t;
140
141 #define VLIB_REGISTER_NODE(x,...)                                       \
142     __VA_ARGS__ vlib_node_registration_t x;                             \
143 static void __vlib_add_node_registration_##x (void)                     \
144     __attribute__((__constructor__)) ;                                  \
145 static void __vlib_add_node_registration_##x (void)                     \
146 {                                                                       \
147     vlib_main_t * vm = vlib_get_main();                                 \
148     x.next_registration = vm->node_main.node_registrations;             \
149     vm->node_main.node_registrations = &x;                              \
150 }                                                                       \
151 __VA_ARGS__ vlib_node_registration_t x 
152
153 #if CLIB_DEBUG > 0
154 #define VLIB_NODE_FUNCTION_CLONE_TEMPLATE(arch, fn)
155 #define VLIB_NODE_FUNCTION_MULTIARCH_CLONE(fn)
156 #define VLIB_NODE_FUNCTION_MULTIARCH(node, fn)
157 #else
158 #define VLIB_NODE_FUNCTION_CLONE_TEMPLATE(arch, fn, tgt)                \
159   uword                                                                 \
160   __attribute__ ((flatten))                                             \
161   __attribute__ ((target (tgt)))                                        \
162   CLIB_CPU_OPTIMIZED                                                    \
163   fn ## _ ## arch ( struct vlib_main_t * vm,                            \
164                    struct vlib_node_runtime_t * node,                   \
165                    struct vlib_frame_t * frame)                         \
166   { return fn (vm, node, frame); }
167
168 #define VLIB_NODE_FUNCTION_MULTIARCH_CLONE(fn)                          \
169   foreach_march_variant(VLIB_NODE_FUNCTION_CLONE_TEMPLATE, fn)
170
171 #define VLIB_NODE_FUNCTION_MULTIARCH(node, fn)                          \
172   VLIB_NODE_FUNCTION_MULTIARCH_CLONE(fn)                                \
173   CLIB_MULTIARCH_SELECT_FN(fn, static inline)                           \
174   static void __attribute__((__constructor__))                          \
175   __vlib_node_function_multiarch_select_##node (void)                   \
176   { node.function = fn ## _multiarch_select(); }
177 #endif
178
179 always_inline vlib_node_registration_t *
180 vlib_node_next_registered (vlib_node_registration_t * c)
181 {
182   c = clib_elf_section_data_next (c, c->n_next_nodes * sizeof (c->next_nodes[0]));
183   return c;
184 }
185
186 typedef struct {
187   /* Total calls, clock ticks and vector elements processed for this node. */
188   u64 calls, vectors, clocks, suspends;
189   u64 max_clock;
190   u64 max_clock_n;
191 } vlib_node_stats_t;
192
193 #define foreach_vlib_node_state                                 \
194   /* Input node is called each iteration of main loop.          \
195      This is the default (zero). */                             \
196   _ (POLLING)                                                   \
197   /* Input node is called when device signals an interrupt. */  \
198   _ (INTERRUPT)                                                 \
199   /* Input node is never called. */                             \
200   _ (DISABLED)
201
202 typedef enum {
203 #define _(f) VLIB_NODE_STATE_##f,
204   foreach_vlib_node_state
205 #undef _
206   VLIB_N_NODE_STATE,
207 } vlib_node_state_t;
208
209 typedef struct vlib_node_t {
210   /* Vector processing function for this node. */
211   vlib_node_function_t * function;
212
213   /* Node name. */
214   u8 * name;
215
216   /* Node name index in elog string table. */
217   u32 name_elog_string;
218
219   /* Total statistics for this node. */
220   vlib_node_stats_t stats_total;
221
222   /* Saved values as of last clear (or zero if never cleared).
223      Current values are always stats_total - stats_last_clear. */
224   vlib_node_stats_t stats_last_clear;
225
226   /* Type of this node. */
227   vlib_node_type_t type;
228
229   /* Node index. */
230   u32 index;
231
232   /* Index of corresponding node runtime. */
233   u32 runtime_index;
234
235   /* Runtime data for this node. */
236   void * runtime_data;
237
238   /* Node flags. */
239   u16 flags;
240
241   /* Processing function keeps frame.  Tells node dispatching code not
242      to free frame after dispatch is done.  */
243 #define VLIB_NODE_FLAG_FRAME_NO_FREE_AFTER_DISPATCH (1 << 0)
244
245   /* Node counts as output/drop/punt node for stats purposes. */
246 #define VLIB_NODE_FLAG_IS_OUTPUT (1 << 1)
247 #define VLIB_NODE_FLAG_IS_DROP (1 << 2)
248 #define VLIB_NODE_FLAG_IS_PUNT (1 << 3)
249 #define VLIB_NODE_FLAG_IS_HANDOFF (1 << 4)
250
251   /* Set if current node runtime has traced vectors. */
252 #define VLIB_NODE_FLAG_TRACE (1 << 5)
253
254 #define VLIB_NODE_FLAG_SWITCH_FROM_INTERRUPT_TO_POLLING_MODE (1 << 6)
255 #define VLIB_NODE_FLAG_SWITCH_FROM_POLLING_TO_INTERRUPT_MODE (1 << 7)
256
257   /* State for input nodes. */
258   u8 state;
259
260   /* Number of bytes of run time data. */
261   u8 runtime_data_bytes;
262
263   /* Number of error codes used by this node. */
264   u16 n_errors;
265
266   /* Size of scalar and vector arguments in bytes. */
267   u16 scalar_size, vector_size;
268
269   /* Handle/index in error heap for this node. */
270   u32 error_heap_handle;
271   u32 error_heap_index;
272
273   /* Error strings indexed by error code for this node. */
274   char ** error_strings;
275
276   /* Vector of next node names.
277      Only used before next_nodes array is initialized. */
278   char ** next_node_names;
279
280   /* Next node indices for this node. */
281   u32 * next_nodes;
282
283   /* Name of node that we are sibling of. */
284   char * sibling_of;
285
286   /* Bitmap of all of this node's siblings. */
287   uword * sibling_bitmap;
288
289   /* Total number of vectors sent to each next node. */
290   u64 * n_vectors_by_next_node;
291
292   /* Hash table mapping next node index into slot in
293      next_nodes vector.  Quickly determines whether this node
294      is connected to given next node and, if so, with which slot. */
295   uword * next_slot_by_node;
296
297   /* Bitmap of node indices which feed this node. */
298   uword * prev_node_bitmap;
299
300   /* Node/next-index which own enqueue rights with to this node. */
301   u32 owner_node_index, owner_next_index;
302
303   /* Buffer format/unformat for this node. */
304   format_function_t * format_buffer;
305   unformat_function_t * unformat_buffer;
306
307   /* Trace buffer format/unformat for this node. */
308   format_function_t * format_trace;
309
310   /* Function to validate incoming frames. */
311   u8 * (* validate_frame) (struct vlib_main_t * vm,
312                            struct vlib_node_runtime_t *,
313                            struct vlib_frame_t * f);
314   /* for pretty-printing, not typically valid */
315   u8 * state_string;
316 } vlib_node_t;
317
318 #define VLIB_INVALID_NODE_INDEX ((u32) ~0)
319
320 /* Max number of vector elements to process at once per node. */
321 #define VLIB_FRAME_SIZE 256
322 #define VLIB_FRAME_ALIGN VLIB_MAX_CPUS
323
324 /* Calling frame (think stack frame) for a node. */
325 typedef struct vlib_frame_t {
326   /* Frame flags. */
327   u16 flags;
328
329   /* Number of scalar bytes in arguments. */
330   u8 scalar_size;
331
332   /* Number of bytes per vector argument. */
333   u8 vector_size;
334
335   /* Number of vector elements currently in frame. */
336   u16 n_vectors;
337
338   /* Owner cpuid / heap id */
339   u16 cpu_index;
340
341   /* Scalar and vector arguments to next node. */
342   u8 arguments[0];
343 } vlib_frame_t;
344
345 typedef struct {
346   /* Frame index. */
347   u32 frame_index;
348
349   /* Node runtime for this next. */
350   u32 node_runtime_index;
351
352   /* Next frame flags. */
353   u32 flags;
354
355   /* Reflects node frame-used flag for this next. */
356 #define VLIB_FRAME_NO_FREE_AFTER_DISPATCH \
357   VLIB_NODE_FLAG_FRAME_NO_FREE_AFTER_DISPATCH
358
359   /* This next frame owns enqueue to node
360      corresponding to node_runtime_index. */
361 #define VLIB_FRAME_OWNER (1 << 15)
362
363   /* Set when frame has been allocated for this next. */
364 #define VLIB_FRAME_IS_ALLOCATED VLIB_NODE_FLAG_IS_OUTPUT
365
366   /* Set when frame has been added to pending vector. */
367 #define VLIB_FRAME_PENDING VLIB_NODE_FLAG_IS_DROP
368
369   /* Set when frame is to be freed after dispatch. */
370 #define VLIB_FRAME_FREE_AFTER_DISPATCH VLIB_NODE_FLAG_IS_PUNT
371
372   /* Set when frame has traced packets. */
373 #define VLIB_FRAME_TRACE VLIB_NODE_FLAG_TRACE
374
375   /* Number of vectors enqueue to this next since last overflow. */
376   u32 vectors_since_last_overflow;
377 } vlib_next_frame_t;
378
379 always_inline void
380 vlib_next_frame_init (vlib_next_frame_t * nf)
381 {
382   memset (nf, 0, sizeof (nf[0]));
383   nf->frame_index = ~0;
384   nf->node_runtime_index = ~0;
385 }
386
387 /* A frame pending dispatch by main loop. */
388 typedef struct {
389   /* Node and runtime for this frame. */
390   u32 node_runtime_index;
391
392   /* Frame index (in the heap). */
393   u32 frame_index;
394
395   /* Start of next frames for this node. */
396   u32 next_frame_index;
397
398   /* Special value for next_frame_index when there is no next frame. */
399 #define VLIB_PENDING_FRAME_NO_NEXT_FRAME ((u32) ~0)
400 } vlib_pending_frame_t;
401
402 typedef struct vlib_node_runtime_t {
403   /* Node function to call. */
404   vlib_node_function_t * function;
405
406   /* Vector of errors for this node. */
407   vlib_error_t * errors;
408
409   /* Number of clock cycles. */
410   u32 clocks_since_last_overflow;
411
412   /* Maximum clock cycle for an invocation. */
413   u32 max_clock;
414
415   /* Number of vectors in the recorded max_clock. */
416   u32 max_clock_n;
417
418   /* Number of calls. */
419   u32 calls_since_last_overflow;
420
421   /* Number of vector elements processed by this node. */
422   u32 vectors_since_last_overflow;
423
424   /* Start of next frames for this node. */
425   u32 next_frame_index;
426
427   /* Node index. */
428   u32 node_index;
429
430   /* For input nodes: decremented on each main loop interation until it reaches zero
431      and function is called.  Allows some input nodes to be called
432      more than others. */
433   u32 input_main_loops_per_call;
434
435   /* Saved main loop counter of last dispatch of this node. */
436   u32 main_loop_count_last_dispatch;
437
438   u32 main_loop_vector_stats[2];
439
440   /* Copy of main node flags. */
441   u16 flags;
442
443   /* Input node state. */
444   u16 state;
445
446   u16 n_next_nodes;
447
448   /* Next frame index that vector arguments were last enqueued to
449      last time this node ran.  Set to zero before first run
450      of this node. */
451   u16 cached_next_index;
452
453   /* CPU this node runs on */
454   u16 cpu_index;
455
456   /* Function dependent node-runtime. */
457   uword runtime_data[(128
458                       - 1 * sizeof (vlib_node_function_t *)
459                       - 1 * sizeof (vlib_error_t *)
460                       - 11 * sizeof (u32)
461                       - 5 * sizeof (u16)) / sizeof (uword)];
462 } vlib_node_runtime_t;
463
464 typedef struct {
465   /* Number of allocated frames for this scalar/vector size. */
466   u32 n_alloc_frames;
467
468   /* Vector of free frame indices for this scalar/vector size. */
469   u32 * free_frame_indices;
470 } vlib_frame_size_t;
471
472 typedef struct {
473   /* Users opaque value for event type. */
474   uword opaque;
475 } vlib_process_event_type_t;
476
477 typedef struct {
478   /* Node runtime for this process. */
479   vlib_node_runtime_t node_runtime;
480
481   /* Where to longjmp when process is done. */
482   clib_longjmp_t return_longjmp;
483
484 #define VLIB_PROCESS_RETURN_LONGJMP_RETURN ((uword) ~0 - 0)
485 #define VLIB_PROCESS_RETURN_LONGJMP_SUSPEND ((uword) ~0 - 1)
486
487   /* Where to longjmp to resume node after suspend. */
488   clib_longjmp_t resume_longjmp;
489 #define VLIB_PROCESS_RESUME_LONGJMP_SUSPEND 0
490 #define VLIB_PROCESS_RESUME_LONGJMP_RESUME  1
491
492   u16 flags;
493 #define VLIB_PROCESS_IS_SUSPENDED_WAITING_FOR_CLOCK (1 << 0)
494 #define VLIB_PROCESS_IS_SUSPENDED_WAITING_FOR_EVENT (1 << 1)
495   /* Set to indicate that this process has been added to resume vector. */
496 #define VLIB_PROCESS_RESUME_PENDING (1 << 2)
497
498   /* Process function is currently running. */
499 #define VLIB_PROCESS_IS_RUNNING (1 << 3)
500
501   /* Size of process stack. */
502   u16 log2_n_stack_bytes;
503
504   u32 suspended_process_frame_index;
505
506   /* Number of times this process was suspended. */
507   u32 n_suspends;
508
509   /* Vectors of pending event data indexed by event type index. */
510   void ** pending_event_data_by_type_index;
511
512   /* Bitmap of event type-indices with non-empty vectors. */
513   uword * non_empty_event_type_bitmap;
514
515   /* Bitmap of event type-indices which are one time events. */
516   uword * one_time_event_type_bitmap;
517
518   /* Type is opaque pointer -- typically a pointer to an event handler
519      function.  Hash table to map opaque to a type index. */
520   uword * event_type_index_by_type_opaque;
521
522   /* Pool of currently valid event types. */
523   vlib_process_event_type_t * event_type_pool;
524
525   /* When suspending saves cpu cycle counter when process is to be resumed. */
526   u64 resume_cpu_time;
527
528   /* Default output function and its argument for any CLI outputs
529      within the process. */
530   vlib_cli_output_function_t *output_function;
531   uword output_function_arg;
532
533 #ifdef CLIB_UNIX
534   /* Pad to a multiple of the page size so we can mprotect process stacks */
535 #define PAGE_SIZE_MULTIPLE 0x1000
536 #define ALIGN_ON_MULTIPLE_PAGE_BOUNDARY_FOR_MPROTECT  __attribute__ ((aligned (PAGE_SIZE_MULTIPLE)))
537 #else
538 #define ALIGN_ON_MULTIPLE_PAGE_BOUNDARY_FOR_MPROTECT
539 #endif
540
541   /* Process stack.  Starts here and extends 2^log2_n_stack_bytes
542      bytes. */
543
544 #define VLIB_PROCESS_STACK_MAGIC (0xdead7ead)
545   u32 stack[0] ALIGN_ON_MULTIPLE_PAGE_BOUNDARY_FOR_MPROTECT;
546 } vlib_process_t __attribute__ ((aligned (CLIB_CACHE_LINE_BYTES)));
547
548 #ifdef CLIB_UNIX
549   /* Ensure that the stack is aligned on the multiple of the page size */
550 typedef char assert_process_stack_must_be_aligned_exactly_to_page_size_multiple
551                 [(sizeof(vlib_process_t) - PAGE_SIZE_MULTIPLE) == 0 ? 0 : -1];
552 #endif
553
554 typedef struct {
555     u32 node_index;
556
557     u32 one_time_event;
558 } vlib_one_time_waiting_process_t;
559
560 typedef struct {
561   u16 n_data_elts;
562
563   u16 n_data_elt_bytes;
564
565   /* n_data_elts * n_data_elt_bytes */
566   u32 n_data_bytes;
567
568   /* Process node & event type to be used to signal event. */
569   u32 process_node_index;
570
571   u32 event_type_index;
572
573   union {
574     u8 inline_event_data[64 - 3 * sizeof (u32) - 2 * sizeof (u16)];
575
576     /* Vector of event data used only when data does not fit inline. */
577     u8 * event_data_as_vector;
578   };
579 } vlib_signal_timed_event_data_t;
580
581 always_inline uword
582 vlib_timing_wheel_data_is_timed_event (u32 d)
583 { return d & 1; }
584
585 always_inline u32
586 vlib_timing_wheel_data_set_suspended_process (u32 i)
587 { return 0 + 2*i; }
588
589 always_inline u32
590 vlib_timing_wheel_data_set_timed_event (u32 i)
591 { return 1 + 2*i; }
592
593 always_inline uword
594 vlib_timing_wheel_data_get_index (u32 d)
595 { return d / 2; }
596
597 typedef struct {
598   /* Public nodes. */
599   vlib_node_t ** nodes;
600
601   /* Node index hashed by node name. */
602   uword * node_by_name;
603
604   u32 flags;
605 #define VLIB_NODE_MAIN_RUNTIME_STARTED (1 << 0)
606
607   /* Nodes segregated by type for cache locality.
608      Does not apply to nodes of type VLIB_NODE_TYPE_INTERNAL. */
609   vlib_node_runtime_t * nodes_by_type[VLIB_N_NODE_TYPE];
610
611   /* Node runtime indices for input nodes with pending interrupts. */
612   u32 * pending_interrupt_node_runtime_indices;
613
614   /* Input nodes are switched from/to interrupt to/from polling mode
615      when average vector length goes above/below polling/interrupt
616      thresholds. */
617   u32 polling_threshold_vector_length;
618   u32 interrupt_threshold_vector_length;
619
620   /* Vector of next frames. */
621   vlib_next_frame_t * next_frames;
622
623   /* Vector of internal node's frames waiting to be called. */
624   vlib_pending_frame_t * pending_frames;
625
626   /* Timing wheel for scheduling time-based node dispatch. */
627   timing_wheel_t timing_wheel;
628
629   vlib_signal_timed_event_data_t * signal_timed_event_data_pool;
630
631   /* Opaque data vector added via timing_wheel_advance. */
632   u32 * data_from_advancing_timing_wheel;
633
634   /* CPU time of next process to be ready on timing wheel. */
635   u64 cpu_time_next_process_ready;
636
637   /* Vector of process nodes.
638      One for each node of type VLIB_NODE_TYPE_PROCESS. */
639   vlib_process_t ** processes;
640
641   /* Current running process or ~0 if no process running. */
642   u32 current_process_index;
643
644   /* Pool of pending process frames. */
645   vlib_pending_frame_t * suspended_process_frames;
646
647   /* Vector of event data vectors pending recycle. */
648   void ** recycled_event_data_vectors;
649
650   /* Current counts of nodes in each state. */
651   u32 input_node_counts_by_state[VLIB_N_NODE_STATE];
652
653   /* Hash of (scalar_size,vector_size) to frame_sizes index. */
654   uword * frame_size_hash;
655
656   /* Per-size frame allocation information. */
657   vlib_frame_size_t * frame_sizes;
658
659   /* Time of last node runtime stats clear. */
660   f64 time_last_runtime_stats_clear;
661
662   /* Node registrations added by constructors */
663   vlib_node_registration_t * node_registrations;
664 } vlib_node_main_t;
665
666
667 #define FRAME_QUEUE_MAX_NELTS 32
668 typedef struct {
669   CLIB_CACHE_LINE_ALIGN_MARK(cacheline0);
670   u64 head;
671   u64 head_hint;
672   u64 tail;
673   u32 n_in_use;
674   u32 nelts;
675   u32 written;
676   u32 threshold;
677   i32 n_vectors[FRAME_QUEUE_MAX_NELTS];
678 } frame_queue_trace_t;
679
680 typedef struct {
681   u64 count[FRAME_QUEUE_MAX_NELTS];
682 } frame_queue_nelt_counter_t;
683
684 #endif /* included_vlib_node_h */