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

Go to the source code of this file.

Functions

static u32 adj_get_mcast_node (fib_protocol_t proto)
 
adj_index_t adj_mcast_add_or_lock (fib_protocol_t proto, vnet_link_t link_type, u32 sw_if_index)
 Mcast Adjacency. More...
 
void adj_mcast_update_rewrite (adj_index_t adj_index, u8 *rewrite, u8 offset)
 adj_mcast_update_rewrite More...
 
void adj_mcast_midchain_update_rewrite (adj_index_t adj_index, adj_midchain_fixup_t fixup, const void *fixup_data, adj_flags_t flags, u8 *rewrite, u8 offset, u32 mask)
 adj_mcast_midchain_update_rewrite More...
 
void adj_mcast_remove (fib_protocol_t proto, u32 sw_if_index)
 
static clib_error_tadj_mcast_interface_state_change (vnet_main_t *vnm, u32 sw_if_index, u32 flags)
 
 VNET_SW_INTERFACE_ADMIN_UP_DOWN_FUNCTION (adj_mcast_interface_state_change)
 
static walk_rc_t adj_mcast_hw_sw_interface_state_change (vnet_main_t *vnm, u32 sw_if_index, void *arg)
 Invoked on each SW interface of a HW interface when the HW interface state changes. More...
 
static clib_error_tadj_mcast_hw_interface_state_change (vnet_main_t *vnm, u32 hw_if_index, u32 flags)
 Registered callback for HW interface state changes. More...
 
 VNET_HW_INTERFACE_LINK_UP_DOWN_FUNCTION (adj_mcast_hw_interface_state_change)
 
static clib_error_tadj_mcast_interface_delete (vnet_main_t *vnm, u32 sw_if_index, u32 is_add)
 
 VNET_SW_INTERFACE_ADD_DEL_FUNCTION (adj_mcast_interface_delete)
 
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. More...
 
u8format_adj_mcast (u8 *s, va_list *ap)
 Format/display a mcast adjacency. More...
 
u8format_adj_mcast_midchain (u8 *s, va_list *ap)
 
static void adj_dpo_lock (dpo_id_t *dpo)
 
static void adj_dpo_unlock (dpo_id_t *dpo)
 
u32 adj_mcast_db_size (void)
 Return the size of the adj DB. More...
 
void adj_mcast_module_init (void)
 Module initialisation. More...
 

Variables

static adj_index_tadj_mcasts [FIB_PROTOCOL_MAX]
 
const static dpo_vft_t adj_mcast_dpo_vft
 
const static dpo_vft_t adj_mcast_midchain_dpo_vft
 
const static char *const adj_mcast_ip4_nodes []
 The per-protocol VLIB graph nodes that are assigned to a mcast object. More...
 
const static char *const adj_mcast_ip6_nodes []
 
const static char *const *const adj_mcast_nodes [DPO_PROTO_NUM]
 
const static char *const adj_mcast_midchain_ip4_nodes []
 The per-protocol VLIB graph nodes that are assigned to a mcast object. More...
 
const static char *const adj_mcast_midchain_ip6_nodes []
 
const static char *const *const adj_mcast_midchain_nodes [DPO_PROTO_NUM]
 

Function Documentation

◆ adj_dpo_lock()

static void adj_dpo_lock ( dpo_id_t dpo)
static

Definition at line 376 of file adj_mcast.c.

+ Here is the call graph for this function:

◆ adj_dpo_unlock()

static void adj_dpo_unlock ( dpo_id_t dpo)
static

Definition at line 381 of file adj_mcast.c.

+ Here is the call graph for this function:

◆ adj_get_mcast_node()

static u32 adj_get_mcast_node ( fib_protocol_t  proto)
static

Definition at line 29 of file adj_mcast.c.

+ Here is the caller graph for this function:

◆ adj_mcast_add_or_lock()

adj_index_t adj_mcast_add_or_lock ( fib_protocol_t  proto,
vnet_link_t  link_type,
u32  sw_if_index 
)

Mcast Adjacency.

The multicast adjacency forwards IP traffic on an interface toward a multicast group address. This is a different type of adjacency to a unicast adjacency since the application of the MAC header is different, and so the VLIB node visited is also different. DPO types have different VLIB nodes.

