|
FD.io VPP
v21.06-3-gbb25fbf28
Vector Packet Processing
|
Go to the documentation of this file.
28 .stat_segment_name =
"/net/adjacency",
44 .as_u64[0] = 0xffffffffffffffff,
45 .as_u64[1] = 0xffffffffffffffff,
67 u8 need_barrier_sync = 0;
76 if (need_barrier_sync)
84 if (need_barrier_sync == 0)
89 if (need_barrier_sync)
104 adj->rewrite_header.sw_if_index = ~0;
105 adj->rewrite_header.flags = 0;
113 if (need_barrier_sync)
134 af = va_arg (*args,
int);
138 return (
format(s,
"None"));
165 adj_index = va_arg (*args,
u32);
169 return format(s,
"<invalid adjacency>");
210 s =
format(s,
"\n delegates:");
213 s =
format(s,
"\n children:");
268 ADJ_DBG(adj,
"last-lock-gone");
289 adj->rewrite_header.sw_if_index);
299 adj->rewrite_header.sw_if_index);
327 return (adj->rewrite_header.sw_if_index);
337 return (adj->rewrite_header.max_l3_packet_bytes);
447 adj->rewrite_header.sw_if_index);
478 &adj->rewrite_header);
549 return (adj->rewrite_header.sw_if_index);
572 rw = &adj->rewrite_header;
589 #define ADJ_FROM_NODE(_node) \
590 ((ip_adjacency_t*)((char*)_node - STRUCT_OFFSET_OF(ip_adjacency_t, ia_node)))
741 .short_help =
"show adj [<adj_index>] [interface] [summary]",
760 else if (
unformat (input,
"disable"))
784 .path =
"adjacency counters",
785 .short_help =
"adjacency counters [enable|disable]",
u32 adj_dpo_get_urpf(const dpo_id_t *dpo)
static int adj_are_counters_enabled(void)
Get the global configuration option for enabling per-adj counters.
adj_flags_t ia_flags
Flags on the adjacency 1-bytes.
static int adj_index_is_special(adj_index_t adj_index)
fib_protocol_t ia_nh_proto
The protocol of the neighbor/peer.
void vlib_worker_thread_barrier_release(vlib_main_t *vm)
index_t dpoi_index
the index of objects of that type
@ IP_LOOKUP_NEXT_ARP
This packet matches an "incomplete adjacency" and packets need to be passed to ARP to find rewrite st...
void vnet_feature_register(vnet_feature_update_cb_t cb, void *data)
u8 * format_adj_flags(u8 *s, va_list *args)
Format adjacency flags.
ip_lookup_main_t lookup_main
enum fib_node_back_walk_rc_t_ fib_node_back_walk_rc_t
Return code from a back walk function.
ip_adjacency_t * adj_pool
The global adjacency pool.
static vlib_cli_command_t adj_cli_counters_set_command
(constructor) VLIB_CLI_COMMAND (adj_cli_counters_set_command)
@ FIB_NODE_BW_REASON_FLAG_ADJ_MTU
#define FOR_EACH_FIB_IP_PROTOCOL(_item)
ip4_main_t ip4_main
Global ip4 main structure.
const u8 * adj_get_rewrite(adj_index_t ai)
Return the rewrite string of the adjacency.
void adj_mcast_walk(u32 sw_if_index, fib_protocol_t proto, adj_walk_cb_t cb, void *ctx)
Walk the multicast Adjacencies on a given interface.
u32 adj_get_sw_if_index(adj_index_t ai)
Return the sw interface index of the adjacency.
#define ADJ_INDEX_INVALID
Invalid ADJ index - used when no adj is known likewise blazoned capitals INVALID speak volumes where ...
#define ADJ_FROM_NODE(_node)
#define pool_get_aligned(P, E, A)
Allocate an object E from a pool P with alignment A.
int adj_bfd_is_up(adj_index_t ai)
vlib_main_t vlib_node_runtime_t * node
fib_node_list_t fn_children
Vector of nodes that depend upon/use/share this node.
enum adj_walk_rc_t_ adj_walk_rc_t
return codes from a adjacency walker callback function
@ IP_LOOKUP_NEXT_GLEAN
This packet matches an "interface route" and packets need to be passed to ARP to find rewrite string ...
A FIB graph nodes virtual function table.
#define clib_error_return(e, args...)
static const char * adj_attr_names[]
Adj flag names.
void adj_unlock(adj_index_t adj_index)
Release a reference counting lock on the adjacency.
static fib_node_back_walk_rc_t adj_back_walk_notify(fib_node_t *node, fib_node_back_walk_ctx_t *ctx)
@ IP_LOOKUP_NEXT_LOCAL
This packet is for one of our own IP addresses.
const ip46_address_t ADJ_BCAST_ADDR
The special broadcast address (to construct a broadcast adjacency.
u32 * config_index_by_sw_if_index
u32 fn_locks
Number of dependents on this node.
@ VNET_REWRITE_HAS_FEATURES
This adjacency/interface has output features configured.
void vlib_validate_combined_counter(vlib_combined_counter_main_t *cm, u32 index)
validate a combined counter
#define pool_put(P, E)
Free an object E in pool P.
@ IP_LOOKUP_NEXT_MIDCHAIN
This packets follow a mid-chain adjacency.
static clib_error_t * adj_show(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
vlib_main_t * vm
X-connect all packets from the HOST to the PHY.
static const fib_node_vft_t adj_vft
void adj_nbr_remove(adj_index_t ai, fib_protocol_t nh_proto, vnet_link_t link_type, const ip46_address_t *nh_addr, u32 sw_if_index)
u8 * fib_node_children_format(fib_node_list_t list, u8 *s)
u16 adj_dpo_get_mtu(const dpo_id_t *dpo)
u32 adj_child_add(adj_index_t adj_index, fib_node_type_t child_type, fib_node_index_t child_index)
Add a child dependent to an adjacency.
char * name
The counter collection's name.
#define ADJ_DBG(_e, _fmt, _args...)
big switch to turn on Adjacency debugging
vnet_link_t ia_link
link/ether-type 1 bytes
int vlib_validate_combined_counter_will_expand(vlib_combined_counter_main_t *cm, u32 index)
enum fib_node_type_t_ fib_node_type_t
The types of nodes in a FIB graph.
void adj_child_remove(adj_index_t adj_index, u32 sibling_index)
Remove a child dependent.
void fib_walk_async(fib_node_type_t parent_type, fib_node_index_t parent_index, fib_walk_priority_t prio, fib_node_back_walk_ctx_t *ctx)
void adj_glean_remove(ip_adjacency_t *adj)
#define pool_get_aligned_will_expand(P, YESNO, A)
See if pool_get will expand the pool or not.
fib_node_bw_reason_flag_t fnbw_reason
The reason/trigger for the backwalk.
static int adj_is_valid(adj_index_t adj_index)
#define pool_is_free_index(P, I)
Use free bitmap to query whether given index is free.
#define vec_elt(v, i)
Get vector value at index i.
enum adj_flags_t_ adj_flags_t
Flags on an IP adjacency.
@ IP_LOOKUP_NEXT_MCAST_MIDCHAIN
Multicast Midchain Adjacency.
u8 * format_adj_nbr_incomplete(u8 *s, va_list *ap)
Format aa incomplete neigbour (ARP) adjacency.
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
@ IP_LOOKUP_NEXT_DROP
Adjacency to drop this packet.
int adj_per_adj_counters
Global Config for enabling per-adjacency counters.
u8 * format_adj_mcast(u8 *s, va_list *ap)
Format/display a mcast adjacency.
ip_lookup_next_t lookup_next_index
Next hop after ip4-lookup.
static adj_index_t adj_get_index(const ip_adjacency_t *adj)
Get a pointer to an adjacency object from its index.
struct adj_feature_update_t_ adj_feature_update_ctx_t
u8 * format_ip_adjacency(u8 *s, va_list *args)
Pretty print helper function for formatting specific adjacencies.
void adj_midchain_module_init(void)
Module initialisation.
vnet_main_t * vnet_get_main(void)
void adj_midchain_delegate_restack(adj_index_t ai)
restack a midchain delegate
Combined counter to hold both packets and byte differences.
#define vlib_worker_thread_barrier_sync(X)
struct adj_delegate_t_ * ia_delegates
A sorted vector of delegates.
u32 fib_node_index_t
A typedef of a node index.
VNET_SW_INTERFACE_MTU_CHANGE_FUNCTION(adj_mtu_update)
static adj_walk_rc_t adj_feature_update_walk_cb(adj_index_t ai, void *arg)
static void vlib_zero_combined_counter(vlib_combined_counter_main_t *cm, u32 index)
Clear a combined counter Clears the set of per-thread counters.
@ IP_LOOKUP_NEXT_REWRITE
This packet is to be rewritten and forwarded to the next processing node.
int adj_ndr_midchain_recursive_loop_detect(adj_index_t ai, fib_node_index_t **entry_indicies)
descend the FIB graph looking for loops
static void adj_node_last_lock_gone(fib_node_t *node)
@ IP_LOOKUP_NEXT_PUNT
Adjacency to punt this packet.
u8 * format_adj_mcast_midchain(u8 *s, va_list *ap)
void adj_delegate_adj_modified(ip_adjacency_t *adj)
vnet_feature_config_main_t * cm
#define VLIB_CLI_COMMAND(x,...)
enum fib_protocol_t_ fib_protocol_t
Protocol Type.
static void adj_feature_update(u32 sw_if_index, u8 arc_index, u8 is_enable, void *data)
vnet_feature_main_t feature_main
@ IP_LOOKUP_NEXT_BCAST
Broadcast Adjacency.
void fib_node_register_type(fib_node_type_t type, const fib_node_vft_t *vft)
fib_node_register_type
counter_t packets
packet counter
enum adj_attr_t_ adj_attr_t
Flags on an IP adjacency.
#define CLIB_CACHE_LINE_BYTES
static clib_error_t * adj_mtu_update(vnet_main_t *vnm, u32 sw_if_index, u32 flags)
static clib_error_t * adj_cli_counters_set(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
CLI invoked function to enable/disable per-adj counters.
@ FIB_NODE_BACK_WALK_CONTINUE
void vlib_cli_output(vlib_main_t *vm, char *fmt,...)
void adj_mcast_remove(fib_protocol_t proto, u32 sw_if_index)
int adj_is_up(adj_index_t ai)
Return true if the adjacency is 'UP', i.e.
@ IP_LOOKUP_NEXT_ICMP_ERROR
This packets needs to go to ICMP error.
static void vlib_get_combined_counter(const vlib_combined_counter_main_t *cm, u32 index, vlib_counter_t *result)
Get the value of a combined counter, never called in the speed path Scrapes the entire set of per-thr...
#define vec_free(V)
Free vector's memory (no header).
union ip_adjacency_t_::@144 sub_type
#define pool_foreach_index(i, v)
void adj_nbr_module_init(void)
Module initialisation.
unformat_function_t unformat_vnet_sw_interface
description fragment has unexpected format
vlib_combined_counter_main_t adjacency_counters
Adjacency packet counters.
A collection of combined counters.
void adj_glean_module_init(void)
Module initialisation.
vnet_link_t adj_get_link_type(adj_index_t ai)
Return the link type of the adjacency.
#define VLIB_INIT_FUNCTION(x)
counter_t bytes
byte counter
u32 fib_node_list_get_size(fib_node_list_t list)
u8 * adj_delegate_format(u8 *s, ip_adjacency_t *adj)
u8 * format_adj_midchain(u8 *s, va_list *ap)
Format a midchain adjacency.
u32 ia_cfg_index
feature [arc] config index
fib_node_t ia_node
Linkage into the FIB node graph.
void fib_node_lock(fib_node_t *node)
static uword pool_elts(void *v)
Number of active elements in a pool.
void adj_mcast_module_init(void)
Module initialisation.
ip_lookup_main_t lookup_main
static void adj_poison(ip_adjacency_t *adj)
An node in the FIB graph.
u32 adj_index_t
An index for adjacencies.
clib_memset(h->entries, 0, sizeof(h->entries[0]) *entries)
enum vnet_link_t_ vnet_link_t
Link Type: A description of the protocol of packets on the link.
void fib_node_init(fib_node_t *node, fib_node_type_t type)
void adj_lock(adj_index_t adj_index)
Take a reference counting lock on the adjacency.
static vlib_main_t * vlib_get_main(void)
void fib_node_unlock(fib_node_t *node)
#define FOR_EACH_ADJ_ATTR(_attr)
clib_error_t *() vlib_init_function_t(struct vlib_main_t *vm)
@ IP_LOOKUP_NEXT_MCAST
Multicast Adjacency.
struct ip_adjacency_t_::@144::@145 nbr
IP_LOOKUP_NEXT_ARP/IP_LOOKUP_NEXT_REWRITE.
Context passed between object during a back walk.
ip_adjacency_t * adj_alloc(fib_protocol_t proto)
void fib_node_child_remove(fib_node_type_t parent_type, fib_node_index_t parent_index, fib_node_index_t sibling_index)
void adj_nbr_walk(u32 sw_if_index, fib_protocol_t adj_nh_proto, adj_walk_cb_t cb, void *ctx)
Walk all adjacencies on a link for a given next-hop protocol.
The identity of a DPO is a combination of its type and its instance number/index of objects of that t...
u8 * format_adj_glean(u8 *s, va_list *ap)
Format/display a glean adjacency.
adj_walk_rc_t(* adj_walk_cb_t)(adj_index_t ai, void *ctx)
Call back function when walking adjacencies.
void fib_node_deinit(fib_node_t *node)
static adj_walk_rc_t adj_mtu_update_walk_cb(adj_index_t ai, void *arg)
int adj_recursive_loop_detect(adj_index_t ai, fib_node_index_t **entry_indicies)
descend the FIB graph looking for loops
vnet_feature_config_main_t * feature_config_mains
feature config main objects
static void adj_last_lock_gone(ip_adjacency_t *adj)
void adj_walk(u32 sw_if_index, adj_walk_cb_t cb, void *ctx)
Walk the Adjacencies on a given interface.
static clib_error_t * adj_module_init(vlib_main_t *vm)
u8 * format_adj_nbr(u8 *s, va_list *ap)
Format a neigbour (REWRITE) adjacency.
vl_api_interface_index_t sw_if_index
void adj_midchain_teardown(ip_adjacency_t *adj)
adj_midchain_setup
static ip_adjacency_t * adj_get(adj_index_t adj_index)
Get a pointer to an adjacency object from its index.
static vlib_cli_command_t adj_show_command
(constructor) VLIB_CLI_COMMAND (adj_show_command)
u32 fib_node_child_add(fib_node_type_t parent_type, fib_node_index_t parent_index, fib_node_type_t type, fib_node_index_t index)
u8 output_feature_arc_index
static fib_node_t * adj_get_node(fib_node_index_t index)
u8 output_feature_arc_index
void adj_delegate_adj_deleted(ip_adjacency_t *adj)
void vnet_rewrite_update_mtu(vnet_main_t *vnm, vnet_link_t linkt, vnet_rewrite_header_t *rw)
struct ip_adjacency_t_::@144::@146 midchain
IP_LOOKUP_NEXT_MIDCHAIN.
vl_api_wireguard_peer_flags_t flags