FD.io VPP  v16.12-rc0-308-g931be3a
Vector Packet Processing
handoff.c
Go to the documentation of this file.
1 
2 /*
3  * Copyright (c) 2016 Cisco and/or its affiliates.
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at:
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #include <vnet/vnet.h>
18 #include <vppinfra/xxhash.h>
19 #include <vlib/threads.h>
20 #include <vnet/handoff.h>
21 #include <vnet/feature/feature.h>
22 
23 typedef struct
24 {
28 
29 typedef struct
30 {
34 
36 
37  /* convenience variables */
41 
43 
44 typedef struct
45 {
50 
51 /* packet trace format function */
52 static u8 *
53 format_worker_handoff_trace (u8 * s, va_list * args)
54 {
55  CLIB_UNUSED (vlib_main_t * vm) = va_arg (*args, vlib_main_t *);
56  CLIB_UNUSED (vlib_node_t * node) = va_arg (*args, vlib_node_t *);
57  worker_handoff_trace_t *t = va_arg (*args, worker_handoff_trace_t *);
58 
59  s =
60  format (s, "worker-handoff: sw_if_index %d, next_worker %d, buffer 0x%x",
62  return s;
63 }
64 
66 
67 static uword
69  vlib_node_runtime_t * node, vlib_frame_t * frame)
70 {
73  u32 n_left_from, *from;
74  static __thread vlib_frame_queue_elt_t **handoff_queue_elt_by_worker_index;
75  static __thread vlib_frame_queue_t **congested_handoff_queue_by_worker_index
76  = 0;
77  vlib_frame_queue_elt_t *hf = 0;
78  int i;
79  u32 n_left_to_next_worker = 0, *to_next_worker = 0;
80  u32 next_worker_index = 0;
81  u32 current_worker_index = ~0;
82 
83  if (PREDICT_FALSE (handoff_queue_elt_by_worker_index == 0))
84  {
85  vec_validate (handoff_queue_elt_by_worker_index, tm->n_vlib_mains - 1);
86 
87  vec_validate_init_empty (congested_handoff_queue_by_worker_index,
88  hm->first_worker_index + hm->num_workers - 1,
89  (vlib_frame_queue_t *) (~0));
90  }
91 
92  from = vlib_frame_vector_args (frame);
93  n_left_from = frame->n_vectors;
94 
95  while (n_left_from > 0)
96  {
97  u32 bi0;
98  vlib_buffer_t *b0;
99  u32 sw_if_index0;
100  u32 hash;
101  u64 hash_key;
103  u32 index0;
104 
105  bi0 = from[0];
106  from += 1;
107  n_left_from -= 1;
108 
109  b0 = vlib_get_buffer (vm, bi0);
110  sw_if_index0 = vnet_buffer (b0)->sw_if_index[VLIB_RX];
111  ASSERT (hm->if_data);
112  ihd0 = vec_elt_at_index (hm->if_data, sw_if_index0);
113 
114  next_worker_index = hm->first_worker_index;
115 
116  /*
117  * Force unknown traffic onto worker 0,
118  * and into ethernet-input. $$$$ add more hashes.
119  */
120 
121  /* Compute ingress LB hash */
122  hash_key = eth_get_key ((ethernet_header_t *) b0->data);
123  hash = (u32) clib_xxhash (hash_key);
124 
125  /* if input node did not specify next index, then packet
126  should go to eternet-input */
127  if (PREDICT_FALSE ((b0->flags & BUFFER_HANDOFF_NEXT_VALID) == 0))
128  vnet_buffer (b0)->handoff.next_index =
130  else if (vnet_buffer (b0)->handoff.next_index ==
132  || vnet_buffer (b0)->handoff.next_index ==
134  || vnet_buffer (b0)->handoff.next_index ==
136  vlib_buffer_advance (b0, (sizeof (ethernet_header_t)));
137 
138  if (PREDICT_TRUE (is_pow2 (vec_len (ihd0->workers))))
139  index0 = hash & (vec_len (ihd0->workers) - 1);
140  else
141  index0 = hash % vec_len (ihd0->workers);
142 
143  next_worker_index += ihd0->workers[index0];
144 
145  if (next_worker_index != current_worker_index)
146  {
147  if (hf)
148  hf->n_vectors = VLIB_FRAME_SIZE - n_left_to_next_worker;
149 
150  hf = dpdk_get_handoff_queue_elt (next_worker_index,
151  handoff_queue_elt_by_worker_index);
152 
153  n_left_to_next_worker = VLIB_FRAME_SIZE - hf->n_vectors;
154  to_next_worker = &hf->buffer_index[hf->n_vectors];
155  current_worker_index = next_worker_index;
156  }
157 
158  /* enqueue to correct worker thread */
159  to_next_worker[0] = bi0;
160  to_next_worker++;
161  n_left_to_next_worker--;
162 
163  if (n_left_to_next_worker == 0)
164  {
167  current_worker_index = ~0;
168  handoff_queue_elt_by_worker_index[next_worker_index] = 0;
169  hf = 0;
170  }
171 
173  && (b0->flags & VLIB_BUFFER_IS_TRACED)))
174  {
176  vlib_add_trace (vm, node, b0, sizeof (*t));
177  t->sw_if_index = sw_if_index0;
178  t->next_worker_index = next_worker_index - hm->first_worker_index;
179  t->buffer_index = bi0;
180  }
181 
182  }
183 
184  if (hf)
185  hf->n_vectors = VLIB_FRAME_SIZE - n_left_to_next_worker;
186 
187  /* Ship frames to the worker nodes */
188  for (i = 0; i < vec_len (handoff_queue_elt_by_worker_index); i++)
189  {
190  if (handoff_queue_elt_by_worker_index[i])
191  {
192  hf = handoff_queue_elt_by_worker_index[i];
193  /*
194  * It works better to let the handoff node
195  * rate-adapt, always ship the handoff queue element.
196  */
197  if (1 || hf->n_vectors == hf->last_n_vectors)
198  {
200  handoff_queue_elt_by_worker_index[i] = 0;
201  }
202  else
203  hf->last_n_vectors = hf->n_vectors;
204  }
205  congested_handoff_queue_by_worker_index[i] =
206  (vlib_frame_queue_t *) (~0);
207  }
208  hf = 0;
209  current_worker_index = ~0;
210  return frame->n_vectors;
211 }
212 
213 /* *INDENT-OFF* */
215  .function = worker_handoff_node_fn,
216  .name = "worker-handoff",
217  .vector_size = sizeof (u32),
218  .format_trace = format_worker_handoff_trace,
220 
221  .n_next_nodes = 1,
222  .next_nodes = {
223  [0] = "error-drop",
224  },
225 };
226 
228 /* *INDENT-ON* */
229 
230 int
232  uword * bitmap, int enable_disable)
233 {
236  vnet_main_t *vnm = vnet_get_main ();
238  int i, rv = 0;
239 
240  if (pool_is_free_index (vnm->interface_main.sw_interfaces, sw_if_index))
241  return VNET_API_ERROR_INVALID_SW_IF_INDEX;
242 
243  sw = vnet_get_sw_interface (vnm, sw_if_index);
245  return VNET_API_ERROR_INVALID_SW_IF_INDEX;
246 
247  if (clib_bitmap_last_set (bitmap) >= hm->num_workers)
248  return VNET_API_ERROR_INVALID_WORKER;
249 
250  vec_validate (hm->if_data, sw_if_index);
251  d = vec_elt_at_index (hm->if_data, sw_if_index);
252 
253  vec_free (d->workers);
255 
256  if (enable_disable)
257  {
258  d->workers_bitmap = bitmap;
259  /* *INDENT-OFF* */
260  clib_bitmap_foreach (i, bitmap,
261  ({
262  vec_add1(d->workers, i);
263  }));
264  /* *INDENT-ON* */
265  }
266 
267  vnet_feature_enable_disable ("device-input", "worker-handoff",
268  sw_if_index, enable_disable, 0, 0);
269  return rv;
270 }
271 
272 static clib_error_t *
274  unformat_input_t * input,
275  vlib_cli_command_t * cmd)
276 {
277  u32 sw_if_index = ~0;
278  int enable_disable = 1;
279  uword *bitmap = 0;
280 
281  int rv = 0;
282 
284  {
285  if (unformat (input, "disable"))
286  enable_disable = 0;
287  else if (unformat (input, "workers %U", unformat_bitmap_list, &bitmap))
288  ;
289  else if (unformat (input, "%U", unformat_vnet_sw_interface,
290  vnet_get_main (), &sw_if_index))
291  ;
292  else
293  break;
294  }
295 
296  if (sw_if_index == ~0)
297  return clib_error_return (0, "Please specify an interface...");
298 
299  if (bitmap == 0)
300  return clib_error_return (0, "Please specify list of workers...");
301 
302  rv =
303  interface_handoff_enable_disable (vm, sw_if_index, bitmap,
304  enable_disable);
305 
306  switch (rv)
307  {
308  case 0:
309  break;
310 
311  case VNET_API_ERROR_INVALID_SW_IF_INDEX:
312  return clib_error_return (0, "Invalid interface");
313  break;
314 
315  case VNET_API_ERROR_INVALID_WORKER:
316  return clib_error_return (0, "Invalid worker(s)");
317  break;
318 
319  case VNET_API_ERROR_UNIMPLEMENTED:
320  return clib_error_return (0,
321  "Device driver doesn't support redirection");
322  break;
323 
324  default:
325  return clib_error_return (0, "unknown return value %d", rv);
326  }
327  return 0;
328 }
329 
330 /* *INDENT-OFF* */
331 VLIB_CLI_COMMAND (set_interface_handoff_command, static) = {
332  .path = "set interface handoff",
333  .short_help =
334  "set interface handoff <interface-name> workers <workers-list>",
336 };
337 /* *INDENT-ON* */
338 
339 typedef struct
340 {
345 
346 /* packet trace format function */
347 static u8 *
348 format_handoff_dispatch_trace (u8 * s, va_list * args)
349 {
350  CLIB_UNUSED (vlib_main_t * vm) = va_arg (*args, vlib_main_t *);
351  CLIB_UNUSED (vlib_node_t * node) = va_arg (*args, vlib_node_t *);
352  handoff_dispatch_trace_t *t = va_arg (*args, handoff_dispatch_trace_t *);
353 
354  s = format (s, "handoff-dispatch: sw_if_index %d next_index %d buffer 0x%x",
355  t->sw_if_index, t->next_index, t->buffer_index);
356  return s;
357 }
358 
359 
361 
362 #define foreach_handoff_dispatch_error \
363 _(EXAMPLE, "example packets")
364 
365 typedef enum
366 {
367 #define _(sym,str) HANDOFF_DISPATCH_ERROR_##sym,
369 #undef _
372 
374 #define _(sym,string) string,
376 #undef _
377 };
378 
379 static uword
381  vlib_node_runtime_t * node, vlib_frame_t * frame)
382 {
383  u32 n_left_from, *from, *to_next;
384  handoff_dispatch_next_t next_index;
385 
386  from = vlib_frame_vector_args (frame);
387  n_left_from = frame->n_vectors;
388  next_index = node->cached_next_index;
389 
390  while (n_left_from > 0)
391  {
392  u32 n_left_to_next;
393 
394  vlib_get_next_frame (vm, node, next_index, to_next, n_left_to_next);
395 
396  while (n_left_from >= 4 && n_left_to_next >= 2)
397  {
398  u32 bi0, bi1;
399  vlib_buffer_t *b0, *b1;
400  u32 next0, next1;
401  u32 sw_if_index0, sw_if_index1;
402 
403  /* Prefetch next iteration. */
404  {
405  vlib_buffer_t *p2, *p3;
406 
407  p2 = vlib_get_buffer (vm, from[2]);
408  p3 = vlib_get_buffer (vm, from[3]);
409 
410  vlib_prefetch_buffer_header (p2, LOAD);
411  vlib_prefetch_buffer_header (p3, LOAD);
412  }
413 
414  /* speculatively enqueue b0 and b1 to the current next frame */
415  to_next[0] = bi0 = from[0];
416  to_next[1] = bi1 = from[1];
417  from += 2;
418  to_next += 2;
419  n_left_from -= 2;
420  n_left_to_next -= 2;
421 
422  b0 = vlib_get_buffer (vm, bi0);
423  b1 = vlib_get_buffer (vm, bi1);
424 
425  next0 = vnet_buffer (b0)->handoff.next_index;
426  next1 = vnet_buffer (b1)->handoff.next_index;
427 
429  {
431  {
432  vlib_trace_buffer (vm, node, next0, b0, /* follow_chain */
433  0);
435  vlib_add_trace (vm, node, b0, sizeof (*t));
436  sw_if_index0 = vnet_buffer (b0)->sw_if_index[VLIB_RX];
437  t->sw_if_index = sw_if_index0;
438  t->next_index = next0;
439  t->buffer_index = bi0;
440  }
442  {
443  vlib_trace_buffer (vm, node, next1, b1, /* follow_chain */
444  0);
446  vlib_add_trace (vm, node, b1, sizeof (*t));
447  sw_if_index1 = vnet_buffer (b1)->sw_if_index[VLIB_RX];
448  t->sw_if_index = sw_if_index1;
449  t->next_index = next1;
450  t->buffer_index = bi1;
451  }
452  }
453 
454  /* verify speculative enqueues, maybe switch current next frame */
455  vlib_validate_buffer_enqueue_x2 (vm, node, next_index,
456  to_next, n_left_to_next,
457  bi0, bi1, next0, next1);
458  }
459 
460  while (n_left_from > 0 && n_left_to_next > 0)
461  {
462  u32 bi0;
463  vlib_buffer_t *b0;
464  u32 next0;
465  u32 sw_if_index0;
466 
467  /* speculatively enqueue b0 to the current next frame */
468  bi0 = from[0];
469  to_next[0] = bi0;
470  from += 1;
471  to_next += 1;
472  n_left_from -= 1;
473  n_left_to_next -= 1;
474 
475  b0 = vlib_get_buffer (vm, bi0);
476 
477  next0 = vnet_buffer (b0)->handoff.next_index;
478 
480  {
482  {
483  vlib_trace_buffer (vm, node, next0, b0, /* follow_chain */
484  0);
486  vlib_add_trace (vm, node, b0, sizeof (*t));
487  sw_if_index0 = vnet_buffer (b0)->sw_if_index[VLIB_RX];
488  t->sw_if_index = sw_if_index0;
489  t->next_index = next0;
490  t->buffer_index = bi0;
491  }
492  }
493 
494  /* verify speculative enqueue, maybe switch current next frame */
495  vlib_validate_buffer_enqueue_x1 (vm, node, next_index,
496  to_next, n_left_to_next,
497  bi0, next0);
498  }
499 
500  vlib_put_next_frame (vm, node, next_index, n_left_to_next);
501  }
502 
503  return frame->n_vectors;
504 }
505 
506 /* *INDENT-OFF* */
508  .function = handoff_dispatch_node_fn,
509  .name = "handoff-dispatch",
510  .vector_size = sizeof (u32),
511  .format_trace = format_handoff_dispatch_trace,
514 
516  .error_strings = handoff_dispatch_error_strings,
517 
518  .n_next_nodes = HANDOFF_DISPATCH_N_NEXT,
519 
520  .next_nodes = {
521  [HANDOFF_DISPATCH_NEXT_DROP] = "error-drop",
522  [HANDOFF_DISPATCH_NEXT_ETHERNET_INPUT] = "ethernet-input",
523  [HANDOFF_DISPATCH_NEXT_IP4_INPUT] = "ip4-input-no-checksum",
524  [HANDOFF_DISPATCH_NEXT_IP6_INPUT] = "ip6-input",
525  [HANDOFF_DISPATCH_NEXT_MPLS_INPUT] = "mpls-input",
526  },
527 };
528 
530 /* *INDENT-ON* */
531 
532 clib_error_t *
534 {
537  clib_error_t *error;
538  uword *p;
539 
540  if ((error = vlib_call_init_function (vm, threads_init)))
541  return error;
542 
544  /* Only the standard vnet worker threads are supported */
545  p = hash_get_mem (tm->thread_registrations_by_name, "workers");
546  if (p)
547  {
548  tr = (vlib_thread_registration_t *) p[0];
549  if (tr)
550  {
551  hm->num_workers = tr->count;
553  }
554  }
555 
556  hm->vlib_main = vm;
557  hm->vnet_main = &vnet_main;
558 
561 
562  return 0;
563 }
564 
566 
567 /*
568  * fd.io coding-style-patch-verification: ON
569  *
570  * Local Variables:
571  * eval: (c-set-style "gnu")
572  * End:
573  */
#define vec_validate(V, I)
Make sure vector is long enough for given index (no header, unspecified alignment) ...
Definition: vec.h:396
void vlib_put_next_frame(vlib_main_t *vm, vlib_node_runtime_t *r, u32 next_index, u32 n_vectors_left)
Release pointer to next frame vector data.
Definition: main.c:457
u32 cached_next_index
Definition: handoff.c:31
sll srl srl sll sra u16x4 i
Definition: vector_sse2.h:343
u32 trace_active_hint
Definition: trace.h:83
#define CLIB_UNUSED(x)
Definition: clib.h:79
uword unformat(unformat_input_t *i, char *fmt,...)
Definition: unformat.c:966
handoff_main_t handoff_main
Definition: handoff.c:42
u32 num_workers
Definition: handoff.c:32
bad routing header type(not 4)") sr_error (NO_MORE_SEGMENTS
vnet_interface_main_t interface_main
Definition: vnet.h:72
#define PREDICT_TRUE(x)
Definition: clib.h:98
#define UNFORMAT_END_OF_INPUT
Definition: format.h:143
clib_error_t * threads_init(vlib_main_t *vm)
Definition: threads.c:1467
#define vec_add1(V, E)
Add 1 element to end of vector (unspecified alignment).
Definition: vec.h:482
static u64 clib_xxhash(u64 key)
Definition: xxhash.h:58
struct _vlib_node_registration vlib_node_registration_t
#define BUFFER_HANDOFF_NEXT_VALID
Definition: buffer.h:68
static vnet_sw_interface_t * vnet_get_sw_interface(vnet_main_t *vnm, u32 sw_if_index)
unformat_function_t unformat_vnet_sw_interface
u32 buffer_index[VLIB_FRAME_SIZE]
Definition: threads.h:81
u32 handoff_dispatch_node_index
Definition: threads.h:325
void vnet_feature_enable_disable(const char *arc_name, const char *node_name, u32 sw_if_index, int enable_disable, void *feature_config, u32 n_feature_config_bytes)
Definition: feature.c:185
static void vlib_trace_buffer(vlib_main_t *vm, vlib_node_runtime_t *r, u32 next_index, vlib_buffer_t *b, int follow_chain)
Definition: trace_funcs.h:104
vnet_main_t * vnet_get_main(void)
Definition: misc.c:46
handoff_dispatch_error_t
Definition: handoff.c:365
#define VLIB_INIT_FUNCTION(x)
Definition: init.h:111
static u8 * format_worker_handoff_trace(u8 *s, va_list *args)
Definition: handoff.c:53
clib_error_t * handoff_init(vlib_main_t *vm)
Definition: handoff.c:533
#define vec_elt_at_index(v, i)
Get vector value at index i checking that i is in bounds.
unsigned long u64
Definition: types.h:89
static u8 * format_handoff_dispatch_trace(u8 *s, va_list *args)
Definition: handoff.c:348
#define vlib_call_init_function(vm, x)
Definition: init.h:161
u32 first_worker_index
Definition: handoff.c:33
static vlib_frame_queue_elt_t * dpdk_get_handoff_queue_elt(u32 vlib_worker_index, vlib_frame_queue_elt_t **handoff_queue_elt_by_worker_index)
Definition: handoff.h:99
#define clib_bitmap_foreach(i, ai, body)
Macro to iterate across set bits in a bitmap.
Definition: bitmap.h:361
vlib_node_registration_t handoff_dispatch_node
(constructor) VLIB_REGISTER_NODE (handoff_dispatch_node)
Definition: handoff.c:360
#define VLIB_NODE_FLAG_IS_HANDOFF
Definition: node.h:256
static uword clib_bitmap_last_set(uword *ai)
Return the higest numbered set bit in a bitmap.
Definition: bitmap.h:402
vlib_node_registration_t handoff_node
Definition: handoff.c:65
static void vlib_put_handoff_queue_elt(vlib_frame_queue_elt_t *hf)
Definition: handoff.h:36
#define PREDICT_FALSE(x)
Definition: clib.h:97
vnet_main_t vnet_main
Definition: misc.c:43
#define VLIB_FRAME_SIZE
Definition: node.h:328
#define vlib_validate_buffer_enqueue_x2(vm, node, next_index, to_next, n_left_to_next, bi0, bi1, next0, next1)
Finish enqueueing two buffers forward in the graph.
Definition: buffer_node.h:70
per_inteface_handoff_data_t * if_data
Definition: handoff.c:35
vnet_main_t * vnet_main
Definition: handoff.c:39
#define vlib_validate_buffer_enqueue_x1(vm, node, next_index, to_next, n_left_to_next, bi0, next0)
Finish enqueueing one buffer forward in the graph.
Definition: buffer_node.h:216
#define vlib_get_next_frame(vm, node, next_index, vectors, n_vectors_left)
Get pointer to next frame vector data by (vlib_node_runtime_t, next_index).
Definition: node_funcs.h:350
static uword handoff_dispatch_node_fn(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
Definition: handoff.c:380
u16 n_vectors
Definition: node.h:344
#define vec_free(V)
Free vector&#39;s memory (no header).
Definition: vec.h:300
static vlib_thread_main_t * vlib_get_thread_main()
Definition: global_funcs.h:32
static void vlib_buffer_advance(vlib_buffer_t *b, word l)
Advance current data pointer by the supplied (signed!) amount.
Definition: buffer.h:203
#define pool_is_free_index(P, I)
Use free bitmap to query whether given index is free.
Definition: pool.h:211
#define foreach_handoff_dispatch_error
Definition: handoff.c:362
#define ARRAY_LEN(x)
Definition: clib.h:59
#define VLIB_CLI_COMMAND(x,...)
Definition: cli.h:154
u16 cached_next_index
Definition: node.h:463
static clib_error_t * set_interface_handoff_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: handoff.c:273
#define ASSERT(truth)
unsigned int u32
Definition: types.h:88
#define vnet_buffer(b)
Definition: buffer.h:333
vlib_main_t * vlib_main
Definition: handoff.c:38
#define VLIB_NODE_FLAG_TRACE
Definition: node.h:259
static char * handoff_dispatch_error_strings[]
Definition: handoff.c:373
vlib_trace_main_t trace_main
Definition: main.h:121
uword * thread_registrations_by_name
Definition: threads.h:285
#define VLIB_BUFFER_IS_TRACED
Definition: buffer.h:95
static uword is_pow2(uword x)
Definition: clib.h:266
u64 uword
Definition: types.h:112
static void * vlib_add_trace(vlib_main_t *vm, vlib_node_runtime_t *r, vlib_buffer_t *b, u32 n_data_bytes)
Definition: trace_funcs.h:55
static uword worker_handoff_node_fn(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
Definition: handoff.c:68
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
unsigned char u8
Definition: types.h:56
handoff_dispatch_next_t
Definition: handoff.h:25
static uword unformat_bitmap_list(unformat_input_t *input, va_list *va)
unformat a list of bit ranges into a bitmap (eg "0-3,5-7,11" )
Definition: bitmap.h:693
vnet_sw_interface_t * sw_interfaces
Definition: interface.h:568
static void * vlib_frame_vector_args(vlib_frame_t *f)
Get pointer to frame vector data.
Definition: node_funcs.h:253
#define hash_get_mem(h, key)
Definition: hash.h:268
static u64 eth_get_key(ethernet_header_t *h0)
Definition: handoff.h:214
#define vlib_prefetch_buffer_header(b, type)
Prefetch buffer metadata.
Definition: buffer.h:166
#define VLIB_NODE_FUNCTION_MULTIARCH(node, fn)
Definition: node.h:158
static uword unformat_check_input(unformat_input_t *i)
Definition: format.h:169
#define VLIB_REGISTER_NODE(x,...)
Definition: node.h:143
vnet_sw_interface_type_t type
Definition: interface.h:485
u8 * format(u8 *s, const char *fmt,...)
Definition: format.c:418
u8 data[0]
Packet data.
Definition: buffer.h:154
#define clib_error_return(e, args...)
Definition: error.h:111
struct _unformat_input_t unformat_input_t
u32 flags
Definition: vhost-user.h:75
#define vec_validate_init_empty(V, I, INIT)
Make sure vector is long enough for given index and initialize empty space (no header, unspecified alignment)
Definition: vec.h:445
u32 flags
buffer flags: VLIB_BUFFER_IS_TRACED: trace this buffer.
Definition: buffer.h:85
int interface_handoff_enable_disable(vlib_main_t *vm, u32 sw_if_index, uword *bitmap, int enable_disable)
Definition: handoff.c:231
static vlib_buffer_t * vlib_get_buffer(vlib_main_t *vm, u32 buffer_index)
Translate buffer index into buffer pointer.
Definition: buffer_funcs.h:69
Definition: defs.h:46
vlib_node_registration_t worker_handoff_node
(constructor) VLIB_REGISTER_NODE (worker_handoff_node)
Definition: handoff.c:214