Add (and lock) a new or lock an existing mcast adjacency

Parameters
protoThe protocol for the neighbours that we wish to mcast
link_typeA description of the protocol of the packets that will forward through this adj. On an ethernet interface this is the MAC header's ether-type
sw_if_indexThe interface on which to mcast

Definition at line 51 of file adj_mcast.c.

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

◆ adj_mcast_db_size()

u32 adj_mcast_db_size ( void  )

Return the size of the adj DB.

Get the sze of the mcast adj DB.

This is only for testing purposes so an efficient implementation is not needed

Definition at line 456 of file adj_mcast.c.

◆ adj_mcast_hw_interface_state_change()

static clib_error_t* adj_mcast_hw_interface_state_change ( vnet_main_t vnm,
u32  hw_if_index,
u32  flags 
)
static

Registered callback for HW interface state changes.

Definition at line 240 of file adj_mcast.c.

+ Here is the call graph for this function:

◆ adj_mcast_hw_sw_interface_state_change()

static walk_rc_t adj_mcast_hw_sw_interface_state_change ( vnet_main_t vnm,
u32  sw_if_index,
void *  arg 
)
static

Invoked on each SW interface of a HW interface when the HW interface state changes.

Definition at line 227 of file adj_mcast.c.

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

◆ adj_mcast_interface_delete()

static clib_error_t* adj_mcast_interface_delete ( vnet_main_t vnm,
u32  sw_if_index,
u32  is_add 
)
static

Definition at line 264 of file adj_mcast.c.

+ Here is the call graph for this function:

◆ adj_mcast_interface_state_change()

static clib_error_t* adj_mcast_interface_state_change ( vnet_main_t vnm,
u32  sw_if_index,
u32  flags 
)
static

Definition at line 189 of file adj_mcast.c.

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

◆ adj_mcast_midchain_update_rewrite()

void adj_mcast_midchain_update_rewrite ( adj_index_t  adj_index,
adj_midchain_fixup_t  fixup,
const void *  fixup_data,
adj_flags_t  flags,
u8 rewrite,
u8  offset,
u32  mask 
)

adj_mcast_midchain_update_rewrite

Update the rewrite string for an existing adjacecny and Convert the adjacency into a midchain.

Update the adjacency's rewrite string. A NULL string implies the rewrite is reset (i.e. when ARP/ND entry is gone). NB: the adj being updated may be handling traffic in the DP.

Definition at line 139 of file adj_mcast.c.

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

◆ adj_mcast_module_init()

void adj_mcast_module_init ( void  )

Module initialisation.

Definition at line 479 of file adj_mcast.c.

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

◆ adj_mcast_remove()

void adj_mcast_remove ( fib_protocol_t  proto,
u32  sw_if_index 
)

Definition at line 180 of file adj_mcast.c.

+ Here is the caller graph for this function:

◆ adj_mcast_update_rewrite()

void adj_mcast_update_rewrite ( adj_index_t  adj_index,
u8 rewrite,
u8  offset 
)

adj_mcast_update_rewrite

Update the rewrite string for an existing adjacecny.

Update the adjacency's rewrite string. A NULL string implies the rewrite is reset (i.e. when ARP/ND entry is gone). NB: the adj being updated may be handling traffic in the DP.

Definition at line 105 of file adj_mcast.c.

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

◆ adj_mcast_walk()

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.

Definition at line 316 of file adj_mcast.c.

+ Here is the caller graph for this function:

◆ format_adj_mcast()

u8* format_adj_mcast ( u8 s,
va_list *  ap 
)

Format/display a mcast adjacency.

Definition at line 331 of file adj_mcast.c.

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

◆ format_adj_mcast_midchain()

u8* format_adj_mcast_midchain ( u8 s,
va_list *  ap 
)

Definition at line 354 of file adj_mcast.c.

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

◆ VNET_HW_INTERFACE_LINK_UP_DOWN_FUNCTION()

VNET_HW_INTERFACE_LINK_UP_DOWN_FUNCTION ( adj_mcast_hw_interface_state_change  )

◆ VNET_SW_INTERFACE_ADD_DEL_FUNCTION()

VNET_SW_INTERFACE_ADD_DEL_FUNCTION ( adj_mcast_interface_delete  )

◆ VNET_SW_INTERFACE_ADMIN_UP_DOWN_FUNCTION()

