FD.io VPP  v21.06-3-gbb25fbf28
Vector Packet Processing
ip_path_mtu.c File Reference
+ Include dependency graph for ip_path_mtu.c:

Go to the source code of this file.

Data Structures

struct  ip_path_mtu_adj_delegate_t_
 Delegate added to adjacencies to track path MTU. More...
 
struct  ip_pmtu_key_t_
 
struct  ip_path_mtu_walk_sweep_ctx_t_
 

Macros

#define IP_PMTU_TRKR_DBG(_ipt, _fmt, _args...)
 
#define IP_PMTU_DBG(_fmt, _args...)
 

Typedefs

typedef struct ip_path_mtu_adj_delegate_t_ ip_path_mtu_adj_delegate_t
 Delegate added to adjacencies to track path MTU. More...
 
typedef struct ip_pmtu_key_t_ ip_pmtu_key_t
 
typedef struct ip_path_mtu_walk_sweep_ctx_t_ ip_path_mtu_walk_sweep_ctx_t
 

Functions

static u8format_ip_pmtu_flags (u8 *s, va_list *ap)
 
u32 ip_pmtu_get_table_id (const ip_pmtu_t *ipt)
 
void ip_pmtu_get_ip (const ip_pmtu_t *ipt, ip_address_t *ip)
 
static u8format_ip_pmtu (u8 *s, va_list *ap)
 
static u8format_ip_path_mtu_adj_delegate (const adj_delegate_t *aed, u8 *s)
 
static void ip_pmtu_adj_delegate_adj_created (adj_index_t ai)
 
static void ip_pmtu_adj_delegate_adj_deleted (adj_delegate_t *ad)
 
static void ip_pmtu_adj_delegate_adj_modified (adj_delegate_t *ad)
 
static bool ip_path_mtu_value_invalid (u16 pmtu)
 
static adj_walk_rc_t ip_ptmu_adj_walk_remove (adj_index_t ai, void *ctx)
 
static adj_walk_rc_t ip_ptmu_adj_walk_update (adj_index_t ai, void *ctx)
 
static ip_pmtu_dpo_tip_pmtu_dpo_alloc (void)
 
static ip_pmtu_dpo_tip_pmtu_dpo_get_from_dpo (const dpo_id_t *dpo)
 
static index_t ip_pmtu_dpo_get_index (ip_pmtu_dpo_t *ipm)
 
static void ip_pmtu_dpo_lock (dpo_id_t *dpo)
 
static void ip_pmtu_dpo_unlock (dpo_id_t *dpo)
 
static u32 ip_pmtu_dpo_get_urpf (const dpo_id_t *dpo)
 
void ip_pmtu_dpo_add_or_lock (fib_protocol_t fproto, u16 pmtu, dpo_id_t *dpo)
 
u8format_ip_pmtu_dpo (u8 *s, va_list *ap)
 
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. More...
 
static u16 ip_pmtu_dpo_get_mtu (const dpo_id_t *dpo)
 
static bool ip_mtu_fib_entry_is_attached (fib_node_index_t fib_entry)
 
static index_t ip_pmtu_alloc (u32 fib_index, const fib_prefix_t *pfx, const ip_pmtu_key_t *key, u16 pmtu)
 
static void ip_pmtu_stack (ip_pmtu_t *ipt)
 
static void ip_pmtu_update (index_t ipti, u16 pmtu)
 
static index_t ip_pmtu_destroy (index_t ipti, const ip_pmtu_key_t *key)
 
int ip_path_mtu_update (const ip_address_t *nh, u32 table_id, u16 pmtu)
 
static walk_rc_t ip_path_mtu_walk_mark (index_t ipti, void *ctx)
 
static walk_rc_t ip_path_mtu_walk_sweep (index_t ipti, void *arg)
 
int ip_path_mtu_replace_begin (void)
 
int ip_path_mtu_replace_end (void)
 
void ip_path_mtu_walk (ip_path_mtu_walk_t fn, void *ctx)
 
static fib_node_tip_pmtu_get_node (fib_node_index_t index)
 
static ip_pmtu_tip_pmtu_get_from_node (fib_node_t *node)
 
static void ip_pmtu_last_lock_gone (fib_node_t *node)
 
static fib_node_back_walk_rc_t ip_pmtu_back_walk_notify (fib_node_t *node, fib_node_back_walk_ctx_t *ctx)
 
static clib_error_tip_path_module_init (vlib_main_t *vm)
 
