FD.io VPP  v21.06-3-gbb25fbf28
Vector Packet Processing
mfib_forward.c
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2016 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 #include <vnet/mfib/mfib_itf.h>
17 #include <vnet/mfib/mfib_entry.h>
18 #include <vnet/dpo/replicate_dpo.h>
19 #include <vnet/mfib/ip4_mfib.h>
20 #include <vnet/mfib/ip6_mfib.h>
21 #include <vnet/mfib/mfib_signal.h>
22 #include <vnet/fib/ip4_fib.h>
23 #include <vnet/fib/ip6_fib.h>
24 
25 #include <vnet/ip/ip4.h>
26 #include <vnet/vnet.h>
27 
32 
33 static u8 *
34 format_mfib_forward_lookup_trace (u8 * s, va_list * args)
35 {
36  CLIB_UNUSED (vlib_main_t * vm) = va_arg (*args, vlib_main_t *);
37  CLIB_UNUSED (vlib_node_t * node) = va_arg (*args, vlib_node_t *);
39 
40  s = format (s, "fib %d entry %d", t->fib_index, t->entry_index);
41  return s;
42 }
43 
44 /* Common trace function for all ip4-forward next nodes. */
45 static void
49 {
50  u32 * from, n_left;
51  ip4_main_t * im = &ip4_main;
52 
53  n_left = frame->n_vectors;
55 
56  while (n_left >= 4)
57  {
58  mfib_forward_lookup_trace_t * t0, * t1;
59  vlib_buffer_t * b0, * b1;
60  u32 bi0, bi1;
61 
62  /* Prefetch next iteration. */
65 
66  bi0 = from[0];
67  bi1 = from[1];
68 
69  b0 = vlib_get_buffer (vm, bi0);
70  b1 = vlib_get_buffer (vm, bi1);
71 
72  if (b0->flags & VLIB_BUFFER_IS_TRACED)
73  {
74  t0 = vlib_add_trace (vm, node, b0, sizeof (t0[0]));
75  t0->entry_index = vnet_buffer (b0)->ip.adj_index[VLIB_TX];
76  t0->fib_index = vec_elt (im->mfib_index_by_sw_if_index,
78  }
79  if (b1->flags & VLIB_BUFFER_IS_TRACED)
80  {
81  t1 = vlib_add_trace (vm, node, b1, sizeof (t1[0]));
82  t1->entry_index = vnet_buffer (b1)->ip.adj_index[VLIB_TX];
83  t1->fib_index = vec_elt (im->mfib_index_by_sw_if_index,
85  }
86  from += 2;
87  n_left -= 2;
88  }
89 
90  while (n_left >= 1)
91  {
93  vlib_buffer_t * b0;
94  u32 bi0;
95 
96  bi0 = from[0];
97 
98  b0 = vlib_get_buffer (vm, bi0);
99 
100  if (b0->flags & VLIB_BUFFER_IS_TRACED)
101  {
102  t0 = vlib_add_trace (vm, node, b0, sizeof (t0[0]));
103  t0->entry_index = vnet_buffer (b0)->ip.adj_index[VLIB_TX];
104  t0->fib_index = vec_elt (im->mfib_index_by_sw_if_index,
106  }
107  from += 1;
108  n_left -= 1;
109  }
110 }
111 
116 
117 static uword
121  int is_v4)
122 {
123  u32 n_left_from, n_left_to_next, * from, * to_next;
124 
126  n_left_from = frame->n_vectors;
127 
128  while (n_left_from > 0)
129  {
131  to_next, n_left_to_next);
132 
133  while (n_left_from > 0 && n_left_to_next > 0)
134  {
135  fib_node_index_t mfei0;
136  vlib_buffer_t * p0;
137  u32 fib_index0;
138  u32 pi0;
139 
140  pi0 = from[0];
141  to_next[0] = pi0;
142  from += 1;
143  to_next += 1;
144  n_left_to_next -= 1;
145  n_left_from -= 1;
146 
147  p0 = vlib_get_buffer (vm, pi0);
148 
149  if (is_v4)
150  {
151  ip4_header_t * ip0;
152 
157  ip0 = vlib_buffer_get_current (p0);
158  mfei0 = ip4_mfib_table_lookup (ip4_mfib_get (fib_index0),
159  &ip0->src_address,
160  &ip0->dst_address, 64);
161  }
162  else
163  {
164  ip6_header_t *ip0;
165 
170  ip0 = vlib_buffer_get_current (p0);
171  mfei0 = ip6_mfib_table_fwd_lookup (ip6_mfib_get (fib_index0),
172  &ip0->src_address,
173  &ip0->dst_address);
174  }
175 
176  vnet_buffer (p0)->ip.adj_index[VLIB_TX] = mfei0;
177  }
178 
180  n_left_to_next);
181  }
182 
183  if (node->flags & VLIB_NODE_FLAG_TRACE)
185 
186  return frame->n_vectors;
187 }
188 
192 {
193  return (mfib_forward_lookup (vm, node, frame, 1));
194 }
195 
197  .name = "ip4-mfib-forward-lookup",
198  .vector_size = sizeof (u32),
199 
200  .format_trace = format_mfib_forward_lookup_trace,
201 
202  .n_next_nodes = MFIB_FORWARD_LOOKUP_N_NEXT,
203  .next_nodes = {
204  [MFIB_FORWARD_LOOKUP_NEXT_RPF] = "ip4-mfib-forward-rpf",
205  },
206 };
207 
211 {
212  return (mfib_forward_lookup (vm, node, frame, 0));
213 }
214 
216  .name = "ip6-mfib-forward-lookup",
217  .vector_size = sizeof (u32),
218 
219  .format_trace = format_mfib_forward_lookup_trace,
220 
221  .n_next_nodes = MFIB_FORWARD_LOOKUP_N_NEXT,
222  .next_nodes = {
223  [MFIB_FORWARD_LOOKUP_NEXT_RPF] = "ip6-mfib-forward-rpf",
224  },
225 };
226 
227 
233 
238 
239 static u8 *
240 format_mfib_forward_rpf_trace (u8 * s, va_list * args)
241 {
242  CLIB_UNUSED (vlib_main_t * vm) = va_arg (*args, vlib_main_t *);
243  CLIB_UNUSED (vlib_node_t * node) = va_arg (*args, vlib_node_t *);
244  mfib_forward_rpf_trace_t * t = va_arg (*args, mfib_forward_rpf_trace_t *);
245 
246  s = format (s, "entry %d", t->entry_index);
247  s = format (s, " itf %d", t->sw_if_index);
248  s = format (s, " flags %U", format_mfib_itf_flags, t->itf_flags);
249 
250  return s;
251 }
252 
253 static int
256  int is_v4)
257 {
258  /*
259  * Lookup the source of the IP packet in the
260  * FIB. return true if the entry is attached.
261  */
262  index_t lbi0;
263 
264  if (is_v4)
265  {
266  load_balance_t *lb0;
267  ip4_header_t *ip0;
268 
269  ip0 = vlib_buffer_get_current(b0);
270 
273  sw_if_index),
274  &ip0->src_address);
275  lb0 = load_balance_get(lbi0);
276 
277  return (FIB_ENTRY_FLAG_ATTACHED &
278  lb0->lb_fib_entry_flags);
279  }
280  else
281  {
282  ASSERT(0);
283  }
284  return (0);
285 }
286 
287 static void
289  const mfib_entry_t *mfe,
290  mfib_itf_t *mfi,
291  vlib_buffer_t *b0)
292 {
293  mfib_itf_flags_t old_flags;
294 
295  old_flags = clib_atomic_fetch_or(&mfi->mfi_flags,
297 
298  if (!(old_flags & MFIB_ITF_FLAG_SIGNAL_PRESENT))
299  {
300  /*
301  * we were the lucky ones to set the signal present flag
302  */
303  if (!(old_flags & MFIB_ITF_FLAG_DONT_PRESERVE))
304  {
305  /*
306  * preserve a copy of the packet for the control
307  * plane to examine.
308  * Only allow one preserved packet at at time, since
309  * when the signal present flag is cleared so is the
310  * preserved packet.
311  */
312  mfib_signal_push(mfe, mfi, b0);
313  }
314  else
315  {
316  /*
317  * The control plane just wants the signal, not the packet as well
318  */
319  mfib_signal_push(mfe, mfi, NULL);
320  }
321  }
322  /*
323  * else
324  * there is already a signal present on this interface that the
325  * control plane has not yet acknowledged
326  */
327 }
328 
333  int is_v4)
334 {
335  u32 n_left_from, n_left_to_next, * from, * to_next;
337  vlib_node_runtime_t *error_node;
338 
339  if (is_v4)
340  error_node = vlib_node_get_runtime (vm, ip4_input_node.index);
341  else
342  error_node = vlib_node_get_runtime (vm, ip6_input_node.index);
344  n_left_from = frame->n_vectors;
346 
347  while (n_left_from > 0)
348  {
350  to_next, n_left_to_next);
351 
352  while (n_left_from > 0 && n_left_to_next > 0)
353  {
354  fib_node_index_t mfei0;
355  const mfib_entry_t *mfe0;
356  mfib_itf_t *mfi0;
357  vlib_buffer_t * b0;
358  u32 pi0, next0;
359  mfib_itf_flags_t iflags0;
360  mfib_entry_flags_t eflags0;
361  u8 error0;
362 
363  pi0 = from[0];
364  to_next[0] = pi0;
365  from += 1;
366  to_next += 1;
367  n_left_to_next -= 1;
368  n_left_from -= 1;
369 
370  error0 = IP4_ERROR_NONE;
371  b0 = vlib_get_buffer (vm, pi0);
372  mfei0 = vnet_buffer (b0)->ip.adj_index[VLIB_TX];
373  mfe0 = mfib_entry_get(mfei0);
374  mfi0 = mfib_entry_get_itf(mfe0,
376 
377  /*
378  * throughout this function we are 'PREDICT' optimising
379  * for the case of throughput traffic that is not replicated
380  * to the host stack nor sets local flags
381  */
382 
383  /*
384  * If the mfib entry has a configured RPF-ID check that
385  * in preference to an interface based RPF
386  */
387  if (MFIB_RPF_ID_NONE != mfe0->mfe_rpf_id)
388  {
389  iflags0 = (mfe0->mfe_rpf_id == vnet_buffer(b0)->ip.rpf_id ?
392  }
393  else
394  {
395  if (PREDICT_TRUE(NULL != mfi0))
396  {
397  iflags0 = mfi0->mfi_flags;
398  }
399  else
400  {
401  iflags0 = MFIB_ITF_FLAG_NONE;
402  }
403  }
404  eflags0 = mfe0->mfe_flags;
405 
407  {
408  /*
409  * lookup the source in the unicast FIB - check it
410  * matches a connected.
411  */
413  b0,
415  is_v4))
416  {
417  mfib_forward_itf_signal(vm, mfe0, mfi0, b0);
418  }
419  }
420  if (PREDICT_FALSE((eflags0 & MFIB_ENTRY_FLAG_SIGNAL) ^
421  (iflags0 & MFIB_ITF_FLAG_NEGATE_SIGNAL)))
422  {
423  /*
424  * Entry signal XOR interface negate-signal
425  */
426  if (NULL != mfi0)
427  {
428  mfib_forward_itf_signal(vm, mfe0, mfi0, b0);
429  }
430  }
431 
432  if (PREDICT_TRUE((iflags0 & MFIB_ITF_FLAG_ACCEPT) ||
433  (eflags0 & MFIB_ENTRY_FLAG_ACCEPT_ALL_ITF)))
434  {
435  /*
436  * This interface is accepting packets for the matching entry
437  */
438  next0 = mfe0->mfe_rep.dpoi_next_node;
439 
440  vnet_buffer(b0)->ip.adj_index[VLIB_TX] =
441  mfe0->mfe_rep.dpoi_index;
442  }
443  else
444  {
446  error0 = IP4_ERROR_RPF_FAILURE;
447  }
448 
449  b0->error = error0 ? error_node->errors[error0] : 0;
450 
451  if (b0->flags & VLIB_BUFFER_IS_TRACED)
452  {
454 
455  t0 = vlib_add_trace (vm, node, b0, sizeof (*t0));
456  t0->entry_index = mfei0;
457  t0->itf_flags = iflags0;
458  if (NULL == mfi0)
459  {
460  t0->sw_if_index = ~0;
461  }
462  else
463  {
464  t0->sw_if_index = mfi0->mfi_sw_if_index;
465  }
466  }
468  to_next, n_left_to_next,
469  pi0, next0);
470  }
471 
472  vlib_put_next_frame(vm, node, next, n_left_to_next);
473  }
474 
475  return frame->n_vectors;
476 }
477 
481 {
482  return (mfib_forward_rpf(vm, node, frame, 1));
483 }
484 
485 
487  .name = "ip4-mfib-forward-rpf",
488  .vector_size = sizeof (u32),
489 
490  .format_trace = format_mfib_forward_rpf_trace,
491 
492  .n_next_nodes = MFIB_FORWARD_RPF_N_NEXT,
493  .next_nodes = {
494  [MFIB_FORWARD_RPF_NEXT_DROP] = "ip4-drop",
495  },
496 };
497 
501 {
502  return (mfib_forward_rpf(vm, node, frame, 0));
503 }
504 
505 
507  .name = "ip6-mfib-forward-rpf",
508  .vector_size = sizeof (u32),
509 
510  .format_trace = format_mfib_forward_rpf_trace,
511 
512  .n_next_nodes = MFIB_FORWARD_RPF_N_NEXT,
513  .next_nodes = {
514  [MFIB_FORWARD_RPF_NEXT_DROP] = "ip6-drop",
515  },
516 };
517 
ip4_mfib_forward_lookup_node
vlib_node_registration_t ip4_mfib_forward_lookup_node
(constructor) VLIB_REGISTER_NODE (ip4_mfib_forward_lookup_node)
Definition: mfib_forward.c:196
mfib_forward_rpf_trace_t_::entry_index
u32 entry_index
Definition: mfib_forward.c:229
dpo_id_t_::dpoi_next_node
u16 dpoi_next_node
The next VLIB node to follow.
Definition: dpo.h:186
im
vnet_interface_main_t * im
Definition: interface_output.c:395
dpo_id_t_::dpoi_index
index_t dpoi_index
the index of objects of that type
Definition: dpo.h:190
MFIB_FORWARD_LOOKUP_NEXT_RPF
@ MFIB_FORWARD_LOOKUP_NEXT_RPF
Definition: mfib_forward.c:113
frame
vlib_main_t vlib_node_runtime_t vlib_frame_t * frame
Definition: nat44_ei.c:3048
ip6_mfib_get
static ip6_mfib_t * ip6_mfib_get(u32 index)
Get the FIB at the given index.
Definition: ip6_mfib.h:101
mfib_forward_lookup_trace_t_::entry_index
u32 entry_index
Definition: mfib_forward.c:29
ip4_main
ip4_main_t ip4_main
Global ip4 main structure.
Definition: ip4_forward.c:1105
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
MFIB_ITF_FLAG_ACCEPT
@ MFIB_ITF_FLAG_ACCEPT
Definition: mfib_types.h:152
next
u16 * next
Definition: nat44_ei_out2in.c:718
node
vlib_main_t vlib_node_runtime_t * node
Definition: nat44_ei.c:3047
FIB_ENTRY_FLAG_ATTACHED
@ FIB_ENTRY_FLAG_ATTACHED
Definition: fib_entry.h:114
mfib_entry.h
MFIB_ITF_FLAG_NONE
@ MFIB_ITF_FLAG_NONE
Definition: mfib_types.h:150
ip4_fib_table_get_index_for_sw_if_index
u32 ip4_fib_table_get_index_for_sw_if_index(u32 sw_if_index)
Definition: pnat_test_stubs.h:21
mfib_forward_lookup
static uword mfib_forward_lookup(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame, int is_v4)
Definition: mfib_forward.c:118
mfib_itf_t_::mfi_flags
mfib_itf_flags_t mfi_flags
Forwarding Flags on the entry - checked in the data-path.
Definition: mfib_itf.h:35
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
mfib_entry_flags_t
enum mfib_entry_flags_t_ mfib_entry_flags_t
mfib_itf_t_::mfi_sw_if_index
u32 mfi_sw_if_index
The SW IF index that this MFIB interface represents.
Definition: mfib_itf.h:40
vlib_frame_t
Definition: node.h:372
ip4_mfib.h
format_mfib_forward_rpf_trace
static u8 * format_mfib_forward_rpf_trace(u8 *s, va_list *args)
Definition: mfib_forward.c:240
ip4_header_t
Definition: ip4_packet.h:87
replicate_dpo.h
mfib_entry_t_::mfe_rep
dpo_id_t mfe_rep
The DPO used for forwarding; replicate, drop, etc.
Definition: mfib_entry.h:72
clib_atomic_fetch_or
#define clib_atomic_fetch_or(a, b)
Definition: atomics.h:27
ip6_mfib.h
mfib_forward_lookup_next_t
enum mfib_forward_lookup_next_t_ mfib_forward_lookup_next_t
vec_elt
#define vec_elt(v, i)
Get vector value at index i.
Definition: vec_bootstrap.h:210
mfib_forward_itf_signal
static void mfib_forward_itf_signal(vlib_main_t *vm, const mfib_entry_t *mfe, mfib_itf_t *mfi, vlib_buffer_t *b0)
Definition: mfib_forward.c:288
mfib_forward_lookup_trace_t_
Definition: mfib_forward.c:28
ip4_main_t::fib_index_by_sw_if_index
u32 * fib_index_by_sw_if_index
Table index indexed by software interface.
Definition: ip4.h:123
vlib_node_runtime_t::errors
vlib_error_t * errors
Vector of errors for this node.
Definition: node.h:460
mfib_entry_get
static mfib_entry_t * mfib_entry_get(fib_node_index_t index)
Definition: mfib_entry.h:200
vlib_buffer_t::error
vlib_error_t error
Error code for buffers to be enqueued to error handler.
Definition: buffer.h:145
mfib_signal_push
void mfib_signal_push(const mfib_entry_t *mfe, mfib_itf_t *mfi, vlib_buffer_t *b0)
Definition: mfib_signal.c:141
VLIB_NODE_FN
#define VLIB_NODE_FN(node)
Definition: node.h:202
ip6_mfib_forward_rpf_node
vlib_node_registration_t ip6_mfib_forward_rpf_node
(constructor) VLIB_REGISTER_NODE (ip6_mfib_forward_rpf_node)
Definition: mfib_forward.c:506
CLIB_UNUSED
#define CLIB_UNUSED(x)
Definition: clib.h:90
vnet_buffer
#define vnet_buffer(b)
Definition: buffer.h:437
MFIB_ENTRY_FLAG_SIGNAL
@ MFIB_ENTRY_FLAG_SIGNAL
Definition: mfib_types.h:108
VLIB_NODE_FLAG_TRACE
#define VLIB_NODE_FLAG_TRACE
Definition: node.h:291
PREDICT_FALSE
#define PREDICT_FALSE(x)
Definition: clib.h:124
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
index_t
u32 index_t
A Data-Path Object is an object that represents actions that are applied to packets are they are swit...
Definition: dpo.h:43
MFIB_FORWARD_LOOKUP_N_NEXT
@ MFIB_FORWARD_LOOKUP_N_NEXT
Definition: mfib_forward.c:114
load_balance_t_::lb_fib_entry_flags
fib_entry_flag_t lb_fib_entry_flags
Flags from the load-balance's associated fib_entry_t.
Definition: load_balance.h:138
vlib_prefetch_buffer_with_index
#define vlib_prefetch_buffer_with_index(vm, bi, type)
Prefetch buffer metadata by buffer index The first 64 bytes of buffer contains most header informatio...
Definition: buffer_funcs.h:507
ip4_mfib_get
static ip4_mfib_t * ip4_mfib_get(u32 index)
Get the FIB at the given index.
Definition: ip4_mfib.h:69
fib_node_index_t
u32 fib_node_index_t
A typedef of a node index.
Definition: fib_types.h:29
mfib_entry_t_::mfe_flags
mfib_entry_flags_t mfe_flags
Route flags.
Definition: mfib_entry.h:77
mfib_forward_lookup_next_t_
mfib_forward_lookup_next_t_
Definition: mfib_forward.c:112
uword
u64 uword
Definition: types.h:112
format_mfib_itf_flags
u8 * format_mfib_itf_flags(u8 *s, va_list *args)
Definition: mfib_types.c:181
format_mfib_forward_lookup_trace
static u8 * format_mfib_forward_lookup_trace(u8 *s, va_list *args)
Definition: mfib_forward.c:34
ip6_header_t::dst_address
ip6_address_t dst_address
Definition: ip6_packet.h:310
mfib_itf_flags_t
enum mfib_itf_flags_t_ mfib_itf_flags_t
mfib_forward_lookup_trace
static void mfib_forward_lookup_trace(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
Definition: mfib_forward.c:46
ip6_main_t::fib_index_by_sw_if_index
u32 * fib_index_by_sw_if_index
Definition: ip6.h:127
ip6_mfib_forward_lookup_node
vlib_node_registration_t ip6_mfib_forward_lookup_node
(constructor) VLIB_REGISTER_NODE (ip6_mfib_forward_lookup_node)
Definition: mfib_forward.c:215
MFIB_ENTRY_FLAG_ACCEPT_ALL_ITF
@ MFIB_ENTRY_FLAG_ACCEPT_ALL_ITF
Definition: mfib_types.h:111
vlib_node_registration_t
struct _vlib_node_registration vlib_node_registration_t
MFIB_FORWARD_RPF_NEXT_DROP
@ MFIB_FORWARD_RPF_NEXT_DROP
Definition: mfib_forward.c:235
ip4_header_t::dst_address
ip4_address_t dst_address
Definition: ip4_packet.h:125
mfib_forward_rpf_next_t
enum mfib_forward_rpf_next_t_ mfib_forward_rpf_next_t
ip6_main
ip6_main_t ip6_main
Definition: ip6_forward.c:2787
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
ip6_input_node
vlib_node_registration_t ip6_input_node
(constructor) VLIB_REGISTER_NODE (ip6_input_node)
Definition: ip6_input.c:230
always_inline
#define always_inline
Definition: rdma_mlx5dv.h:23
ip4_header_t::src_address
ip4_address_t src_address
Definition: ip4_packet.h:125
MFIB_ITF_FLAG_DONT_PRESERVE
@ MFIB_ITF_FLAG_DONT_PRESERVE
Definition: mfib_types.h:155
mfib_forward_connected_check
static int mfib_forward_connected_check(vlib_buffer_t *b0, u32 sw_if_index, int is_v4)
Definition: mfib_forward.c:254
ip4_main_t::mfib_index_by_sw_if_index
u32 * mfib_index_by_sw_if_index
Table index indexed by software interface.
Definition: ip4.h:126
mfib_itf.h
format
description fragment has unexpected format
Definition: map.api:433
ASSERT
#define ASSERT(truth)
Definition: error_bootstrap.h:69
mfib_forward_lookup_trace_t_::fib_index
u32 fib_index
Definition: mfib_forward.c:30
vlib_put_next_frame
vlib_put_next_frame(vm, node, next_index, 0)
ip6_main_t::mfib_index_by_sw_if_index
u32 * mfib_index_by_sw_if_index
Table index indexed by software interface.
Definition: ip6.h:130
u32
unsigned int u32
Definition: types.h:88
MFIB_RPF_ID_NONE
#define MFIB_RPF_ID_NONE
Definition: fib_types.h:423
mfib_forward_lookup_trace_t
struct mfib_forward_lookup_trace_t_ mfib_forward_lookup_trace_t
load_balance_get
static load_balance_t * load_balance_get(index_t lbi)
Definition: load_balance.h:220
n_left
u32 n_left
Definition: interface_output.c:1078
ip4_mfib_table_lookup
fib_node_index_t ip4_mfib_table_lookup(const ip4_mfib_t *mfib, const ip4_address_t *src, const ip4_address_t *grp, u32 len)
The IPv4 Multicast-FIB.
Definition: ip4_mfib.c:241
mfib_entry_t_
An entry in a FIB table.
Definition: mfib_entry.h:32
MFIB_ITF_FLAG_SIGNAL_PRESENT
@ MFIB_ITF_FLAG_SIGNAL_PRESENT
Definition: mfib_types.h:154
vlib_node_get_runtime
static vlib_node_runtime_t * vlib_node_get_runtime(vlib_main_t *vm, u32 node_index)
Get node runtime by node index.
Definition: node_funcs.h:116
ip6_header_t
Definition: ip6_packet.h:294
ip6_mfib_table_fwd_lookup
fib_node_index_t ip6_mfib_table_fwd_lookup(const ip6_mfib_t *mfib, const ip6_address_t *src, const ip6_address_t *grp)
Definition: ip6_mfib.c:352
ip4_fib.h
ip6_fib.h
mfib_itf_t_
An interface associated with a particular MFIB entry.
Definition: mfib_itf.h:25
ip4.h
ip6_header_t::src_address
ip6_address_t src_address
Definition: ip6_packet.h:310
ip_lookup_set_buffer_fib_index
static void ip_lookup_set_buffer_fib_index(u32 *fib_index_by_sw_if_index, vlib_buffer_t *b)
Definition: lookup.h:168
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
u8
unsigned char u8
Definition: types.h:56
mfib_signal.h
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
mfib_entry_get_itf
static mfib_itf_t * mfib_entry_get_itf(const mfib_entry_t *mfe, u32 sw_if_index)
Definition: mfib_entry.h:228
mfib_forward_rpf_trace_t_
Definition: mfib_forward.c:228
mfib_forward_rpf
static uword mfib_forward_rpf(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame, int is_v4)
Definition: mfib_forward.c:330
ip4_input_node
vlib_node_registration_t ip4_input_node
Global ip4 input node.
Definition: ip4_input.c:385
ip4_fib_forwarding_lookup
static index_t ip4_fib_forwarding_lookup(u32 fib_index, const ip4_address_t *addr)
Definition: ip4_fib.h:160
load_balance_t_
The FIB DPO provieds;.
Definition: load_balance.h:106
mfib_forward_rpf_trace_t_::itf_flags
mfib_itf_flags_t itf_flags
Definition: mfib_forward.c:231
vnet.h
ip4_mfib_forward_rpf_node
vlib_node_registration_t ip4_mfib_forward_rpf_node
(constructor) VLIB_REGISTER_NODE (ip4_mfib_forward_rpf_node)
Definition: mfib_forward.c:486
vlib_node_runtime_t
Definition: node.h:454
MFIB_FORWARD_RPF_N_NEXT
@ MFIB_FORWARD_RPF_N_NEXT
Definition: mfib_forward.c:236
mfib_forward_rpf_trace_t
struct mfib_forward_rpf_trace_t_ mfib_forward_rpf_trace_t
from
from
Definition: nat44_ei_hairpinning.c:415
PREDICT_TRUE
#define PREDICT_TRUE(x)
Definition: clib.h:125
ip4_main_t
IPv4 main type.
Definition: ip4.h:107
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
VLIB_TX
@ VLIB_TX
Definition: defs.h:47
n_left_from
n_left_from
Definition: nat44_ei_hairpinning.c:416
MFIB_ENTRY_FLAG_CONNECTED
@ MFIB_ENTRY_FLAG_CONNECTED
Definition: mfib_types.h:110
mfib_forward_rpf_trace_t_::sw_if_index
u32 sw_if_index
Definition: mfib_forward.c:230
mfib_entry_t_::mfe_rpf_id
fib_rpf_id_t mfe_rpf_id
RPF-ID used when the packets ingress not from an interface.
Definition: mfib_entry.h:82
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
mfib_forward_rpf_next_t_
mfib_forward_rpf_next_t_
Definition: mfib_forward.c:234
MFIB_ITF_FLAG_NEGATE_SIGNAL
@ MFIB_ITF_FLAG_NEGATE_SIGNAL
Definition: mfib_types.h:151
vlib_buffer_t
VLIB buffer representation.
Definition: buffer.h:111
VLIB_REGISTER_NODE
#define VLIB_REGISTER_NODE(x,...)
Definition: node.h:169