|
FD.io VPP
v21.06-3-gbb25fbf28
Vector Packet Processing
|
Go to the documentation of this file.
89 #define IP_PMTU_TRKR_DBG(_ipt, _fmt, _args...) \
91 vlib_log_debug (ip_pmtu_logger, "[%U]: " _fmt ": ", format_ip_pmtu, \
92 _ipt - ip_pmtu_pool, ##_args); \
94 #define IP_PMTU_DBG(_fmt, _args...) \
96 vlib_log_debug (ip_pmtu_logger, _fmt ": ", ##_args); \
106 #define _(a, b, c) else if (f & IP_PMTU_FLAG_##a) s = format (s, "%s ", c);
147 format (s,
"[%d] [tbl:[%d:%d]] %U pmtu:[cfg:%d, oper:%d, parent:%d] [%U]",
162 s =
format (s,
"IP path-MTU: %d", ip_adj->
pmtu);
198 adj->
ia_nh_proto, adj->rewrite_header.sw_if_index);
250 return (pmtu == 0 || pmtu == 0xffff);
290 ipp_ad->
pmtu = *pmtup;
375 u32 indent = va_arg (*ap,
u32);
452 u32 cover, fib_index;
534 bool was_attached, is_attached;
541 was_attached = !!(ipt->
ipt_flags & IP_PMTU_FLAG_ATTACHED);
544 if (was_attached && !is_attached)
551 ipt->
ipt_flags &= ~IP_PMTU_FLAG_ATTACHED;
553 if (!was_attached && is_attached)
623 if (ipt->
ipt_flags & IP_PMTU_FLAG_REMOTE)
657 return (VNET_API_ERROR_NO_SUCH_TABLE);
872 .path =
"show ip pmtu",
874 .short_help =
"show ip path MTU",
static ip_pmtu_dpo_t * ip_pmtu_dpo_alloc(void)
void adj_delegate_remove(adj_index_t ai, adj_delegate_type_t type)
Remove a delegate from an adjacency.
index_t ad_index
The index passed by the provider to identify its delegate instance.
fib_protocol_t ia_nh_proto
The protocol of the neighbor/peer.
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.
@ IP_LOOKUP_NEXT_ARP
This packet matches an "incomplete adjacency" and packets need to be passed to ARP to find rewrite st...
static u8 * format_ip_pmtu_flags(u8 *s, va_list *ap)
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...
static vlib_cli_command_t show_fib_entry
(constructor) VLIB_CLI_COMMAND (show_fib_entry)
const static char *const *const ip_pmtu_dpo_nodes[DPO_PROTO_NUM]
static void ip_pmtu_dpo_lock(dpo_id_t *dpo)
static u8 * format_ip_pmtu(u8 *s, va_list *ap)
An ADJ delegate virtual function table.
int ip_path_mtu_replace_end(void)
const fib_prefix_t * fib_entry_get_prefix(fib_node_index_t fib_entry_index)
ip_pmtu_flags_t ipt_flags
enum fib_node_back_walk_rc_t_ fib_node_back_walk_rc_t
Return code from a back walk function.
u32 fib_table_get_table_id(u32 fib_index, fib_protocol_t proto)
Get the Table-ID of the FIB from protocol and index.
void ip_path_mtu_walk(ip_path_mtu_walk_t fn, void *ctx)
static walk_rc_t ip_path_mtu_walk_sweep(index_t ipti, void *arg)
#define pool_get_aligned_zero(P, E, A)
Allocate an object E from a pool P with alignment A and zero it.
dpo_type_t dpoi_type
the type
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
void fib_entry_untrack(fib_node_index_t fei, u32 sibling)
Stop tracking a FIB entry.
int ip_path_mtu_replace_begin(void)
static u16 ip_pmtu_dpo_get_mtu(const dpo_id_t *dpo)
enum ip_pmtu_flags_t_ ip_pmtu_flags_t
static index_t ip_pmtu_dpo_get_index(ip_pmtu_dpo_t *ipm)
vlib_log_class_t vlib_log_register_class(char *class, char *subclass)
u32 dpo_get_urpf(const dpo_id_t *dpo)
Get a uRPF interface for the DPO.
vlib_main_t vlib_node_runtime_t * 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.
static void ip_pmtu_update(index_t ipti, u16 pmtu)
@ FIB_ENTRY_FLAG_ATTACHED
struct ip_pmtu_key_t_ ip_pmtu_key_t
@ IP_LOOKUP_NEXT_LOCAL
This packet is for one of our own IP addresses.
void ip_pmtu_get_ip(const ip_pmtu_t *ipt, ip_address_t *ip)
void ip_address_to_fib_prefix(const ip_address_t *addr, fib_prefix_t *prefix)
convert from a IP address to a FIB prefix
static bool ip_path_mtu_value_invalid(u16 pmtu)
static_always_inline ip_pmtu_t * ip_path_mtu_get(index_t index)
#define pool_put(P, E)
Free an object E in pool P.
@ IP_LOOKUP_NEXT_MIDCHAIN
This packets follow a mid-chain adjacency.
vlib_main_t * vm
X-connect all packets from the HOST to the PHY.
Remote Path MTU tracking object.
void adj_nbr_set_mtu(adj_index_t adj_index, u16 mtu)
Set the MTU on an adjacency.
@ FIB_ENTRY_FLAG_INTERPOSE
enum fib_node_type_t_ fib_node_type_t
The types of nodes in a FIB graph.
#define pool_put_index(p, i)
Free pool element with given index.
void ip_address_from_46(const ip46_address_t *nh, fib_protocol_t fproto, ip_address_t *ip)
static adj_walk_rc_t ip_ptmu_adj_walk_remove(adj_index_t ai, void *ctx)
static fib_source_t ip_pmtu_source
fib_node_index_t fib_table_entry_special_dpo_update(u32 fib_index, const fib_prefix_t *prefix, fib_source_t source, fib_entry_flag_t flags, const dpo_id_t *dpo)
Update a 'special' entry to the FIB that links to the DPO passed A special entry is an entry that the...
static ip_pmtu_t * ip_pmtu_get_from_node(fib_node_t *node)
const static char *const ip_pmtu_dpo_ip4_nodes[]
The per-protocol VLIB graph nodes that are assigned to a glean object.
static u8 * format_ip_path_mtu_adj_delegate(const adj_delegate_t *aed, u8 *s)
u8 * format_ip_pmtu_dpo(u8 *s, va_list *ap)
#define pool_is_free_index(P, I)
Use free bitmap to query whether given index is free.
struct ip_path_mtu_adj_delegate_t_ ip_path_mtu_adj_delegate_t
Delegate added to adjacencies to track path MTU.
fib_node_index_t fib_entry_track(u32 fib_index, const fib_prefix_t *prefix, fib_node_type_t child_type, index_t child_index, u32 *sibling)
Trackers are used on FIB entries by objects that which to track the changing state of the entry.
@ IP_LOOKUP_NEXT_MCAST_MIDCHAIN
Multicast Midchain Adjacency.
#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.
int adj_delegate_add(ip_adjacency_t *adj, adj_delegate_type_t adt, index_t adi)
Add a delegate to an adjacency.
static adj_walk_rc_t ip_ptmu_adj_walk_update(adj_index_t ai, void *ctx)
u32 fib_table_get_table_id_for_sw_if_index(fib_protocol_t proto, u32 sw_if_index)
Get the Table-ID of the FIB bound to the interface.
@ IP_LOOKUP_NEXT_DROP
Adjacency to drop this packet.
const static char *const ip_pmtu_dpo_ip6_nodes[]
static clib_error_t * ip_path_module_init(vlib_main_t *vm)
#define vec_add1(V, E)
Add 1 element to end of vector (unspecified alignment).
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.
ip_lookup_next_t lookup_next_index
Next hop after ip4-lookup.
const dpo_id_t * fib_entry_contribute_ip_forwarding(fib_node_index_t fib_entry_index)
int ip_path_mtu_update(const ip_address_t *nh, u32 table_id, u16 pmtu)
enum adj_delegate_type_t_ adj_delegate_type_t
A Delagate is a means to implement the Delagation design pattern; the extension of an object's functi...
static void ip_pmtu_adj_delegate_adj_created(adj_index_t ai)
static adj_delegate_type_t ip_pmtu_adj_delegate_type
adj_index_t ad_adj_index
The ADJ entry object to which the delagate is attached.
u32 index_t
A Data-Path Object is an object that represents actions that are applied to packets are they are swit...
static ip_pmtu_dpo_t * ip_pmtu_dpo_get_from_dpo(const dpo_id_t *dpo)
static u32 ip_pmtu_dpo_get_urpf(const dpo_id_t *dpo)
u32 fib_node_index_t
A typedef of a node index.
static void hash_unset_mem_free(uword **h, const void *key)
#define hash_create_mem(elts, key_bytes, value_bytes)
@ IP_LOOKUP_NEXT_REWRITE
This packet is to be rewritten and forwarded to the next processing node.
static const fib_node_vft_t ip_ptmu_fib_node_vft
u16 dpo_get_mtu(const dpo_id_t *dpo)
Get the MTU DPO.
walk_rc_t(* ip_path_mtu_walk_t)(index_t ipti, void *ctx)
enum dpo_type_t_ dpo_type_t
Common types of data-path objects New types can be dynamically added using dpo_register_new_type()
static void ip_pmtu_dpo_interpose(const dpo_id_t *original, const dpo_id_t *parent, dpo_id_t *clone)
Interpose a path MTU DPO.
static void hash_set_mem_alloc(uword **h, const void *key, uword v)
@ IP_LOOKUP_NEXT_PUNT
Adjacency to punt this packet.
#define pool_get(P, E)
Allocate an object E from a pool P (unspecified alignment).
adj_delegate_type_t adj_delegate_register_new_type(const adj_delegate_vft_t *vft)
adj_delegate_register_new_type
#define VLIB_CLI_COMMAND(x,...)
static vlib_log_class_t ip_pmtu_logger
Path MTU.
static fib_node_back_walk_rc_t ip_pmtu_back_walk_notify(fib_node_t *node, fib_node_back_walk_ctx_t *ctx)
enum fib_protocol_t_ fib_protocol_t
Protocol Type.
u16 ipt_oper_pmtu
operational MTU; the minimum value of the cfg and parent MTU
fib_node_index_t ipt_fib_entry
Track fib entry.
dpo_lock_fn_t dv_lock
A reference counting lock function.
@ IP_LOOKUP_NEXT_BCAST
Broadcast Adjacency.
dpo_proto_t ipm_proto
The protocol of packets using this DPO.
u32 fib_entry_get_resolving_interface(fib_node_index_t entry_index)
u16 ipt_parent_pmtu
MTU from the parent MTU.
fib_node_t ipt_node
linkage into the FIB graph
const adj_delegate_vft_t ip_path_adj_delegate_vft
@ 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)
dpo_proto_t fib_proto_to_dpo(fib_protocol_t fib_proto)
static_always_inline ip_pmtu_dpo_t * ip_pmtu_dpo_get(index_t index)
static void ip_pmtu_stack(ip_pmtu_t *ipt)
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.
static index_t ip_pmtu_destroy(index_t ipti, const ip_pmtu_key_t *key)
#define FIB_SOURCE_PRIORITY_HI
Some priority values that plugins might use when they are not to concerned where in the list they'll ...
@ IP_LOOKUP_NEXT_ICMP_ERROR
This packets needs to go to ICMP error.
u16 ipm_pmtu
Configured Path Mtu.
u32 ip_pmtu_get_table_id(const ip_pmtu_t *ipt)
dpo_id_t ipm_dpo
Stacked DPO.
#define vec_free(V)
Free vector's memory (no header).
union ip_adjacency_t_::@144 sub_type
static fib_node_t * ip_pmtu_get_node(fib_node_index_t index)
adj_delegate_t * adj_delegate_get(const ip_adjacency_t *adj, adj_delegate_type_t type)
Get a delegate from an adjacency.
#define IP_PMTU_DBG(_fmt, _args...)
ip_pmtu_dpo_t * ip_pmtu_dpo_pool
DPO pool.
ip_pmtu_t * ip_pmtu_pool
Path MTU tracker pool.
void dpo_copy(dpo_id_t *dst, const dpo_id_t *src)
atomic copy a data-plane object.
static void ip_pmtu_adj_delegate_adj_modified(adj_delegate_t *ad)
static fib_node_type_t ip_pmtu_fib_type
Fib node type for the tracker.
#define pool_foreach_index(i, v)
#define hash_get_mem(h, key)
static dpo_type_t ip_pmtu_dpo_type
DPO type registered for these GBP FWD.
description fragment has unexpected format
static uword * ip_pmtu_db
static clib_error_t * show_ip_pmtu_command(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
#define VLIB_INIT_FUNCTION(x)
u16 ipm_locks
number of locks.
u8 * format_fib_prefix(u8 *s, va_list *args)
#define vec_foreach(var, vec)
Vector iterator.
fib_entry_flag_t fib_entry_get_flags(fib_node_index_t fib_entry_index)
static void ip_pmtu_adj_delegate_adj_deleted(adj_delegate_t *ad)
fib_protocol_t fp_proto
protocol type
u32 fib_entry_get_fib_index(fib_node_index_t fib_entry_index)
An node in the FIB graph.
u32 adj_index_t
An index for adjacencies.
struct ip_path_mtu_walk_sweep_ctx_t_ ip_path_mtu_walk_sweep_ctx_t
const dpo_id_t * drop_dpo_get(dpo_proto_t proto)
void fib_node_init(fib_node_t *node, fib_node_type_t type)
A virtual function table regisitered for a DPO type.
u8 * format_dpo_proto(u8 *s, va_list *args)
format a DPO protocol
Delegate added to adjacencies to track path MTU.
void adj_nbr_walk_nh(u32 sw_if_index, fib_protocol_t adj_nh_proto, const ip46_address_t *nh, adj_walk_cb_t cb, void *ctx)
Walk adjacencies on a link with a given next-hop.
clib_error_t *() vlib_init_function_t(struct vlib_main_t *vm)
@ IP_LOOKUP_NEXT_MCAST
Multicast Adjacency.
static walk_rc_t ip_path_mtu_walk_mark(index_t ipti, void *ctx)
@ FIB_SOURCE_BH_SIMPLE
add paths without path extensions
static void ip_pmtu_dpo_unlock(dpo_id_t *dpo)
struct ip_adjacency_t_::@144::@145 nbr
IP_LOOKUP_NEXT_ARP/IP_LOOKUP_NEXT_REWRITE.
Context passed between object during a back walk.
u16 ipt_cfg_pmtu
Configured MTU.
fib_node_index_t fib_table_get_less_specific(u32 fib_index, const fib_prefix_t *prefix)
Get the less specific (covering) prefix.
void ip_pmtu_dpo_add_or_lock(fib_protocol_t fproto, u16 pmtu, dpo_id_t *dpo)
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.
#define IP_PMTU_TRKR_DBG(_ipt, _fmt, _args...)
static ip_path_mtu_adj_delegate_t * ip_path_mtu_adj_delegate_pool
static bool ip_mtu_fib_entry_is_attached(fib_node_index_t fib_entry)
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.
static void ip_pmtu_last_lock_gone(fib_node_t *node)
u32 fib_table_find(fib_protocol_t proto, u32 table_id)
Get the index of the FIB for a Table-ID.
vl_api_interface_index_t sw_if_index
enum walk_rc_t_ walk_rc_t
Walk return code.
void dpo_reset(dpo_id_t *dpo)
reset a DPO ID The DPO will be unlocked.
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.
adj_delegate_format_t adv_format
Aggregate type for a prefix.
static index_t ip_pmtu_alloc(u32 fib_index, const fib_prefix_t *pfx, const ip_pmtu_key_t *key, u16 pmtu)
const static dpo_vft_t ip_pmtu_dpo_vft