static clib_error_tshow_ip_pmtu_command (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
 

Variables

static vlib_log_class_t ip_pmtu_logger
 Path MTU. More...
 
static adj_delegate_type_t ip_pmtu_adj_delegate_type
 
static fib_source_t ip_pmtu_source
 
ip_pmtu_dpo_tip_pmtu_dpo_pool
 DPO pool. More...
 
static dpo_type_t ip_pmtu_dpo_type
 DPO type registered for these GBP FWD. More...
 
static fib_node_type_t ip_pmtu_fib_type
 Fib node type for the tracker. More...
 
ip_pmtu_tip_pmtu_pool
 Path MTU tracker pool. More...
 
static ip_path_mtu_adj_delegate_tip_path_mtu_adj_delegate_pool
 
static uwordip_pmtu_db
 
const adj_delegate_vft_t ip_path_adj_delegate_vft
 
const static dpo_vft_t ip_pmtu_dpo_vft
 
const static char *const ip_pmtu_dpo_ip4_nodes []
 The per-protocol VLIB graph nodes that are assigned to a glean object. More...
 
const static char *const ip_pmtu_dpo_ip6_nodes []
 
const static char *const *const ip_pmtu_dpo_nodes [DPO_PROTO_NUM]
 
static const fib_node_vft_t ip_ptmu_fib_node_vft
 
static vlib_cli_command_t show_fib_entry
 (constructor) VLIB_CLI_COMMAND (show_fib_entry) More...
 

Macro Definition Documentation

◆ IP_PMTU_DBG

#define IP_PMTU_DBG (   _fmt,
  _args... 
)
Value:
{ \
vlib_log_debug (ip_pmtu_logger, _fmt ": ", ##_args); \
}

Definition at line 94 of file ip_path_mtu.c.

◆ IP_PMTU_TRKR_DBG

#define IP_PMTU_TRKR_DBG (   _ipt,
  _fmt,
  _args... 
)
Value:
{ \
vlib_log_debug (ip_pmtu_logger, "[%U]: " _fmt ": ", format_ip_pmtu(), \
_ipt - ip_pmtu_pool, ##_args); \
}

Definition at line 89 of file ip_path_mtu.c.

Typedef Documentation

◆ ip_path_mtu_adj_delegate_t

Delegate added to adjacencies to track path MTU.

◆ ip_path_mtu_walk_sweep_ctx_t

◆ ip_pmtu_key_t

typedef struct ip_pmtu_key_t_ ip_pmtu_key_t

Function Documentation

◆ format_ip_path_mtu_adj_delegate()

static u8* format_ip_path_mtu_adj_delegate ( const adj_delegate_t aed,
u8 s 
)
static

Definition at line 156 of file ip_path_mtu.c.

◆ format_ip_pmtu()

static u8* format_ip_pmtu ( u8 s,
va_list *  ap 
)
static

Definition at line 135 of file ip_path_mtu.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ format_ip_pmtu_dpo()

u8* format_ip_pmtu_dpo ( u8 s,
va_list *  ap 
)

Definition at line 372 of file ip_path_mtu.c.

+ Here is the call graph for this function:

◆ format_ip_pmtu_flags()

static u8* format_ip_pmtu_flags ( u8 s,
va_list *  ap 
)
static

Definition at line 100 of file ip_path_mtu.c.

+ Here is the caller graph for this function:

◆ ip_mtu_fib_entry_is_attached()

static bool ip_mtu_fib_entry_is_attached ( fib_node_index_t  fib_entry)
static

Definition at line 449 of file ip_path_mtu.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ip_path_module_init()

static clib_error_t* ip_path_module_init ( vlib_main_t vm)
static

Definition at line 823 of file ip_path_mtu.c.

+ Here is the call graph for this function:

◆ ip_path_mtu_replace_begin()

int ip_path_mtu_replace_begin ( void  )

Definition at line 718 of file ip_path_mtu.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ip_path_mtu_replace_end()

int ip_path_mtu_replace_end ( void  )

Definition at line 728 of file ip_path_mtu.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ip_path_mtu_update()

int ip_path_mtu_update ( const ip_address_t nh,
u32  table_id,
u16  pmtu 
)

Definition at line 647 of file ip_path_mtu.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ip_path_mtu_value_invalid()

static bool ip_path_mtu_value_invalid ( u16  pmtu)
static

Definition at line 248 of file ip_path_mtu.c.

+ Here is the caller graph for this function:

◆ ip_path_mtu_walk()

void ip_path_mtu_walk ( ip_path_mtu_walk_t  fn,
void *  ctx 
)

Definition at line 760 of file ip_path_mtu.c.

+ Here is the caller graph for this function:

◆ ip_path_mtu_walk_mark()

static walk_rc_t ip_path_mtu_walk_mark ( index_t  ipti,
void *  ctx 
)
static

Definition at line 685 of file ip_path_mtu.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ip_path_mtu_walk_sweep()

static walk_rc_t ip_path_mtu_walk_sweep ( index_t  ipti,
void *  arg 
)
static

Definition at line 702 of file ip_path_mtu.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ip_pmtu_adj_delegate_adj_created()

static void ip_pmtu_adj_delegate_adj_created ( adj_index_t  ai)
static

Definition at line 168 of file ip_path_mtu.c.

+ Here is the call graph for this function:

◆ ip_pmtu_adj_delegate_adj_deleted()

static void ip_pmtu_adj_delegate_adj_deleted ( adj_delegate_t ad)
static

Definition at line 225 of file ip_path_mtu.c.

◆ ip_pmtu_adj_delegate_adj_modified()

static void ip_pmtu_adj_delegate_adj_modified ( adj_delegate_t ad)
static

Definition at line 231 of file ip_path_mtu.c.

+ Here is the call graph for this function:

◆ ip_pmtu_alloc()

static index_t ip_pmtu_alloc ( u32  fib_index,
const fib_prefix_t pfx,
const ip_pmtu_key_t key,
u16  pmtu 
)
static

Definition at line 469 of file ip_path_mtu.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ip_pmtu_back_walk_notify()

static fib_node_back_walk_rc_t ip_pmtu_back_walk_notify ( fib_node_t node,
fib_node_back_walk_ctx_t ctx 
)
static

Definition at line 801 of file ip_path_mtu.c.

+ Here is the call graph for this function:

◆ ip_pmtu_destroy()

static index_t ip_pmtu_destroy ( index_t  ipti,
const ip_pmtu_key_t key 
)
static

Definition at line 613 of file ip_path_mtu.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ip_pmtu_dpo_add_or_lock()

void ip_pmtu_dpo_add_or_lock ( fib_protocol_t  fproto,
u16  pmtu,
dpo_id_t dpo 
)

Definition at line 356 of file ip_path_mtu.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ip_pmtu_dpo_alloc()

static ip_pmtu_dpo_t* ip_pmtu_dpo_alloc ( void  )
static

Definition at line 298 of file ip_path_mtu.c.

+ Here is the caller graph for this function:

◆ ip_pmtu_dpo_get_from_dpo()

static ip_pmtu_dpo_t* ip_pmtu_dpo_get_from_dpo ( const dpo_id_t dpo)
static

Definition at line 308 of file ip_path_mtu.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ip_pmtu_dpo_get_index()

static index_t ip_pmtu_dpo_get_index ( ip_pmtu_dpo_t ipm)
static

Definition at line 316 of file ip_path_mtu.c.

+ Here is the caller graph for this function:

◆ ip_pmtu_dpo_get_mtu()

static u16 ip_pmtu_dpo_get_mtu ( const dpo_id_t dpo)
static

Definition at line 408 of file ip_path_mtu.c.

◆ ip_pmtu_dpo_get_urpf()

static u32 ip_pmtu_dpo_get_urpf ( const dpo_id_t dpo)
static

Definition at line 346 of file ip_path_mtu.c.

+ Here is the call graph for this function:

◆ ip_pmtu_dpo_interpose()

static void ip_pmtu_dpo_interpose ( const dpo_id_t original,
const dpo_id_t parent,
dpo_id_t clone 
)
static

Interpose a path MTU DPO.

Definition at line 390 of file ip_path_mtu.c.

+ Here is the call graph for this function:

◆ ip_pmtu_dpo_lock()

static void ip_pmtu_dpo_lock ( dpo_id_t dpo)
static

Definition at line 322 of file ip_path_mtu.c.

+ Here is the call graph for this function:

◆ ip_pmtu_dpo_unlock()

static void ip_pmtu_dpo_unlock ( dpo_id_t dpo)
static

Definition at line 331 of file ip_path_mtu.c.

+ Here is the call graph for this function:

◆ ip_pmtu_get_from_node()

static ip_pmtu_t* ip_pmtu_get_from_node ( fib_node_t node)
static

Definition at line 782 of file ip_path_mtu.c.

+ Here is the caller graph for this function:

◆ ip_pmtu_get_ip()

void ip_pmtu_get_ip ( const ip_pmtu_t ipt,
ip_address_t ip 
)

Definition at line 126 of file ip_path_mtu.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ip_pmtu_get_node()

static fib_node_t* ip_pmtu_get_node ( fib_node_index_t  index)
static

Definition at line 772 of file ip_path_mtu.c.

◆ ip_pmtu_get_table_id()

u32 ip_pmtu_get_table_id ( const ip_pmtu_t ipt)

Definition at line 114 of file ip_path_mtu.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ip_pmtu_last_lock_gone()

static void ip_pmtu_last_lock_gone ( fib_node_t node)
static

Definition at line 789 of file ip_path_mtu.c.

◆ ip_pmtu_stack()

static void ip_pmtu_stack ( ip_pmtu_t ipt)
static

Definition at line 532 of file ip_path_mtu.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ip_pmtu_update()

static void ip_pmtu_update ( index_t  ipti,
u16  pmtu 
)
static

Definition at line 601 of file ip_path_mtu.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ip_ptmu_adj_walk_remove()

static adj_walk_rc_t ip_ptmu_adj_walk_remove ( adj_index_t  ai,
void *  ctx 
)
static

Definition at line 254 of file ip_path_mtu.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ip_ptmu_adj_walk_update()

static adj_walk_rc_t ip_ptmu_adj_walk_update ( adj_index_t  ai,
void *  ctx 
)
static

Definition at line 271 of file ip_path_mtu.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ show_ip_pmtu_command()

static clib_error_t* show_ip_pmtu_command ( vlib_main_t vm,
unformat_input_t input,
vlib_cli_command_t cmd 
)
static

Definition at line 842 of file ip_path_mtu.c.

+ Here is the call graph for this function:

Variable Documentation

◆ ip_path_adj_delegate_vft

const adj_delegate_vft_t ip_path_adj_delegate_vft
Initial value:
= {
.adv_adj_modified = ip_pmtu_adj_delegate_adj_modified,
}

Definition at line 240 of file ip_path_mtu.c.

◆ ip_path_mtu_adj_delegate_pool

ip_path_mtu_adj_delegate_t* ip_path_mtu_adj_delegate_pool
static

Definition at line 77 of file ip_path_mtu.c.

◆ ip_pmtu_adj_delegate_type

adj_delegate_type_t ip_pmtu_adj_delegate_type
static

Definition at line 46 of file ip_path_mtu.c.

◆ ip_pmtu_db

uword* ip_pmtu_db
static

Definition at line 87 of file ip_path_mtu.c.

◆ ip_pmtu_dpo_ip4_nodes

const static char* const ip_pmtu_dpo_ip4_nodes[]
static
Initial value:
= {
"ip4-pmtu-dpo",
NULL,
}

The per-protocol VLIB graph nodes that are assigned to a glean object.

this means that these graph nodes are ones from which a glean is the parent object in the DPO-graph.

Definition at line 433 of file ip_path_mtu.c.

◆ ip_pmtu_dpo_ip6_nodes

const static char* const ip_pmtu_dpo_ip6_nodes[]
static
Initial value:
= {
"ip6-pmtu-dpo",
NULL,
}

Definition at line 438 of file ip_path_mtu.c.

◆ ip_pmtu_dpo_nodes

const static char* const * const ip_pmtu_dpo_nodes[DPO_PROTO_NUM]
static
Initial value:

Definition at line 443 of file ip_path_mtu.c.

◆ ip_pmtu_dpo_pool

ip_pmtu_dpo_t* ip_pmtu_dpo_pool

DPO pool.

Data-plane accessor functions.

Definition at line 52 of file ip_path_mtu.c.

◆ ip_pmtu_dpo_type

dpo_type_t ip_pmtu_dpo_type
static

DPO type registered for these GBP FWD.

Definition at line 57 of file ip_path_mtu.c.

◆ ip_pmtu_dpo_vft

const static dpo_vft_t ip_pmtu_dpo_vft
static
Initial value:
= {
.dv_lock = ip_pmtu_dpo_lock,
.dv_unlock = ip_pmtu_dpo_unlock,
.dv_format = format_ip_pmtu_dpo,
.dv_get_urpf = ip_pmtu_dpo_get_urpf,
.dv_mk_interpose = ip_pmtu_dpo_interpose,
.dv_get_mtu = ip_pmtu_dpo_get_mtu,
}

Definition at line 417 of file ip_path_mtu.c.

◆ ip_pmtu_fib_type

fib_node_type_t ip_pmtu_fib_type
static

Fib node type for the tracker.

Definition at line 62 of file ip_path_mtu.c.

◆ ip_pmtu_logger

vlib_log_class_t ip_pmtu_logger
static

Path MTU.

A path is a peer. A peer is known by an IP address (in a table). Insert a DPO in the forwarding chain for the peer to perform the fragmentation. For attached peers, all traffic will use the peer's adjacency, there is already an MTU chekc in the adjacency (for the link's MTU) so as an optimisation, instead of using a DPO, we add a delegate to the adjacency to set the adjacency's MTU to the path MTU. the logger

