|
FD.io VPP
v21.10.1-2-g0a485f517
Vector Packet Processing
|
Go to the documentation of this file.
21 #include <vpp/app/version.h>
25 #define ILA_TABLE_DEFAULT_HASH_NUM_BUCKETS (64 * 1024)
26 #define ILA_TABLE_DEFAULT_HASH_MEMORY_SIZE (32<<20)
28 #define foreach_ila_error \
29 _(NONE, "valid ILA packets")
32 #define _(sym,str) ILA_ERROR_##sym,
39 #define _(sym,string) string,
58 .dir = ILA_DIR_ILA2SIR,
79 u64 v = clib_net_to_host_u64 (va_arg (*va,
u64));
81 return format (s,
"%04x:%04x:%04x:%04x",
82 v >> 48, (v >> 32) & 0xffff, (v >> 16) & 0xffff, v & 0xffff);
91 if (t == ILA_DIR_##i) \
95 return format (s,
"invalid_ila_direction");
107 case ILA_CSUM_MODE_##i: \
113 txt =
"invalid_ila_csum_mode";
124 if (t == ILA_TYPE_##i) \
125 return format(s, st);
128 return format (s,
"invalid_ila_type");
139 return format (s,
"%-15s%=40s%=40s%+16s%+18s%+11s",
"Type",
"SIR Address",
140 "ILA Address",
"Checksum Mode",
"Direction",
"Next DPO");
146 return format (s,
"%-15U%=40U%=40U%18U%11U%s",
156 return format (s,
"%-15U%=40U%=40U%18U%11U%U",
176 "ILA -> SIR adj index: %d entry index: %d initial_dst: %U",
186 if (unformat(input, s)) \
188 *result = ILA_DIR_##i; \
202 if (unformat(input, s)) \
204 *result = ILA_TYPE_##i; \
219 *result = ILA_CSUM_MODE_NO_ACTION;
222 if (
unformat (input,
"neutral-map"))
224 *result = ILA_CSUM_MODE_NEUTRAL_MAP;
227 if (
unformat (input,
"adjust-transport"))
229 *result = ILA_CSUM_MODE_ADJUST_TRANSPORT;
238 u64 *result = va_arg (*args,
u64 *);
241 if (!
unformat (input,
"%x:%x:%x:%x", &
a[0], &
a[1], &
a[2], &
a[3]))
244 if (
a[0] > 0xFFFF ||
a[1] > 0xFFFF ||
a[2] > 0xFFFF ||
a[3] > 0xFFFF)
247 *result = clib_host_to_net_u64 ((((
u64)
a[0]) << 48) |
248 (((
u64)
a[1]) << 32) |
249 (((
u64)
a[2]) << 16) | (((
u64)
a[3])));
277 ip6_address_t *sir_address0, *sir_address1;
291 pi0 = to_next[0] =
from[0];
292 pi1 = to_next[1] =
from[1];
327 sir_address0 = (ie0->
dir != ILA_DIR_SIR2ILA) ? &ie0->
sir_address : sir_address0;
328 sir_address1 = (ie1->
dir != ILA_DIR_SIR2ILA) ? &ie1->
sir_address : sir_address1;
329 ip60->
dst_address.as_u64[0] = sir_address0->as_u64[0];
330 ip60->
dst_address.as_u64[1] = sir_address0->as_u64[1];
331 ip61->
dst_address.as_u64[0] = sir_address1->as_u64[0];
332 ip61->
dst_address.as_u64[1] = sir_address1->as_u64[1];
338 n_left_to_next, pi0, pi1,
350 ip6_address_t *sir_address0;
352 pi0 = to_next[0] =
from[0];
373 sir_address0 = (ie0->
dir != ILA_DIR_SIR2ILA) ? &ie0->
sir_address : sir_address0;
374 ip60->
dst_address.as_u64[0] = sir_address0->as_u64[0];
375 ip60->
dst_address.as_u64[1] = sir_address0->as_u64[1];
385 return frame->n_vectors;
392 .name =
"ila-to-sir",
393 .vector_size =
sizeof (
u32),
424 return format (s,
"SIR -> ILA entry index: %d initial_dst: %U",
452 BVT (clib_bihash_kv) kv0, value0;
453 BVT (clib_bihash_kv) kv1, value1;
456 ip6_address_t *ila_address0, *ila_address1;
470 pi0 = to_next[0] =
from[0];
471 pi1 = to_next[1] =
from[1];
492 ie0 = &ilm->
entries[value0.value];
493 ila_address0 = (ie0->
dir != ILA_DIR_ILA2SIR) ? &ie0->
ila_address : ila_address0;
496 if ((BV (clib_bihash_search)
498 ie1 = &ilm->
entries[value1.value];
499 ila_address1 = (ie1->
dir != ILA_DIR_ILA2SIR) ? &ie1->
ila_address : ila_address1;
520 ip60->
dst_address.as_u64[0] = ila_address0->as_u64[0];
521 ip60->
dst_address.as_u64[1] = ila_address0->as_u64[1];
522 ip61->
dst_address.as_u64[0] = ila_address1->as_u64[0];
523 ip61->
dst_address.as_u64[1] = ila_address1->as_u64[1];
529 n_left_to_next, pi0, pi1, next0,
540 BVT (clib_bihash_kv) kv0, value0;
542 ip6_address_t *ila_address0;
544 pi0 = to_next[0] =
from[0];
560 ie0 = &ilm->
entries[value0.value];
561 ila_address0 = (ie0->
dir != ILA_DIR_ILA2SIR) ? &ie0->
ila_address : ila_address0;
574 ip60->
dst_address.as_u64[0] = ila_address0->as_u64[0];
575 ip60->
dst_address.as_u64[1] = ila_address0->as_u64[1];
580 n_left_to_next, pi0, next0);
585 return frame->n_vectors;
592 .vector_size =
sizeof (
u32),
607 .arc_name =
"ip6-unicast",
608 .node_name =
"sir-to-ila",
633 if (args->
type == ILA_TYPE_IID || args->
type == ILA_TYPE_LUID)
637 clib_warning (
"Incorrect SIR address (ILA type mismatch %d %d)",
643 clib_warning (
"Checksum bit should not be set in SIR address");
647 else if (args->
type == ILA_TYPE_VNIDM)
652 clib_warning (
"SIR multicast address must start with fff");
659 clib_warning (
"SIR multicast address must start with fff");
704 if (e->
csum_mode == ILA_CSUM_MODE_NEUTRAL_MAP)
708 for (
i = 0;
i < 4;
i++)
831 .version = VPP_BUILD_VER,
832 .description =
"Identifier Locator Addressing (ILA) for IPv6",
842 return format(s,
"ILA: idx:%d sir:%U",
938 "ila id to entry index table",
961 args.
type = ILA_TYPE_IID;
962 args.
csum_mode = ILA_CSUM_MODE_NO_ACTION;
964 args.
dir = ILA_DIR_BIDIR;
994 else if (
unformat (line_input,
"del"))
1024 .path =
"ila entry",
1025 .short_help =
"ila entry [type <type>] [sir-address <address>] [locator <locator>] [vnid <hex-vnid>]"
1026 " [adj-index <adj-index>] [next-hop <next-hop>] [direction (bidir|sir2ila|ila2sir)]"
1027 " [csum-mode (no-action|neutral-map|transport-adjust)] [del]",
1058 .path =
"ila interface",
1059 .short_help =
"ila interface <interface-name> [disable]",
1083 .path =
"show ila entries",
1084 .short_help =
"show ila entries",
static fib_node_t * ila_fib_node_get_node(fib_node_index_t index)
u8 * format_ila_type(u8 *s, va_list *args)
static ila_entry_t ila_sir2ila_default_entry
u16 dpoi_next_node
The next VLIB node to follow.
dpo_id_t ila_dpo
The next DPO in the graph to follow.
dpo_type_t dpo_register_new_type(const dpo_vft_t *vft, const char *const *const *nodes)
Create and register a new DPO type.
index_t dpoi_index
the index of objects of that type
#define DPO_INVALID
An initialiser for DPOs declared on the stack.
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...
#define vlib_prefetch_buffer_header(b, type)
Prefetch buffer metadata.
vlib_main_t vlib_node_runtime_t vlib_frame_t * frame
clib_error_t * ila_init(vlib_main_t *vm)
u8 * format_ila_sir2ila_trace(u8 *s, va_list *args)
enum fib_node_back_walk_rc_t_ fib_node_back_walk_rc_t
Return code from a back walk function.
static u8 * format_csum_mode(u8 *s, va_list *va)
nat44_ei_hairpin_src_next_t next_index
static dpo_type_t ila_dpo_type
Dynamically registered DPO Type for ILA.
static vlib_buffer_t * vlib_get_buffer(vlib_main_t *vm, u32 buffer_index)
Translate buffer index into buffer pointer.
static clib_error_t * ila_entry_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
ila_sir2ila_next_t
INDENT-ON
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
vlib_main_t vlib_node_runtime_t * node
static uword unformat_ila_csum_mode(unformat_input_t *input, va_list *args)
static clib_error_t * ila_show_entries_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
A FIB graph nodes virtual function table.
#define clib_error_return(e, args...)
static uword unformat_ila_direction(unformat_input_t *input, va_list *args)
#define FIB_NODE_INDEX_INVALID
ip6_address_t initial_dst
#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.
#define foreach_ila_error
@ FIB_ENTRY_FLAG_EXCLUSIVE
u8 * format_half_ip6_address(u8 *s, va_list *va)
enum fib_node_type_t_ fib_node_type_t
The types of nodes in a FIB graph.
static vlib_cli_command_t ila_show_entries_command
(constructor) VLIB_CLI_COMMAND (ila_show_entries_command)
u8 * format_ila_direction(u8 *s, va_list *args)
int ila_add_del_entry(ila_add_del_entry_args_t *args)
static vlib_node_registration_t ila_sir2ila_node
INDENT-OFF
u64 lookup_table_nbuckets
static uword unformat_ila_type(unformat_input_t *input, va_list *args)
ila_csum_mode_t csum_mode
static uword max_log2(uword x)
const static char *const ila_ip6_nodes[]
#define CLIB_PREFETCH(addr, size, type)
#define STRUCT_OFFSET_OF(t, f)
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 ila_entry_t * ila_entry_from_fib_node(fib_node_t *node)
u32 fib_entry_child_add(fib_node_index_t fib_entry_index, fib_node_type_t child_type, fib_node_index_t child_index)
ip6_address_t sir_address
void clib_bihash_init(clib_bihash *h, char *name, u32 nbuckets, uword memory_size)
initialize a bounded index extensible hash table
void dpo_stack(dpo_type_t child_type, dpo_proto_t child_proto, dpo_id_t *dpo, const dpo_id_t *parent)
Stack one DPO object on another, and thus establish a child-parent relationship.
const dpo_id_t * fib_entry_contribute_ip_forwarding(fib_node_index_t fib_entry_index)
static vlib_cli_command_t ila_interface_command
(constructor) VLIB_CLI_COMMAND (ila_interface_command)
vnet_main_t * vnet_get_main(void)
VNET_FEATURE_INIT(ila_sir2ila, static)
INDENT-ON
u8 * format_ila_dpo(u8 *s, va_list *va)
static fib_node_type_t ila_fib_node_type
Dynamically registered FIB node type for ILA.
static_always_inline void vnet_feature_next(u32 *next0, vlib_buffer_t *b0)
static void * vlib_frame_vector_args(vlib_frame_t *f)
Get pointer to frame vector data.
static uword unformat_half_ip6_address(unformat_input_t *input, va_list *args)
const static dpo_vft_t ila_vft
u32 index_t
A Data-Path Object is an object that represents actions that are applied to packets are they are swit...
static fib_node_back_walk_rc_t ila_fib_node_back_walk_notify(fib_node_t *node, fib_node_back_walk_ctx_t *ctx)
Callback function invoked when the forwarding changes for the ILA next-hop.
u32 fib_node_index_t
A typedef of a node index.
BVT(clib_bihash)
The table of adjacencies indexed by the rewrite string.
enum dpo_type_t_ dpo_type_t
Common types of data-path objects New types can be dynamically added using dpo_register_new_type()
ip6_address_t sir_address
static fib_source_t ila_fib_src
FIB source for adding entries.
ip6_address_t ila_address
#define pool_get(P, E)
Allocate an object E from a pool P (unspecified alignment).
#define VLIB_CLI_COMMAND(x,...)
dpo_lock_fn_t dv_lock
A reference counting lock function.
static vlib_node_registration_t ila_ila2sir_node
INDENT-OFF
static vlib_cli_command_t ila_entry_command
(constructor) VLIB_CLI_COMMAND (ila_entry_command)
struct _vlib_node_registration vlib_node_registration_t
@ FIB_NODE_BACK_WALK_CONTINUE
void vlib_cli_output(vlib_main_t *vm, char *fmt,...)
fib_source_t fib_source_allocate(const char *name, fib_source_priority_t prio, fib_source_behaviour_t bh)
ip46_address_t fp_addr
The address type is not deriveable from the fp_addr member.
u8 * format_dpo_id(u8 *s, va_list *args)
Format a DPO_id_t oject.
#define FIB_SOURCE_PRIORITY_HI
Some priority values that plugins might use when they are not to concerned where in the list they'll ...
int ila_interface(u32 sw_if_index, u8 disable)
static ip_csum_t ip_csum_sub_even(ip_csum_t c, ip_csum_t x)
const static char *const *const ila_nodes[DPO_PROTO_NUM]
#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.
fib_node_t ila_fib_node
Fib Node base class.
u32 next_hop_child_index
The child index on the FIB entry.
unformat_function_t unformat_vnet_sw_interface
description fragment has unexpected format
vlib_put_next_frame(vm, node, next_index, 0)
#define VLIB_INIT_FUNCTION(x)
clib_bihash_24_8_t id_to_entry_table
static char * ila_error_strings[]
#define ILA_TABLE_DEFAULT_HASH_MEMORY_SIZE
int clib_bihash_add_del(clib_bihash *h, clib_bihash_kv *add_v, int is_add)
Add or delete a (key,value) pair from a bi-hash table.
static void ila_dpo_unlock(dpo_id_t *dpo)
no-op unlock function.
static const fib_node_vft_t ila_fib_node_vft
int 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)
static u8 * format_ila_entry(u8 *s, va_list *va)
An node in the FIB graph.
static void ila_dpo_lock(dpo_id_t *dpo)
no-op lock function.
A virtual function table regisitered for a DPO type.
void * vlib_add_trace(vlib_main_t *vm, vlib_node_runtime_t *r, vlib_buffer_t *b, u32 n_data_bytes)
#define VNET_FEATURES(...)
static void * vlib_buffer_get_current(vlib_buffer_t *b)
Get pointer to current data to process.
fib_node_index_t next_hop_fib_entry_index
The FIB entry index for the next-hop.
clib_error_t *() vlib_init_function_t(struct vlib_main_t *vm)
@ FIB_SOURCE_BH_SIMPLE
add paths without path extensions
Context passed between object during a back walk.
@ FIB_SOURCE_RR
Recursive resolution source.
#define clib_warning(format, args...)
static void ila_entry_stack(ila_entry_t *ie)
INDENT-ON
static uword ila_ila2sir(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
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.
static ila_main_t ila_main
static void ila_fib_node_last_lock_gone(fib_node_t *node)
no-op unlock function.
void fib_table_entry_delete_index(fib_node_index_t fib_entry_index, fib_source_t source)
Delete a FIB entry.
#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.
ip6_address_t initial_dst
static uword ip6_address_is_zero(const ip6_address_t *a)
static uword ila_sir2ila(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
void dpo_set(dpo_id_t *dpo, dpo_type_t type, dpo_proto_t proto, index_t index)
Set/create a DPO ID The DPO will be locked.
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.
void fib_entry_child_remove(fib_node_index_t fib_entry_index, u32 sibling_index)
#define ila_csum_foreach_type
static ip_csum_t ip_csum_add_even(ip_csum_t c, ip_csum_t x)
vl_api_interface_index_t sw_if_index
#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).
ila_csum_mode_t csum_mode
static u16 ip_csum_fold(ip_csum_t c)
u8 * format_ila_ila2sir_trace(u8 *s, va_list *args)
void dpo_reset(dpo_id_t *dpo)
reset a DPO ID The DPO will be unlocked.
fib_node_type_t fib_node_register_new_type(const fib_node_vft_t *vft)
Create a new FIB node type and Register the function table for it.
Aggregate type for a prefix.
static clib_error_t * ila_interface_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
ip6_address_t next_hop_address
#define ILA_TABLE_DEFAULT_HASH_NUM_BUCKETS
u32 flags
buffer flags: VLIB_BUFFER_FREE_LIST_INDEX_MASK: bits used to store free list index,...
VLIB buffer representation.
#define VLIB_REGISTER_NODE(x,...)