![]() |
FD.io VPP
v21.01
Vector Packet Processing
|
Go to the source code of this file.
Data Structures | |
struct | ip_adjacency_t_ |
IP unicast adjacency. More... | |
Macros | |
#define | IP4_LOOKUP_NEXT_NODES |
#define | IP6_LOOKUP_NEXT_NODES |
#define | ADJ_ATTR_NAMES |
#define | FOR_EACH_ADJ_ATTR(_attr) |
Typedefs | |
typedef void(* | adj_midchain_fixup_t) (vlib_main_t *vm, const struct ip_adjacency_t_ *adj, vlib_buffer_t *b0, const void *data) |
A function type for post-rewrite fixups on midchain adjacency. More... | |
typedef enum adj_attr_t_ | adj_attr_t |
Flags on an IP adjacency. More... | |
typedef enum adj_flags_t_ | adj_flags_t |
Flags on an IP adjacency. More... | |
typedef struct ip_adjacency_t_ | ip_adjacency_t |
IP unicast adjacency. More... | |
Functions | |
u8 * | format_adj_flags (u8 *s, va_list *args) |
Format adjacency flags. More... | |
STATIC_ASSERT ((STRUCT_OFFSET_OF(ip_adjacency_t, cacheline0)==0), "IP adjacency cacheline 0 is not offset") | |
STATIC_ASSERT ((STRUCT_OFFSET_OF(ip_adjacency_t, cacheline1)==CLIB_CACHE_LINE_BYTES), "IP adjacency cacheline 1 is more than one cacheline size offset") | |
STATIC_ASSERT ((STRUCT_OFFSET_OF(ip_adjacency_t, cacheline3)==3 *CLIB_CACHE_LINE_BYTES), "IP adjacency cacheline 3 is more than one cacheline size offset") | |
STATIC_ASSERT_SIZEOF (ip_adjacency_t, 4 *64) | |
void | adj_lock (adj_index_t adj_index) |
Take a reference counting lock on the adjacency. More... | |
void | adj_unlock (adj_index_t adj_index) |
Release a reference counting lock on the adjacency. More... | |
u32 | adj_child_add (adj_index_t adj_index, fib_node_type_t type, fib_node_index_t child_index) |
Add a child dependent to an adjacency. More... | |
void | adj_child_remove (adj_index_t adj_index, u32 sibling_index) |
Remove a child dependent. More... | |
void | adj_walk (u32 sw_if_index, adj_walk_cb_t cb, void *ctx) |
Walk the Adjacencies on a given interface. More... | |
vnet_link_t | adj_get_link_type (adj_index_t ai) |
Return the link type of the adjacency. More... | |
u32 | adj_get_sw_if_index (adj_index_t ai) |
Return the sw interface index of the adjacency. More... | |
int | adj_is_up (adj_index_t ai) |
Return true if the adjacency is 'UP', i.e. More... | |
const u8 * | adj_get_rewrite (adj_index_t ai) |
Return the link type of the adjacency. More... | |
int | adj_recursive_loop_detect (adj_index_t ai, fib_node_index_t **entry_indicies) |
descend the FIB graph looking for loops More... | |
static ip_adjacency_t * | adj_get (adj_index_t adj_index) |
Get a pointer to an adjacency object from its index. More... | |
static int | adj_is_valid (adj_index_t adj_index) |
static int | adj_are_counters_enabled (void) |
Get the global configuration option for enabling per-adj counters. More... | |
Variables | |
const ip46_address_t | ADJ_BCAST_ADDR |
The special broadcast address (to construct a broadcast adjacency. More... | |
ip_adjacency_t * | adj_pool |
The global adjacency pool. More... | |
vlib_combined_counter_main_t | adjacency_counters |
Adjacency packet counters. More... | |
int | adj_per_adj_counters |
Global Config for enabling per-adjacency counters This is configurable because it comes with a non-negligible performance cost. More... | |
#define ADJ_ATTR_NAMES |
#define FOR_EACH_ADJ_ATTR | ( | _attr | ) |
#define IP4_LOOKUP_NEXT_NODES |
#define IP6_LOOKUP_NEXT_NODES |
typedef enum adj_attr_t_ adj_attr_t |
Flags on an IP adjacency.
typedef enum adj_flags_t_ adj_flags_t |
Flags on an IP adjacency.
typedef void(* adj_midchain_fixup_t) (vlib_main_t *vm, const struct ip_adjacency_t_ *adj, vlib_buffer_t *b0, const void *data) |
typedef struct ip_adjacency_t_ ip_adjacency_t |
IP unicast adjacency.
An adjacency is a representation of a peer on a particular link.
enum adj_attr_t_ |
Flags on an IP adjacency.
enum adj_flags_t_ |
enum ip4_lookup_next_t |
enum ip6_lookup_next_t |
enum ip_lookup_next_t |
An adjacency is a representation of an attached L3 peer.
Adjacency Sub-types:
The API to create and update the adjacency is very sub-type specific. This is intentional as it encourages the user to carefully consider which adjacency sub-type they are really using, and hence assign it data in the appropriate sub-type space in the union of sub-types. This prevents the adj becoming a disorganised dumping group for 'my features needs a u16 somewhere' data. It is important to enforce this approach as space in the adjacency is a premium, as we need it to fit in 1 cache line.
the API is also based around an index to an adjacency not a raw pointer. This is so the user doesn't suffer the same limp inducing firearm injuries that the author suffered as the adjacencies can realloc.Common (IP4/IP6) next index stored in adjacency.
|
inlinestatic |
u32 adj_child_add | ( | adj_index_t | adj_index, |
fib_node_type_t | type, | ||
fib_node_index_t | child_index | ||
) |
void adj_child_remove | ( | adj_index_t | adj_index, |
u32 | sibling_index | ||
) |
|
inlinestatic |
vnet_link_t adj_get_link_type | ( | adj_index_t | ai | ) |
const u8* adj_get_rewrite | ( | adj_index_t | ai | ) |
u32 adj_get_sw_if_index | ( | adj_index_t | ai | ) |
int adj_is_up | ( | adj_index_t | ai | ) |
|
inlinestatic |
void adj_lock | ( | adj_index_t | adj_index | ) |
int adj_recursive_loop_detect | ( | adj_index_t | ai, |
fib_node_index_t ** | entry_indicies | ||
) |
void adj_unlock | ( | adj_index_t | adj_index | ) |
void adj_walk | ( | u32 | sw_if_index, |
adj_walk_cb_t | cb, | ||
void * | ctx | ||
) |
STATIC_ASSERT | ( | (STRUCT_OFFSET_OF(ip_adjacency_t, cacheline0)==0) | , |
"IP adjacency cacheline 0 is not offset" | |||
) |
STATIC_ASSERT | ( | (STRUCT_OFFSET_OF(ip_adjacency_t, cacheline1)==CLIB_CACHE_LINE_BYTES) | , |
"IP adjacency cacheline 1 is more than one cacheline size offset" | |||
) |
STATIC_ASSERT | ( | (STRUCT_OFFSET_OF(ip_adjacency_t, cacheline3)==3 *CLIB_CACHE_LINE_BYTES) | , |
"IP adjacency cacheline 3 is more than one cacheline size offset" | |||
) |
STATIC_ASSERT_SIZEOF | ( | ip_adjacency_t | , |
4 * | 64 | ||
) |
const ip46_address_t ADJ_BCAST_ADDR |
int adj_per_adj_counters |
Global Config for enabling per-adjacency counters This is configurable because it comes with a non-negligible performance cost.
Global Config for enabling per-adjacency counters This is configurable because it comes with a non-negligible performance cost.
By default these are disabled.
ip_adjacency_t* adj_pool |
vlib_combined_counter_main_t adjacency_counters |