VNET_SW_INTERFACE_ADMIN_UP_DOWN_FUNCTION ( adj_mcast_interface_state_change  )

Variable Documentation

◆ adj_mcast_dpo_vft

const static dpo_vft_t adj_mcast_dpo_vft
static
Initial value:
= {
.dv_lock = adj_dpo_lock,
.dv_unlock = adj_dpo_unlock,
.dv_format = format_adj_mcast,
.dv_get_urpf = adj_dpo_get_urpf,
.dv_get_mtu = adj_dpo_get_mtu,
}

Definition at line 386 of file adj_mcast.c.

◆ adj_mcast_ip4_nodes

const static char* const adj_mcast_ip4_nodes[]
static
Initial value:
=
{
"ip4-rewrite-mcast",
NULL,
}

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

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

Definition at line 408 of file adj_mcast.c.

◆ adj_mcast_ip6_nodes

const static char* const adj_mcast_ip6_nodes[]
static
Initial value:
=
{
"ip6-rewrite-mcast",
NULL,
}

Definition at line 413 of file adj_mcast.c.

◆ adj_mcast_midchain_dpo_vft

const static dpo_vft_t adj_mcast_midchain_dpo_vft
static
Initial value:
= {
.dv_lock = adj_dpo_lock,
.dv_unlock = adj_dpo_unlock,
.dv_get_urpf = adj_dpo_get_urpf,
.dv_get_mtu = adj_dpo_get_mtu,
}

Definition at line 393 of file adj_mcast.c.

◆ adj_mcast_midchain_ip4_nodes

const static char* const adj_mcast_midchain_ip4_nodes[]
static
Initial value:
=
{
"ip4-mcast-midchain",
NULL,
}

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

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

Definition at line 433 of file adj_mcast.c.

◆ adj_mcast_midchain_ip6_nodes

const static char* const adj_mcast_midchain_ip6_nodes[]
static
Initial value:
=
{
"ip6-mcast-midchain",
NULL,
}

Definition at line 438 of file adj_mcast.c.

◆ adj_mcast_midchain_nodes

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

Definition at line 444 of file adj_mcast.c.

◆ adj_mcast_nodes

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

Definition at line 419 of file adj_mcast.c.

◆ adj_mcasts

adj_index_t* adj_mcasts[FIB_PROTOCOL_MAX]
static

Definition at line 26 of file adj_mcast.c.

adj_dpo_get_urpf
u32 adj_dpo_get_urpf(const dpo_id_t *dpo)
Definition: adj.c:321
adj_mcast_midchain_ip6_nodes
const static char *const adj_mcast_midchain_ip6_nodes[]
Definition: adj_mcast.c:438
adj_dpo_get_mtu
u16 adj_dpo_get_mtu(const dpo_id_t *dpo)
Definition: adj.c:331
adj_dpo_unlock
static void adj_dpo_unlock(dpo_id_t *dpo)
Definition: adj_mcast.c:381
format_adj_mcast
u8 * format_adj_mcast(u8 *s, va_list *ap)
Format/display a mcast adjacency.
Definition: adj_mcast.c:331
adj_mcast_midchain_ip4_nodes
const static char *const adj_mcast_midchain_ip4_nodes[]
The per-protocol VLIB graph nodes that are assigned to a mcast object.
Definition: adj_mcast.c:433
format_adj_mcast_midchain
u8 * format_adj_mcast_midchain(u8 *s, va_list *ap)
Definition: adj_mcast.c:354
adj_dpo_lock
static void adj_dpo_lock(dpo_id_t *dpo)
Definition: adj_mcast.c:376
adj_mcast_ip4_nodes
const static char *const adj_mcast_ip4_nodes[]
The per-protocol VLIB graph nodes that are assigned to a mcast object.
Definition: adj_mcast.c:408
adj_mcast_ip6_nodes
const static char *const adj_mcast_ip6_nodes[]
Definition: adj_mcast.c:413
DPO_PROTO_IP6
@ DPO_PROTO_IP6
Definition: dpo.h:65
DPO_PROTO_MPLS
@ DPO_PROTO_MPLS
Definition: dpo.h:66
DPO_PROTO_IP4
@ DPO_PROTO_IP4
Definition: dpo.h:64