aboutsummaryrefslogtreecommitdiffstats
path: root/vlib
diff options
context:
space:
mode:
authorNeale Ranns <nranns@cisco.com>2016-10-03 13:05:48 +0100
committerDamjan Marion <dmarion.lists@gmail.com>2016-10-07 21:32:24 +0000
commit3ee44040c66cbe47ff292ac7fb0badccbe2afe6d (patch)
treea52a4dd0750467845f237ee5e4e88aa95ea11bab /vlib
parent4a7e58bf481adb843707eec4a81213776a6d5212 (diff)
unicast RPF for FIB2.0
In a heirarchical FIB performing a unicast RPF check would require the traversal of the data-plane graph to seek out all the adjacency objects and then read those to find their interface. This is not efficient. Instead, for each path-list we construct a list of unique input interfaces and link this uRPF-list against the entry in the prefix table. In the data-plane the uRPF list can be retrieved from the load-balance lookup result and the RPF check is a simple and efficient walk across the minimal interface list. The uRPF-list is maintained as the routing heirarchy changes, in a similar way to the data-plane object graph. We also provide a knob to allow an arbitrary prefix to pass the loose check. Change-Id: Ie7c0ae3c4483ef467cfd5b136ee0315ff98ec15b Signed-off-by: Neale Ranns <nranns@cisco.com>
Diffstat (limited to 'vlib')
-rw-r--r--vlib/vlib/trace.c38
1 files changed, 22 insertions, 16 deletions
diff --git a/vlib/vlib/trace.c b/vlib/vlib/trace.c
index 5b64c55a01d..8fe3dacd806 100644
--- a/vlib/vlib/trace.c
+++ b/vlib/vlib/trace.c
@@ -367,35 +367,41 @@ static clib_error_t *
cli_add_trace_buffer (vlib_main_t * vm,
unformat_input_t * input, vlib_cli_command_t * cmd)
{
+ unformat_input_t _line_input, *line_input = &_line_input;
vlib_trace_main_t *tm;
vlib_trace_node_t *tn;
u32 node_index, add;
u8 verbose = 0;
- while (unformat_check_input (input) != (uword) UNFORMAT_END_OF_INPUT)
+ if (!unformat_user (input, unformat_line_input, line_input))
+ return 0;
+
+ while (unformat_check_input (line_input) != (uword) UNFORMAT_END_OF_INPUT)
{
- if (unformat
- (input, "%U %d", unformat_vlib_node, vm, &node_index, &add))
+ if (unformat (line_input, "%U %d",
+ unformat_vlib_node, vm, &node_index, &add))
;
- else if (unformat (input, "verbose"))
+ else if (unformat (line_input, "verbose"))
verbose = 1;
else
return clib_error_create ("expected NODE COUNT, got `%U'",
- format_unformat_error, input);
+ format_unformat_error, line_input);
}
+ /* *INDENT-OFF* */
foreach_vlib_main ((
- {
- void *oldheap;
- tm = &this_vlib_main->trace_main;
- tm->trace_active_hint = 1;
- tm->verbose = verbose;
- oldheap =
- clib_mem_set_heap (this_vlib_main->heap_base);
- vec_validate (tm->nodes, node_index);
- tn = tm->nodes + node_index;
- tn->limit += add; clib_mem_set_heap (oldheap);
- }));
+ {
+ void *oldheap;
+ tm = &this_vlib_main->trace_main;
+ tm->trace_active_hint = 1;
+ tm->verbose = verbose;
+ oldheap =
+ clib_mem_set_heap (this_vlib_main->heap_base);
+ vec_validate (tm->nodes, node_index);
+ tn = tm->nodes + node_index;
+ tn->limit += add; clib_mem_set_heap (oldheap);
+ }));
+ /* *INDENT-ON* */
return 0;
}