|
FD.io VPP
v21.06-3-gbb25fbf28
Vector Packet Processing
|
Go to the documentation of this file.
27 int has_pot_option,
int has_ppc_option,
34 u8 trace_data_size = 0;
37 if (has_trace_option == 0 && has_pot_option == 0)
64 sizeof (ip4_vxlan_gpe_header_t));
72 sizeof (ip6_vxlan_gpe_header_t));
76 vxlan_gpe_ioam_hdr->
type = VXLAN_GPE_PROTOCOL_IOAM;
88 current += trace_data_size;
97 (current, &pot_data_size))
98 current += pot_data_size;
106 int has_pot_option,
int has_ppc_option,
127 int has_trace_option,
int has_pot_option,
128 int has_ppc_option,
u8 ipv6_set)
140 "vxlan_gpe_ioam_clear_rewrite returned %d",
149 int has_trace_option,
int has_pot_option,
150 int has_ppc_option,
u8 ipv6_set)
154 has_pot_option, has_ppc_option, ipv6_set);
163 "vxlan_gpe_ioam_set_rewrite returned %d",
171 u32 sw_if_index0,
u8 is_add)
177 sw_if_index0, is_add,
205 u8 is_ipv4,
u8 is_add)
209 u32 sw_if_index0 = ~0;
268 sw_if_index0 = adj0->rewrite_header.sw_if_index;
270 if (~0 == sw_if_index0)
279 "vxlan-gpe-transit-ioam",
280 sw_if_index0, is_add, 0
320 clib_memcpy (key4_copy, &key4,
sizeof (*key4_copy));
332 .fp_addr = {.ip4 = t1->
dst_addr.ip4,}
353 key4_copy = (
void *) (hp->
key);
392 u32 sw_if_index0 = 0;
393 for (sw_if_index0 = 0;
413 ip46_address_t local, remote;
422 vxlan4_gpe_tunnel_key_t key4;
423 vxlan6_gpe_tunnel_key_t key6;
453 else if (
unformat (input,
"disable"))
463 if (ipv4_set && ipv6_set)
466 && memcmp (&local.ip4, &remote.ip4,
467 sizeof (local.ip4)) == 0) || (ipv6_set
472 sizeof (local.ip6)) == 0))
478 key4.local = local.ip4.as_u32;
479 key4.remote = remote.ip4.as_u32;
480 key4.vni = clib_host_to_net_u32 (
vni << 8);
486 key6.local.as_u64[0] = local.ip6.as_u64[0];
487 key6.local.as_u64[1] = local.ip6.as_u64[1];
488 key6.remote.as_u64[0] = remote.ip6.as_u64[0];
489 key6.remote.as_u64[1] = remote.ip6.as_u64[1];
490 key6.vni = clib_host_to_net_u32 (
vni << 8);
513 .path =
"set vxlan-gpe-ioam",
514 .short_help =
"set vxlan-gpe-ioam vxlan <src-ip> <dst_ip> <vnid> [disable]",
523 int has_pot_option,
int has_ppc_option)
540 int has_pot_option,
int has_ppc_option)
567 int has_trace_option = 0;
568 int has_pot_option = 0;
569 int has_ppc_option = 0;
574 has_trace_option = 1;
577 else if (
unformat (input,
"ppc encap"))
579 else if (
unformat (input,
"ppc decap"))
581 else if (
unformat (input,
"ppc none"))
596 .path =
"set vxlan-gpe-ioam rewrite",
597 .short_help =
"set vxlan-gpe-ioam [trace] [pot] [ppc <encap|decap>]",
610 dst_addr, outer_fib_index, ipv4_set,
641 u32 outer_fib_index = 0;
656 else if (
unformat (input,
"outer-fib-index %d", &outer_fib_index))
660 else if (
unformat (input,
"disable"))
666 if (dst_addr_set == 0)
668 if (ipv4_set && ipv6_set)
686 .path =
"set vxlan-gpe-ioam-transit",
687 .short_help =
"set vxlan-gpe-ioam-transit dst-ip <dst_ip> [outer-fib-index <outer_fib_index>] [disable]",
701 .path =
"clear vxlan-gpe-ioam rewrite",
702 .short_help =
"clear vxlan-gpe-ioam rewrite",
vnet_interface_main_t * im
int vxlan_gpe_trace_profile_cleanup(void)
void vxlan_gpe_clear_output_feature_on_select_intfs(void)
u16 lb_n_buckets
number of buckets in the load-balance.
index_t dpoi_index
the index of objects of that type
void vxlan_gpe_clear_output_feature_on_all_intfs(vlib_main_t *vm)
static vlib_cli_command_t vxlan_gpe_clear_ioam_flags_cmd
(constructor) VLIB_CLI_COMMAND (vxlan_gpe_clear_ioam_flags_cmd)
enum fib_node_back_walk_rc_t_ fib_node_back_walk_rc_t
Return code from a back walk function.
#define clib_memcpy(d, s, n)
clib_error_t * clear_vxlan_gpe_ioam_rewrite_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
dpo_type_t dpoi_type
the type
#define ADJ_INDEX_INVALID
Invalid ADJ index - used when no adj is known likewise blazoned capitals INVALID speak volumes where ...
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
static vlib_cli_command_t vxlan_gpe_set_ioam_rewrite_cmd
(constructor) VLIB_CLI_COMMAND (vxlan_gpe_set_ioam_rewrite_cmd)
#define pool_get_aligned(P, E, A)
Allocate an object E from a pool P with alignment A.
int vxlan6_gpe_rewrite(vxlan_gpe_tunnel_t *t, u32 extension_size, u8 protocol_override, uword encap_next_node)
Calculate IPv6 VXLAN GPE rewrite header.
void vxlan_gpe_ioam_interface_init(void)
static void clib_mem_free(void *p)
vxlan_gpe_ioam_main_t vxlan_gpe_ioam_main
vlib_main_t vlib_node_runtime_t * node
A FIB graph nodes virtual function table.
#define clib_error_return(e, args...)
int vxlan4_gpe_rewrite(vxlan_gpe_tunnel_t *t, u32 extension_size, u8 protocol_override, uword encap_next_node)
Calculate IPv4 VXLAN GPE rewrite header.
u8 rewrite_size
rewrite size for dynamic plugins like iOAM
#define hash_get_pair(h, key)
Struct for VXLAN GPE node state.
u16 fp_len
The mask length.
vlib_main_t * vlib_main
State convenience vlib_main_t.
#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.
u8 protocol
see vxlan_gpe_protocol_t
fib_node_index_t fib_table_lookup(u32 fib_index, const fib_prefix_t *prefix)
Perfom a longest prefix match in the non-forwarding table.
static clib_error_t * vxlan_gpe_set_ioam_transit_rewrite_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
u8 protocol
encapsulated protocol
static fib_node_t * vxlan_gpe_ioam_fib_node_get(fib_node_index_t index)
Function definition to get a FIB node from its index.
static vlib_cli_command_t vxlan_gpe_set_ioam_flags_cmd
(constructor) VLIB_CLI_COMMAND (vxlan_gpe_set_ioam_flags_cmd)
int vxlan_gpe_ioam_disable_for_dest(vlib_main_t *vm, ip46_address_t dst_addr, u32 outer_fib_index, u8 ipv4_set)
#define pool_foreach(VAR, POOL)
Iterate through pool.
static vlib_cli_command_t vxlan_gpe_set_ioam_transit_rewrite_cmd
(constructor) VLIB_CLI_COMMAND (vxlan_gpe_set_ioam_transit_rewrite_cmd)
#define clib_error_return_code(e, code, flags, args...)
u32 fib_entry_child_add(fib_node_index_t fib_entry_index, fib_node_type_t child_type, fib_node_index_t child_index)
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
clib_error_t * vxlan_gpe_ioam_clear(vxlan_gpe_tunnel_t *t, int has_trace_option, int has_pot_option, int has_ppc_option, u8 ipv6_set)
vxlan_gpe_main_t vxlan_gpe_main
enum fib_forward_chain_type_t_ fib_forward_chain_type_t
FIB output chain type.
u8 * rewrite
Rewrite string.
vnet_main_t * vnet_get_main(void)
static void vxlan_gpe_set_clear_output_feature_on_intf(vlib_main_t *vm, u32 sw_if_index0, u8 is_add)
VXLAN GPE Extension (iOAM) Header definition.
u32 fib_node_index_t
A typedef of a node index.
uword decap_v4_next_override
fib_node_index_t fib_entry_index
fib_node_t node
Linkage into the FIB object graph.
static clib_error_t * vxlan_gpe_set_ioam_flags_command_fn(vlib_main_t *vm, unformat_input_t() *input, vlib_cli_command_t *cmd)
#define hash_set_mem(h, key, value)
static int dpo_id_is_valid(const dpo_id_t *dpoi)
Return true if the DPO object is valid, i.e.
static const dpo_id_t * load_balance_get_bucket_i(const load_balance_t *lb, u32 bucket)
vl_api_mac_address_t dst_addr
sll srl srl sll sra u16x4 i
Struct for VXLAN GPE tunnel.
@ VXLAN_GPE_ENCAP_NEXT_IP6_LOOKUP
#define VLIB_CLI_COMMAND(x,...)
#define VXLAN_GPE_OPTION_TYPE_IOAM_PROOF_OF_TRANSIT
#define CLIB_CACHE_LINE_BYTES
@ VXLAN_GPE_ENCAP_NEXT_IP4_LOOKUP
@ FIB_NODE_BACK_WALK_CONTINUE
fib_forward_chain_type_t fib_entry_get_default_chain_type(const fib_entry_t *fib_entry)
vnet_sw_interface_t * sw_interfaces
ip46_address_t fp_addr
The address type is not deriveable from the fp_addr member.
clib_error_t * vxlan_gpe_ioam_enable(int has_trace_option, int has_pot_option, int has_ppc_option)
clib_error_t * vxlan_gpe_ioam_disable(int has_trace_option, int has_pot_option, int has_ppc_option)
@ DPO_LOAD_BALANCE
load-balancing over a choice of [un]equal cost paths
fib_node_type_t fib_entry_type
#define vec_free(V)
Free vector's memory (no header).
int vxlan_gpe_ioam_set_rewrite(vxlan_gpe_tunnel_t *t, int has_trace_option, int has_pot_option, int has_ppc_option, u8 ipv6_set)
VXLAN GPE packet header structure.
int(* add_options[256])(u8 *rewrite_string, u8 *rewrite_size)
#define hash_get_mem(h, key)
fib_entry_t * fib_entry_get(fib_node_index_t index)
#define vec_validate_init_empty(V, I, INIT)
Make sure vector is long enough for given index and initialize empty space (no header,...
dpo_id_t fe_lb
The load-balance used for forwarding.
vxlan_gpe_ioam_dest_tunnels_t * dst_tunnels
static load_balance_t * load_balance_get(index_t lbi)
static uword pool_elts(void *v)
Number of active elements in a pool.
fib_protocol_t fp_proto
protocol type
static clib_error_t * vxlan_gpe_set_ioam_rewrite_command_fn(vlib_main_t *vm, unformat_input_t() *input, vlib_cli_command_t *cmd)
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)
An node in the FIB graph.
int vxlan_gpe_trace_profile_setup(void)
clib_memset(h->entries, 0, sizeof(h->entries[0]) *entries)
u8 * bool_ref_by_sw_if_index
per sw_if_index, to maintain bitmap
#define hash_unset_mem(h, key)
void vxlan_gpe_set_next_override(uword next)
Context passed between object during a back walk.
@ FIB_SOURCE_RR
Recursive resolution source.
int vxlan_gpe_ioam_clear_rewrite(vxlan_gpe_tunnel_t *t, int has_trace_option, int has_pot_option, int has_ppc_option, u8 ipv6_set)
The identity of a DPO is a combination of its type and its instance number/index of objects of that t...
clib_error_t * vxlan_gpe_ioam_set(vxlan_gpe_tunnel_t *t, int has_trace_option, int has_pot_option, int has_ppc_option, u8 ipv6_set)
const static fib_node_vft_t vxlan_gpe_ioam_vft
int vxlan_gpe_enable_disable_ioam_for_dest(vlib_main_t *vm, ip46_address_t dst_addr, u32 outer_fib_index, u8 is_ipv4, u8 is_add)
#define VXLAN_GPE_OPTION_TYPE_IOAM_TRACE
void vxlan_gpe_refresh_output_feature_on_all_dest(void)
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 fib_node_back_walk_rc_t vxlan_gpe_ioam_back_walk(fib_node_t *node, fib_node_back_walk_ctx_t *ctx)
Function definition to backwalk a FIB node.
static ip_adjacency_t * adj_get(adj_index_t adj_index)
Get a pointer to an adjacency object from its index.
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.
static void * clib_mem_alloc(uword size)
Aggregate type for a prefix.
vnet_interface_main_t interface_main
static void vxlan_gpe_ioam_last_lock_gone(fib_node_t *node)
Function definition to inform the FIB node that its last lock has gone.