FD.io VPP  v21.06-3-gbb25fbf28
Vector Packet Processing
l2_flood.c
Go to the documentation of this file.
1 /*
2  * l2_flood.c : layer 2 flooding
3  *
4  * Copyright (c) 2013 Cisco and/or its affiliates.
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at:
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */
17 
18 #include <vlib/vlib.h>
19 #include <vnet/vnet.h>
20 #include <vnet/ethernet/ethernet.h>
21 #include <vlib/cli.h>
22 #include <vnet/l2/l2_input.h>
23 #include <vnet/l2/feat_bitmap.h>
24 #include <vnet/l2/l2_bvi.h>
25 #include <vnet/l2/l2_fib.h>
26 
27 #include <vppinfra/error.h>
28 #include <vppinfra/hash.h>
29 
30 
31 /**
32  * @file
33  * @brief Ethernet Flooding.
34  *
35  * Flooding uses the packet replication infrastructure to send a copy of the
36  * packet to each member interface. Logically the replication infrastructure
37  * expects two graph nodes: a prep node that initiates replication and sends the
38  * packet to the first destination, and a recycle node that is passed the packet
39  * after it has been transmitted.
40  *
41  * To decrease the amount of code, l2 flooding implements both functions in
42  * the same graph node. This node can tell if is it being called as the "prep"
43  * or "recycle" using replication_is_recycled().
44  */
45 
46 
47 typedef struct
48 {
49 
50  /* Next nodes for each feature */
51  u32 feat_next_node_index[32];
52 
53  /* next node index for the L3 input node of each ethertype */
55 
56  /* convenience variables */
59 
60  /* per-cpu vector of cloned packets */
64 
65 typedef struct
66 {
67  u8 src[6];
68  u8 dst[6];
72 
73 
74 /* packet trace format function */
75 static u8 *
76 format_l2flood_trace (u8 * s, va_list * args)
77 {
78  CLIB_UNUSED (vlib_main_t * vm) = va_arg (*args, vlib_main_t *);
79  CLIB_UNUSED (vlib_node_t * node) = va_arg (*args, vlib_node_t *);
80  l2flood_trace_t *t = va_arg (*args, l2flood_trace_t *);
81 
82  s = format (s, "l2-flood: sw_if_index %d dst %U src %U bd_index %d",
83  t->sw_if_index,
86  return s;
87 }
88 
90 
91 #ifndef CLIB_MARCH_VARIANT
93 #endif /* CLIB_MARCH_VARIANT */
94 
95 #define foreach_l2flood_error \
96 _(L2FLOOD, "L2 flood packets") \
97 _(REPL_FAIL, "L2 replication failures") \
98 _(NO_MEMBERS, "L2 replication complete") \
99 _(BVI_BAD_MAC, "BVI L3 mac mismatch") \
100 _(BVI_ETHERTYPE, "BVI packet with unhandled ethertype")
101 
102 typedef enum
103 {
104 #define _(sym,str) L2FLOOD_ERROR_##sym,
106 #undef _
109 
110 static char *l2flood_error_strings[] = {
111 #define _(sym,string) string,
113 #undef _
114 };
115 
116 typedef enum
117 {
122 
123 /*
124  * Perform flooding on one packet
125  *
126  * Due to the way BVI processing can modify the packet, the BVI interface
127  * (if present) must be processed last in the replication. The member vector
128  * is arranged so that the BVI interface is always the first element.
129  * Flooding walks the vector in reverse.
130  *
131  * BVI processing causes the packet to go to L3 processing. This strips the
132  * L2 header, which is fine because the replication infrastructure restores
133  * it. However L3 processing can trigger larger changes to the packet. For
134  * example, an ARP request could be turned into an ARP reply, an ICMP request
135  * could be turned into an ICMP reply. If BVI processing is not performed
136  * last, the modified packet would be replicated to the remaining members.
137  */
140 {
141  u32 n_left_from, *from, *to_next;
145 
147  n_left_from = frame->n_vectors;
148  next_index = node->cached_next_index;
149 
150  while (n_left_from > 0)
151  {
152  u32 n_left_to_next;
153 
154  vlib_get_next_frame (vm, node, next_index, to_next, n_left_to_next);
155 
156  while (n_left_from > 0 && n_left_to_next > 0)
157  {
158  u16 n_clones, n_cloned, clone0;
159  l2_bridge_domain_t *bd_config;
160  u32 sw_if_index0, bi0, ci0;
161  l2_flood_member_t *member;
162  vlib_buffer_t *b0, *c0;
163  u16 next0;
164  u8 in_shg;
165  i32 mi;
166 
167  /* speculatively enqueue b0 to the current next frame */
168  bi0 = from[0];
169  from += 1;
170  n_left_from -= 1;
171  next0 = L2FLOOD_NEXT_L2_OUTPUT;
172 
173  b0 = vlib_get_buffer (vm, bi0);
174 
175  /* Get config for the bridge domain interface */
177  vnet_buffer (b0)->l2.bd_index);
178  in_shg = vnet_buffer (b0)->l2.shg;
179  sw_if_index0 = vnet_buffer (b0)->sw_if_index[VLIB_RX];
180 
182  vec_len (bd_config->members));
183 
185 
186  /* Find first members that passes the reflection and SHG checks */
187  for (mi = bd_config->flood_count - 1; mi >= 0; mi--)
188  {
189  member = &bd_config->members[mi];
190  if ((member->sw_if_index != sw_if_index0) &&
191  (!in_shg || (member->shg != in_shg)))
192  {
193  vec_add1 (msm->members[thread_index], member);
194  }
195  }
196 
197  n_clones = vec_len (msm->members[thread_index]);
198 
199  if (0 == n_clones)
200  {
201  /* No members to flood to */
202  to_next[0] = bi0;
203  to_next += 1;
204  n_left_to_next -= 1;
205 
206  b0->error = node->errors[L2FLOOD_ERROR_NO_MEMBERS];
208  to_next, n_left_to_next,
209  bi0, L2FLOOD_NEXT_DROP);
210  continue;
211  }
212  else if (n_clones > 1)
213  {
214  vec_validate (msm->clones[thread_index], n_clones);
215 
216  /*
217  * the header offset needs to be large enough to incorporate
218  * all the L3 headers that could be touched when doing BVI
219  * processing. So take the current l2 length plus 2 * IPv6
220  * headers (for tunnel encap)
221  */
222  n_cloned = vlib_buffer_clone (vm, bi0,
223  msm->clones[thread_index],
224  n_clones,
226 
227  vec_set_len (msm->clones[thread_index], n_cloned);
228 
229  if (PREDICT_FALSE (n_cloned != n_clones))
230  {
231  b0->error = node->errors[L2FLOOD_ERROR_REPL_FAIL];
232  /* Worst-case, no clones, consume the original buf */
233  if (n_cloned == 0)
234  {
235  ci0 = bi0;
236  member = msm->members[thread_index][0];
237  goto use_original_buffer;
238  }
239  }
240 
241  /*
242  * for all but the last clone, these are not BVI bound
243  */
244  for (clone0 = 0; clone0 < n_cloned - 1; clone0++)
245  {
246  member = msm->members[thread_index][clone0];
247  ci0 = msm->clones[thread_index][clone0];
248  c0 = vlib_get_buffer (vm, ci0);
249 
250  to_next[0] = ci0;
251  to_next += 1;
252  n_left_to_next -= 1;
253 
254  if (PREDICT_FALSE ((node->flags & VLIB_NODE_FLAG_TRACE) &&
255  (b0->flags & VLIB_BUFFER_IS_TRACED)))
256  {
257  ethernet_header_t *h0;
258  l2flood_trace_t *t;
259 
260  t = vlib_add_trace (vm, node, c0, sizeof (*t));
261  h0 = vlib_buffer_get_current (c0);
262  t->sw_if_index = sw_if_index0;
263  t->bd_index = vnet_buffer (c0)->l2.bd_index;
264  clib_memcpy_fast (t->src, h0->src_address, 6);
265  clib_memcpy_fast (t->dst, h0->dst_address, 6);
266  }
267 
268  /* Do normal L2 forwarding */
269  vnet_buffer (c0)->sw_if_index[VLIB_TX] =
270  member->sw_if_index;
271 
273  to_next, n_left_to_next,
274  ci0, next0);
275  if (PREDICT_FALSE (0 == n_left_to_next))
276  {
278  n_left_to_next);
280  n_left_to_next);
281  }
282  }
283  member = msm->members[thread_index][clone0];
284  ci0 = msm->clones[thread_index][clone0];
285  }
286  else
287  {
288  /* one clone */
289  ci0 = bi0;
290  member = msm->members[thread_index][0];
291  }
292 
293  use_original_buffer:
294  /*
295  * the last clone that might go to a BVI
296  */
297  c0 = vlib_get_buffer (vm, ci0);
298 
299  to_next[0] = ci0;
300  to_next += 1;
301  n_left_to_next -= 1;
302 
303  if (PREDICT_FALSE ((node->flags & VLIB_NODE_FLAG_TRACE) &&
304  (b0->flags & VLIB_BUFFER_IS_TRACED)))
305  {
306  ethernet_header_t *h0;
307  l2flood_trace_t *t;
308 
309  t = vlib_add_trace (vm, node, c0, sizeof (*t));
310  h0 = vlib_buffer_get_current (c0);
311  t->sw_if_index = sw_if_index0;
312  t->bd_index = vnet_buffer (c0)->l2.bd_index;
313  clib_memcpy_fast (t->src, h0->src_address, 6);
314  clib_memcpy_fast (t->dst, h0->dst_address, 6);
315  }
316  /* Forward packet to the current member */
317  if (PREDICT_FALSE (member->flags & L2_FLOOD_MEMBER_BVI))
318  {
319  /* Do BVI processing */
320  u32 rc;
321  rc = l2_to_bvi (vm,
322  msm->vnet_main,
323  c0, member->sw_if_index, &msm->l3_next, &next0);
324 
325  if (PREDICT_FALSE (rc != TO_BVI_ERR_OK))
326  {
327  if (rc == TO_BVI_ERR_BAD_MAC)
328  {
329  c0->error = node->errors[L2FLOOD_ERROR_BVI_BAD_MAC];
330  }
331  else if (rc == TO_BVI_ERR_ETHERTYPE)
332  {
333  c0->error = node->errors[L2FLOOD_ERROR_BVI_ETHERTYPE];
334  }
335  next0 = L2FLOOD_NEXT_DROP;
336  }
337  }
338  else
339  {
340  /* Do normal L2 forwarding */
341  vnet_buffer (c0)->sw_if_index[VLIB_TX] = member->sw_if_index;
342  }
343 
345  to_next, n_left_to_next,
346  ci0, next0);
347  if (PREDICT_FALSE (0 == n_left_to_next))
348  {
349  vlib_put_next_frame (vm, node, next_index, n_left_to_next);
351  to_next, n_left_to_next);
352  }
353  }
354 
355  vlib_put_next_frame (vm, node, next_index, n_left_to_next);
356  }
357 
358  vlib_node_increment_counter (vm, node->node_index,
359  L2FLOOD_ERROR_L2FLOOD, frame->n_vectors);
360 
361  return frame->n_vectors;
362 }
363 
364 
365 /* *INDENT-OFF* */
367  .name = "l2-flood",
368  .vector_size = sizeof (u32),
369  .format_trace = format_l2flood_trace,
371 
372  .n_errors = ARRAY_LEN(l2flood_error_strings),
373  .error_strings = l2flood_error_strings,
374 
375  .n_next_nodes = L2FLOOD_N_NEXT,
376 
377  /* edit / add dispositions here */
378  .next_nodes = {
379  [L2FLOOD_NEXT_L2_OUTPUT] = "l2-output",
380  [L2FLOOD_NEXT_DROP] = "error-drop",
381  },
382 };
383 /* *INDENT-ON* */
384 
385 #ifndef CLIB_MARCH_VARIANT
386 clib_error_t *
388 {
390 
391  mp->vlib_main = vm;
392  mp->vnet_main = vnet_get_main ();
393 
396 
397  /* Initialize the feature next-node indexes */
399  l2flood_node.index,
403 
404  return NULL;
405 }
406 
408 
409 
410 
411 /** Add the L3 input node for this ethertype to the next nodes structure. */
412 void
415 {
417  u32 next_index;
418 
420 
422 }
423 #endif /* CLIB_MARCH_VARIANT */
424 
425 
426 /**
427  * Set subinterface flood enable/disable.
428  * The CLI format is:
429  * set interface l2 flood <interface> [disable]
430  */
431 static clib_error_t *
433  unformat_input_t * input, vlib_cli_command_t * cmd)
434 {
435  vnet_main_t *vnm = vnet_get_main ();
436  clib_error_t *error = 0;
438  u32 enable;
439 
441  {
442  error = clib_error_return (0, "unknown interface `%U'",
443  format_unformat_error, input);
444  goto done;
445  }
446 
447  enable = 1;
448  if (unformat (input, "disable"))
449  {
450  enable = 0;
451  }
452 
453  /* set the interface flag */
454  l2input_intf_bitmap_enable (sw_if_index, L2INPUT_FEAT_FLOOD, enable);
455 
456 done:
457  return error;
458 }
459 
460 /*?
461  * Layer 2 flooding can be enabled and disabled on each
462  * interface and on each bridge-domain. Use this command to
463  * manage interfaces. It is enabled by default.
464  *
465  * @cliexpar
466  * Example of how to enable flooding:
467  * @cliexcmd{set interface l2 flood GigabitEthernet0/8/0}
468  * Example of how to disable flooding:
469  * @cliexcmd{set interface l2 flood GigabitEthernet0/8/0 disable}
470 ?*/
471 /* *INDENT-OFF* */
473  .path = "set interface l2 flood",
474  .short_help = "set interface l2 flood <interface> [disable]",
475  .function = int_flood,
476 };
477 /* *INDENT-ON* */
478 
479 /*
480  * fd.io coding-style-patch-verification: ON
481  *
482  * Local Variables:
483  * eval: (c-set-style "gnu")
484  * End:
485  */
vec_reset_length
#define vec_reset_length(v)
Reset vector length to zero NULL-pointer tolerant.
Definition: vec_bootstrap.h:194
vlib.h
L2FLOOD_NEXT_DROP
@ L2FLOOD_NEXT_DROP
Definition: l2_flood.c:119
vlib_num_workers
static u32 vlib_num_workers()
Definition: threads.h:354
l2_bridge_domain_t
Definition: l2_bd.h:63
unformat_user
uword unformat_user(unformat_input_t *input, unformat_function_t *func,...)
Definition: unformat.c:989
thread_index
u32 thread_index
Definition: nat44_ei_hairpinning.c:492
l2flood_register_input_type
void l2flood_register_input_type(vlib_main_t *vm, ethernet_type_t type, u32 node_index)
Add the L3 input node for this ethertype to the next nodes structure.
Definition: l2_flood.c:413
frame
vlib_main_t vlib_node_runtime_t vlib_frame_t * frame
Definition: nat44_ei.c:3048
l2flood_main_t::l3_next
next_by_ethertype_t l3_next
Definition: l2_flood.c:54
vlib_node_add_next
static uword vlib_node_add_next(vlib_main_t *vm, uword node, uword next_node)
Definition: node_funcs.h:1177
l2input_main
l2input_main_t l2input_main
Definition: l2_input_node.c:78
l2flood_node
vlib_node_registration_t l2flood_node
(constructor) VLIB_REGISTER_NODE (l2flood_node)
Definition: l2_flood.c:366
next_index
nat44_ei_hairpin_src_next_t next_index
Definition: nat44_ei_hairpinning.c:412
l2flood_init
clib_error_t * l2flood_init(vlib_main_t *vm)
Definition: l2_flood.c:387
vlib_get_buffer
static vlib_buffer_t * vlib_get_buffer(vlib_main_t *vm, u32 buffer_index)
Translate buffer index into buffer pointer.
Definition: buffer_funcs.h:111
l2flood_main_t::members
l2_flood_member_t *** members
Definition: l2_flood.c:62
foreach_l2flood_error
#define foreach_l2flood_error
Definition: l2_flood.c:95
l2_flood_member_t::sw_if_index
u32 sw_if_index
Definition: l2_bd.h:55
TO_BVI_ERR_BAD_MAC
#define TO_BVI_ERR_BAD_MAC
Definition: l2_bvi.h:28
format_ethernet_address
u8 * format_ethernet_address(u8 *s, va_list *args)
Definition: format.c:44
ethernet_header_t::dst_address
u8 dst_address[6]
Definition: packet.h:55
ethernet_header_t::src_address
u8 src_address[6]
Definition: packet.h:56
VLIB_NODE_TYPE_INTERNAL
@ VLIB_NODE_TYPE_INTERNAL
Definition: node.h:72
node
vlib_main_t vlib_node_runtime_t * node
Definition: nat44_ei.c:3047
clib_error_return
#define clib_error_return(e, args...)
Definition: error.h:99
vlib_cli_command_t::path
char * path
Definition: cli.h:96
L2_FLOOD_MEMBER_BVI
#define L2_FLOOD_MEMBER_BVI
Definition: l2_bd.h:51
TO_BVI_ERR_ETHERTYPE
#define TO_BVI_ERR_ETHERTYPE
Definition: l2_bvi.h:29
u16
unsigned short u16
Definition: types.h:57
vm
vlib_main_t * vm
X-connect all packets from the HOST to the PHY.
Definition: nat44_ei.c:3047
VLIB_RX
@ VLIB_RX
Definition: defs.h:46
node_index
node node_index
Definition: interface_output.c:420
VLIB_BUFFER_CLONE_HEAD_SIZE
#define VLIB_BUFFER_CLONE_HEAD_SIZE
Definition: buffer.h:61
unformat_input_t
struct _unformat_input_t unformat_input_t
l2_bridge_domain_t::flood_count
u32 flood_count
Definition: l2_bd.h:89
vlib_frame_t
Definition: node.h:372
l2flood_main
l2flood_main_t l2flood_main
Definition: l2_flood.c:92
L2FLOOD_N_NEXT
@ L2FLOOD_N_NEXT
Definition: l2_flood.c:120
clib_memcpy_fast
static_always_inline void * clib_memcpy_fast(void *restrict dst, const void *restrict src, size_t n)
Definition: string.h:92
next_by_ethertype_t
Definition: ethernet.h:265
ethernet.h
error
Definition: cJSON.c:88
l2_fib.h
i32
signed int i32
Definition: types.h:77
unformat
uword unformat(unformat_input_t *i, const char *fmt,...)
Definition: unformat.c:978
vec_len
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
Definition: vec_bootstrap.h:142
vlib_buffer_t::error
vlib_error_t error
Error code for buffers to be enqueued to error handler.
Definition: buffer.h:145
error.h
VLIB_NODE_FN
#define VLIB_NODE_FN(node)
Definition: node.h:202
vec_add1
#define vec_add1(V, E)
Add 1 element to end of vector (unspecified alignment).
Definition: vec.h:606
l2flood_main_t::vnet_main
vnet_main_t * vnet_main
Definition: l2_flood.c:58
int_flood_cli
static vlib_cli_command_t int_flood_cli
(constructor) VLIB_CLI_COMMAND (int_flood_cli)
Definition: l2_flood.c:472
CLIB_UNUSED
#define CLIB_UNUSED(x)
Definition: clib.h:90
vnet_buffer
#define vnet_buffer(b)
Definition: buffer.h:437
vec_elt_at_index
#define vec_elt_at_index(v, i)
Get vector value at index i checking that i is in bounds.
Definition: vec_bootstrap.h:203
vnet_get_main
vnet_main_t * vnet_get_main(void)
Definition: pnat_test_stubs.h:56
VLIB_NODE_FLAG_TRACE
#define VLIB_NODE_FLAG_TRACE
Definition: node.h:291
PREDICT_FALSE
#define PREDICT_FALSE(x)
Definition: clib.h:124
ARRAY_LEN
#define ARRAY_LEN(x)
Definition: clib.h:70
vlib_frame_vector_args
static void * vlib_frame_vector_args(vlib_frame_t *f)
Get pointer to frame vector data.
Definition: node_funcs.h:301
int_flood
static clib_error_t * int_flood(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Set subinterface flood enable/disable.
Definition: l2_flood.c:432
l2_bvi.h
l2flood_trace_t::bd_index
u16 bd_index
Definition: l2_flood.c:70
ethernet_header_t
Definition: packet.h:52
l2input_intf_bitmap_enable
u32 l2input_intf_bitmap_enable(u32 sw_if_index, l2input_feat_masks_t feature_bitmap, u32 enable)
Enable (or disable) the feature in the bitmap for the given interface.
Definition: l2_input.c:177
l2input_get_feat_names
char ** l2input_get_feat_names(void)
Return an array of strings containing graph node names of each feature.
Definition: l2_input.c:59
ethernet_type_t
ethernet_type_t
Definition: packet.h:45
vlib_main_t::thread_index
u32 thread_index
Definition: main.h:213
vlib_node_increment_counter
static void vlib_node_increment_counter(vlib_main_t *vm, u32 node_index, u32 counter_index, u64 increment)
Definition: node_funcs.h:1244
vlib_buffer_clone
static u16 vlib_buffer_clone(vlib_main_t *vm, u32 src_buffer, u32 *buffers, u16 n_buffers, u16 head_end_offset)
Create multiple clones of buffer and store them in the supplied array.
Definition: buffer_funcs.h:1328
format_unformat_error
u8 * format_unformat_error(u8 *s, va_list *va)
Definition: unformat.c:91
vec_validate
#define vec_validate(V, I)
Make sure vector is long enough for given index (no header, unspecified alignment)
Definition: vec.h:523
VLIB_CLI_COMMAND
#define VLIB_CLI_COMMAND(x,...)
Definition: cli.h:163
src
vl_api_address_t src
Definition: gre.api:54
L2INPUT_N_FEAT
@ L2INPUT_N_FEAT
Definition: l2_input.h:163
vlib_node_registration_t
struct _vlib_node_registration vlib_node_registration_t
l2flood_trace_t::src
u8 src[6]
Definition: l2_flood.c:67
l2_input.h
vec_set_len
#define vec_set_len(v, l)
Set vector length to a user-defined value.
Definition: vec_bootstrap.h:179
format_l2flood_trace
static u8 * format_l2flood_trace(u8 *s, va_list *args)
Definition: l2_flood.c:76
vnet_main_t
Definition: vnet.h:76
vlib_validate_buffer_enqueue_x1
#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:224
l2_flood_member_t::shg
u8 shg
Definition: l2_bd.h:57
unformat_vnet_sw_interface
unformat_function_t unformat_vnet_sw_interface
Definition: interface_funcs.h:459
format
description fragment has unexpected format
Definition: map.api:433
vlib_put_next_frame
vlib_put_next_frame(vm, node, next_index, 0)
u32
unsigned int u32
Definition: types.h:88
VLIB_INIT_FUNCTION
#define VLIB_INIT_FUNCTION(x)
Definition: init.h:172
l2flood_next_t
l2flood_next_t
Definition: l2_flood.c:116
dst
vl_api_ip4_address_t dst
Definition: pnat.api:41
cli.h
l2flood_main_t::vlib_main
vlib_main_t * vlib_main
Definition: l2_flood.c:57
l2_flood_member_t
Definition: l2_bd.h:53
l2flood_trace_t
Definition: l2_flood.c:65
vlib_main_t
Definition: main.h:102
vlib_node_t
Definition: node.h:247
vlib_add_trace
void * vlib_add_trace(vlib_main_t *vm, vlib_node_runtime_t *r, vlib_buffer_t *b, u32 n_data_bytes)
Definition: trace.c:628
hash.h
L2FLOOD_N_ERROR
@ L2FLOOD_N_ERROR
Definition: l2_flood.c:107
u8
unsigned char u8
Definition: types.h:56
clib_error_t
Definition: clib_error.h:21
vlib_buffer_get_current
static void * vlib_buffer_get_current(vlib_buffer_t *b)
Get pointer to current data to process.
Definition: buffer.h:257
feat_bitmap.h
vlib_init_function_t
clib_error_t *() vlib_init_function_t(struct vlib_main_t *vm)
Definition: init.h:51
l2_bridge_domain_t::members
l2_flood_member_t * members
Definition: l2_bd.h:86
l2flood_main_t::clones
u32 ** clones
Definition: l2_flood.c:61
l2flood_trace_t::dst
u8 dst[6]
Definition: l2_flood.c:68
next_by_ethertype_register
clib_error_t * next_by_ethertype_register(next_by_ethertype_t *l3_next, u32 ethertype, u32 next_index)
Definition: node.c:2194
l2_flood_member_t::flags
u8 flags
Definition: l2_bd.h:56
l2flood_error_strings
static char * l2flood_error_strings[]
Definition: l2_flood.c:110
vnet.h
vlib_node_runtime_t
Definition: node.h:454
l2flood_main_t
Definition: l2_flood.c:47
vlib_cli_command_t
Definition: cli.h:92
from
from
Definition: nat44_ei_hairpinning.c:415
sw_if_index
vl_api_interface_index_t sw_if_index
Definition: wireguard.api:34
vlib_get_next_frame
#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:395
l2flood_main_t::feat_next_node_index
u32 feat_next_node_index[32]
Definition: l2_flood.c:51
VLIB_TX
@ VLIB_TX
Definition: defs.h:47
l2flood_error_t
l2flood_error_t
Definition: l2_flood.c:102
l2_to_bvi
static_always_inline u32 l2_to_bvi(vlib_main_t *vlib_main, vnet_main_t *vnet_main, vlib_buffer_t *b0, u32 bvi_sw_if_index, next_by_ethertype_t *l3_next, u16 *next0)
Send a packet from L2 processing to L3 via the BVI interface.
Definition: l2_bvi.h:59
n_left_from
n_left_from
Definition: nat44_ei_hairpinning.c:416
l2flood_trace_t::sw_if_index
u32 sw_if_index
Definition: l2_flood.c:69
L2FLOOD_NEXT_L2_OUTPUT
@ L2FLOOD_NEXT_L2_OUTPUT
Definition: l2_flood.c:118
feat_bitmap_init_next_nodes
static void feat_bitmap_init_next_nodes(vlib_main_t *vm, u32 node_index, u32 num_features, char **feat_names, u32 *next_nodes)
Initialize the feature next-node indexes of a graph node.
Definition: feat_bitmap.h:43
type
vl_api_fib_path_type_t type
Definition: fib_types.api:123
TO_BVI_ERR_OK
#define TO_BVI_ERR_OK
Definition: l2_bvi.h:27
l2input_main_t::bd_configs
l2_bridge_domain_t * bd_configs
Definition: l2_input.h:93
vlib_buffer_t::flags
u32 flags
buffer flags: VLIB_BUFFER_FREE_LIST_INDEX_MASK: bits used to store free list index,...
Definition: buffer.h:133
vlib_buffer_t
VLIB buffer representation.
Definition: buffer.h:111
VLIB_REGISTER_NODE
#define VLIB_REGISTER_NODE(x,...)
Definition: node.h:169