Definition at line 44 of file ip_path_mtu.c.

◆ ip_pmtu_pool

ip_pmtu_t* ip_pmtu_pool

Path MTU tracker pool.

Definition at line 67 of file ip_path_mtu.c.

◆ ip_pmtu_source

fib_source_t ip_pmtu_source
static

Definition at line 47 of file ip_path_mtu.c.

◆ ip_ptmu_fib_node_vft

const fib_node_vft_t ip_ptmu_fib_node_vft
static
Initial value:
= {
.fnv_get = ip_pmtu_get_node,
.fnv_last_lock = ip_pmtu_last_lock_gone,
.fnv_back_walk = ip_pmtu_back_walk_notify,
}

Definition at line 816 of file ip_path_mtu.c.

◆ show_fib_entry

vlib_cli_command_t show_fib_entry
static
Initial value:
= {
.path = "show ip pmtu",
.function = show_ip_pmtu_command,
.short_help = "show ip path MTU",
}

(constructor) VLIB_CLI_COMMAND (show_fib_entry)

Definition at line 871 of file ip_path_mtu.c.

ip_pmtu_dpo_lock
static void ip_pmtu_dpo_lock(dpo_id_t *dpo)
Definition: ip_path_mtu.c:322
format_ip_pmtu
static u8 * format_ip_pmtu(u8 *s, va_list *ap)
Definition: ip_path_mtu.c:135
ip_pmtu_dpo_get_mtu
static u16 ip_pmtu_dpo_get_mtu(const dpo_id_t *dpo)
Definition: ip_path_mtu.c:408
ip_pmtu_dpo_ip4_nodes
const static char *const ip_pmtu_dpo_ip4_nodes[]
The per-protocol VLIB graph nodes that are assigned to a glean object.
Definition: ip_path_mtu.c:433
format_ip_path_mtu_adj_delegate
static u8 * format_ip_path_mtu_adj_delegate(const adj_delegate_t *aed, u8 *s)
Definition: ip_path_mtu.c:156
format_ip_pmtu_dpo
u8 * format_ip_pmtu_dpo(u8 *s, va_list *ap)
Definition: ip_path_mtu.c:372
ip_pmtu_dpo_ip6_nodes
const static char *const ip_pmtu_dpo_ip6_nodes[]
Definition: ip_path_mtu.c:438
ip_pmtu_adj_delegate_adj_created
static void ip_pmtu_adj_delegate_adj_created(adj_index_t ai)
Definition: ip_path_mtu.c:168
ip_pmtu_dpo_get_urpf
static u32 ip_pmtu_dpo_get_urpf(const dpo_id_t *dpo)
Definition: ip_path_mtu.c:346
ip_pmtu_dpo_interpose
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.
Definition: ip_path_mtu.c:390
ip_pmtu_logger
static vlib_log_class_t ip_pmtu_logger
Path MTU.
Definition: ip_path_mtu.c:44
ip_pmtu_back_walk_notify
static fib_node_back_walk_rc_t ip_pmtu_back_walk_notify(fib_node_t *node, fib_node_back_walk_ctx_t *ctx)
Definition: ip_path_mtu.c:801
ip_pmtu_get_node
static fib_node_t * ip_pmtu_get_node(fib_node_index_t index)
Definition: ip_path_mtu.c:772
ip_pmtu_pool
ip_pmtu_t * ip_pmtu_pool
Path MTU tracker pool.
Definition: ip_path_mtu.c:67
ip_pmtu_adj_delegate_adj_modified
static void ip_pmtu_adj_delegate_adj_modified(adj_delegate_t *ad)
Definition: ip_path_mtu.c:231
show_ip_pmtu_command
static clib_error_t * show_ip_pmtu_command(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: ip_path_mtu.c:842
DPO_PROTO_IP6
@ DPO_PROTO_IP6
Definition: dpo.h:65
ip_pmtu_adj_delegate_adj_deleted
static void ip_pmtu_adj_delegate_adj_deleted(adj_delegate_t *ad)
Definition: ip_path_mtu.c:225
ip_pmtu_dpo_unlock
static void ip_pmtu_dpo_unlock(dpo_id_t *dpo)
Definition: ip_path_mtu.c:331
DPO_PROTO_IP4
@ DPO_PROTO_IP4
Definition: dpo.h:64
ip_pmtu_last_lock_gone
static void ip_pmtu_last_lock_gone(fib_node_t *node)
Definition: ip_path_mtu.c:789