|
FD.io VPP
v21.06-3-gbb25fbf28
Vector Packet Processing
|
Go to the documentation of this file.
53 pfx.
fp_addr.ip6.as_u64[0] = clib_host_to_net_u64 (0xFE80000000000000ULL);
184 const ip6_address_t *
addr,
197 fib = ((
u64)((fib_index))<<32);
204 while (i < n_p && table->prefix_lengths_in_search_order[
i] >
len)
214 ASSERT(dst_address_length >= 0 && dst_address_length <= 128);
218 kv.
key[2] = fib | dst_address_length;
230 const ip6_address_t *
addr,
241 fib = ((
u64)((fib_index))<<32);
257 u8 *old, *prefix_lengths_in_search_order = NULL;
269 int dst_address_length = 128 -
i;
270 vec_add1(prefix_lengths_in_search_order, dst_address_length);
284 const ip6_address_t *
addr,
294 fib = ((
u64)((fib_index))<<32);
300 clib_bihash_add_del_24_8(&table->
ip6_hash, &kv, 0);
315 const ip6_address_t *
addr,
326 fib = ((
u64)((fib_index))<<32);
331 kv.
value = fib_entry_index;
333 clib_bihash_add_del_24_8(&table->
ip6_hash, &kv, 1);
346 const ip6_address_t *
dst)
368 const ip6_address_t *
addr,
379 fib = ((
u64)((fib_index))<<32);
386 clib_bihash_add_del_24_8(&table->
ip6_hash, &kv, 1);
399 const ip6_address_t *
addr,
410 fib = ((
u64)((fib_index))<<32);
417 clib_bihash_add_del_24_8(&table->
ip6_hash, &kv, 0);
450 if ((kvp->
key[2] >> 32) ==
ctx->i6w_fib_index)
452 key.as_u64[0] = kvp->
key[0];
453 key.as_u64[1] = kvp->
key[1];
457 &
ctx->i6w_root.fp_addr.ip6,
458 ctx->i6w_root.fp_len))
487 .fp_len = kvp->
key[2] & 0xffffffff,
510 .i6w_fib_index = fib_index,
516 .i6w_sub_trees = NULL,
519 clib_bihash_foreach_key_value_pair_24_8(
534 .i6w_fib_index = fib_index,
540 clib_bihash_foreach_key_value_pair_24_8(
607 s =
format(s,
"%=30s %=6d %=12ld\n",
616 u64 count_by_prefix_length[129];
627 return (BIHASH_WALK_CONTINUE);
633 return (BIHASH_WALK_CONTINUE);
645 int verbose, matching;
646 ip6_address_t matching_address;
662 else if (
unformat (input,
"detail") ||
666 else if (
unformat (input,
"hash") ||
680 else if (
unformat (input,
"index %d", &fib_index))
707 if (fib_index != ~0 && fib_index != (
int)fib->
index)
712 s =
format(s,
"%U, fib_index:%d, flow hash:[%U] epoch:%d flags:%U locks:[",
723 if (0 != fib_table->
ft_locks[source])
745 clib_bihash_foreach_key_value_pair_24_8
866 .path =
"show ip6 fib",
867 .short_help =
"show ip6 fib [summary] [table <table-id>] [index <fib-id>] [<ip6-addr>[/<width>]] [detail]",
880 if (
unformat (input,
"hash-buckets %d", &nbuckets))
882 else if (
unformat (input,
"heap-size %U",
910 "ip6 FIB fwding table",
913 "ip6 FIB non-fwding table",
vnet_interface_main_t * im
void ip6_fib_table_fwding_dpo_remove(u32 fib_index, const ip6_address_t *addr, u32 len, const dpo_id_t *dpo)
fib_table_walk_fn_t i6w_fn
index_t dpoi_index
the index of objects of that type
fib_node_index_t fib_table_entry_special_dpo_add(u32 fib_index, const fib_prefix_t *prefix, fib_source_t source, fib_entry_flag_t flags, const dpo_id_t *dpo)
Add a 'special' entry to the FIB that links to the DPO passed A special entry is an entry that the FI...
u32 ip6_fib_table_find_or_create_and_lock(u32 table_id, fib_source_t src)
Get or create an IPv6 fib.
#define IP6_FIB_DEFAULT_HASH_NUM_BUCKETS
Context when walking the IPv6 table.
void fib_table_entry_delete(u32 fib_index, const fib_prefix_t *prefix, fib_source_t source)
Delete a FIB entry.
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
int fib_entry_cmp_for_sort(void *i1, void *i2)
#define FIB_ENTRY_FORMAT_DETAIL
u32 ft_epoch
Epoch - number of resyncs performed.
fib_node_index_t ip6_fib_table_lookup_exact_match(u32 fib_index, const ip6_address_t *addr, u32 len)
#define FIB_ENTRY_FORMAT_DETAIL2
@ IP6_FIB_TABLE_NON_FWDING
The table that stores ALL routes learned by the DP.
const dpo_id_t * ip6_ll_dpo_get(void)
The IP6 link-local DPO represents the lookup of a packet in the link-local IPv6 FIB.
u64 count_by_prefix_length[129]
#define pool_get_aligned(P, E, A)
Allocate an object E from a pool P with alignment A.
void fib_table_assert_empty(const fib_table_t *fib_table)
Debug function.
u8 * format_ip_flow_hash_config(u8 *s, va_list *args)
u8 * format_fib_table_name(u8 *s, va_list *ap)
Format the description/name of the table.
#define clib_error_return(e, args...)
#define FIB_NODE_INDEX_INVALID
static void ip6_fib_table_show_one(ip6_fib_t *fib, vlib_main_t *vm, ip6_address_t *address, u32 mask_len, int detail)
void vlib_worker_wait_one_loop(void)
Wait until each of the workers has been once around the track.
u16 fp_len
The mask length.
#define pool_put(P, E)
Free an object E in pool P.
vlib_main_t * vm
X-connect all packets from the HOST to the PHY.
static fib_table_walk_rc_t ip6_fib_table_show_walk(fib_node_index_t fib_entry_index, void *arg)
void ip6_fib_table_walk(u32 fib_index, fib_table_walk_fn_t fn, void *arg)
Walk all entries in a FIB table N.B: This is NOT safe to deletes.
static int ip6_fib_walk_cb(clib_bihash_kv_24_8_t *kvp, void *arg)
#define pool_put_index(p, i)
Free pool element with given index.
enum fib_table_flags_t_ fib_table_flags_t
u32 ip6_fib_table_fwding_lookup_with_if_index(ip6_main_t *im, u32 sw_if_index, const ip6_address_t *dst)
#define VLIB_EARLY_CONFIG_FUNCTION(x, n,...)
#define IP6_FIB_NUM_TABLES
static uword max_log2(uword x)
void ip6_fib_table_fwding_dpo_update(u32 fib_index, const ip6_address_t *addr, u32 len, const dpo_id_t *dpo)
#define vec_elt(v, i)
Get vector value at index i.
#define hash_set(h, key, value)
static uword ip6_destination_matches_route(const ip6_main_t *im, const ip6_address_t *key, const ip6_address_t *dest, uword dest_length)
uword * non_empty_dst_address_length_bitmap
u8 * format_ip6_fib_table_memory(u8 *s, va_list *args)
A protocol Independent FIB table.
void fib_table_entry_special_remove(u32 fib_index, const fib_prefix_t *prefix, fib_source_t source)
Remove a 'special' entry from the FIB.
#define pool_foreach(VAR, POOL)
Iterate through pool.
static clib_error_t * ip6_fib_init(vlib_main_t *vm)
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
#define vec_add1(V, E)
Add 1 element to end of vector (unspecified alignment).
fib_node_index_t ft_index
Index into FIB vector.
i32 dst_address_length_refcounts[129]
u32 ft_table_id
Table ID (hash key) for this FIB.
void ip6_fib_table_entry_insert(u32 fib_index, const ip6_address_t *addr, u32 len, fib_node_index_t fib_entry_index)
u32 ft_total_route_counts
Total route counters.
u8 * ft_desc
Table description.
u32 * ft_locks
per-source number of locks on the table
u8 * format_fib_source(u8 *s, va_list *args)
#define IP_FLOW_HASH_DEFAULT
Default: 5-tuple + flowlabel without the "reverse" bit.
u32 fib_node_index_t
A typedef of a node index.
#define vec_foreach_index(var, v)
Iterate over vector indices.
static clib_error_t * ip6_show_fib(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
sll srl srl sll sra u16x4 i
#define pool_get(P, E)
Allocate an object E from a pool P (unspecified alignment).
fib_table_flags_t ft_flags
Table flags.
u32 * fib_index_by_sw_if_index
manual_print typedef address
struct fib_table_t_ * fibs
#define VLIB_CLI_COMMAND(x,...)
ip6_fib_table_instance_t ip6_fib_table[IP6_FIB_NUM_TABLES]
The two FIB tables; fwding and non-fwding.
u32 ip6_fib_table_get_index_for_sw_if_index(u32 sw_if_index)
static uword * clib_bitmap_set(uword *ai, uword i, uword value)
Sets the ith bit of a bitmap to new_value Removes trailing zeros from the bitmap.
#define CLIB_CACHE_LINE_BYTES
struct ip6_fib_walk_ctx_t_ ip6_fib_walk_ctx_t
Context when walking the IPv6 table.
void vlib_cli_output(vlib_main_t *vm, char *fmt,...)
static u32 ip6_fib_table_fwding_lookup(u32 fib_index, const ip6_address_t *dst)
ip46_address_t fp_addr
The address type is not deriveable from the fp_addr member.
fib_table_walk_rc_t(* fib_table_walk_fn_t)(fib_node_index_t fei, void *ctx)
Call back function when walking entries in a FIB table.
@ FIB_TABLE_WALK_SUB_TREE_STOP
Do no traverse down this sub-tree.
static clib_error_t * ip6_config(vlib_main_t *vm, unformat_input_t *input)
#define vec_free(V)
Free vector's memory (no header).
u32 ip6_fib_table_create_and_lock(fib_source_t src, fib_table_flags_t flags, u8 *desc)
u32 ft_flow_hash_config
flow hash configuration
u32 ip6_fib_table_nbuckets
description fragment has unexpected format
@ FIB_SOURCE_DEFAULT_ROUTE
The default route source.
@ FIB_TABLE_WALK_STOP
Stop the walk completely.
fib_table_t * fib_table_get(fib_node_index_t index, fib_protocol_t proto)
Get a pointer to a FIB table.
void fib_table_lock(u32 fib_index, fib_protocol_t proto, fib_source_t source)
Release a reference counting lock on the table.
static void vnet_ip6_fib_init(u32 fib_index)
#define VLIB_INIT_FUNCTION(x)
enum fib_table_walk_rc_t_ fib_table_walk_rc_t
return code controlling how a table walk proceeds
ip6_address_t fib_masks[129]
static int count_routes_in_fib_at_prefix_length(clib_bihash_kv_24_8_t *kvp, void *arg)
#define vec_foreach(var, vec)
Vector iterator.
void ip6_fib_table_sub_tree_walk(u32 fib_index, const fib_prefix_t *root, fib_table_walk_fn_t fn, void *arg)
Walk all entries in a sub-tree of the FIB table N.B: This is NOT safe to deletes.
static uword pool_elts(void *v)
Number of active elements in a pool.
static void ip6_fib_table_show_all(ip6_fib_t *fib, vlib_main_t *vm)
#define FIB_ENTRY_FORMAT_BRIEF
fib_protocol_t fp_proto
protocol type
@ FIB_SOURCE_SPECIAL
Special sources.
#define hash_unset(h, key)
#define vec_sort_with_function(vec, f)
Sort a vector using the supplied element comparison function.
@ FIB_TABLE_WALK_CONTINUE
Continue on to the next entry.
clib_memset(h->entries, 0, sizeof(h->entries[0]) *entries)
@ IP6_FIB_TABLE_FWDING
This table stores the routes that are used to forward traffic.
u8 * format_fib_table_flags(u8 *s, va_list *args)
fib_node_index_t ip6_fib_table_lookup(u32 fib_index, const ip6_address_t *addr, u32 len)
clib_error_t *() vlib_init_function_t(struct vlib_main_t *vm)
fib_node_index_t * entries
#define IP6_FIB_DEFAULT_HASH_MEMORY_SIZE
The identity of a DPO is a combination of its type and its instance number/index of objects of that t...
enum fib_source_t_ fib_source_t
The different sources that can create a route.
A representation of a single IP6 table.
fib_protocol_t ft_proto
Which protocol this table serves.
#define clib_bitmap_foreach(i, ai)
Macro to iterate across set bits in a bitmap.
fib_node_index_t fib_table_entry_special_add(u32 fib_index, const fib_prefix_t *prefix, fib_source_t source, fib_entry_flag_t flags)
Add a 'special' entry to the FIB.
static u32 create_fib_with_table_id(u32 table_id, fib_source_t src, fib_table_flags_t flags, u8 *desc)
u32 * ft_src_route_counts
Per-source route counters.
vl_api_interface_index_t sw_if_index
struct ip6_fib_show_ctx_t_ ip6_fib_show_ctx_t
u8 * prefix_lengths_in_search_order
void ip6_fib_table_entry_remove(u32 fib_index, const ip6_address_t *addr, u32 len)
fib_prefix_t * i6w_sub_trees
Aggregate type for a prefix.
static void compute_prefix_lengths_in_search_order(ip6_fib_table_instance_t *table)
static vlib_cli_command_t ip6_show_fib_command
(constructor) VLIB_CLI_COMMAND (ip6_show_fib_command)
clib_bihash_24_8_t ip6_hash
void ip6_fib_table_destroy(u32 fib_index)
vl_api_wireguard_peer_flags_t flags
uword * fib_index_by_table_id
u8 * format_fib_entry(u8 *s, va_list *args)