FD.io VPP  v20.05.1-6-gf53edbc3b
Vector Packet Processing
replicate_dpo.c File Reference
+ Include dependency graph for replicate_dpo.c:

Go to the source code of this file.

Data Structures

struct  replicate_trace_t_
 

Macros

#define REP_DBG(_rep, _fmt, _args...)
 
#define foreach_replicate_dpo_error   _(BUFFER_ALLOCATION_FAILURE, "Buffer Allocation Failure")
 

Typedefs

typedef struct replicate_trace_t_ replicate_trace_t
 

Enumerations

enum  replicate_dpo_error_t { REPLICATE_DPO_N_ERROR }
 

Functions

static index_t replicate_get_index (const replicate_t *rep)
 
static dpo_id_treplicate_get_buckets (replicate_t *rep)
 
static replicate_treplicate_alloc_i (void)
 
static u8format_replicate_flags (u8 *s, va_list *args)
 
static u8replicate_format (index_t repi, replicate_format_flags_t flags, u32 indent, u8 *s)
 
u8format_replicate (u8 *s, va_list *args)
 
static u8format_replicate_dpo (u8 *s, va_list *args)
 
static replicate_treplicate_create_i (u32 num_buckets, dpo_proto_t rep_proto)
 
index_t replicate_create (u32 n_buckets, dpo_proto_t rep_proto)
 
static void replicate_set_bucket_i (replicate_t *rep, u32 bucket, dpo_id_t *buckets, const dpo_id_t *next)
 
void replicate_set_bucket (index_t repi, u32 bucket, const dpo_id_t *next)
 
int replicate_is_drop (const dpo_id_t *dpo)
 
const dpo_id_treplicate_get_bucket (index_t repi, u32 bucket)
 
static load_balance_path_treplicate_multipath_next_hop_fixup (load_balance_path_t *nhs, dpo_proto_t drop_proto)
 
static void replicate_fill_buckets (replicate_t *rep, load_balance_path_t *nhs, dpo_id_t *buckets, u32 n_buckets)
 
static void replicate_set_n_buckets (replicate_t *rep, u32 n_buckets)
 
void replicate_multipath_update (const dpo_id_t *dpo, load_balance_path_t *next_hops)
 
static void replicate_lock (dpo_id_t *dpo)
 
index_t replicate_dup (replicate_flags_t flags, index_t repi)
 
static void replicate_destroy (replicate_t *rep)
 
static void replicate_unlock (dpo_id_t *dpo)
 
static void replicate_mem_show (void)
 
void replicate_module_init (void)
 
static clib_error_treplicate_show (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
 
static uword replicate_inline (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
 
static u8format_replicate_trace (u8 *s, va_list *args)
 
static uword ip4_replicate (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
 
static uword ip6_replicate (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
 
static uword mpls_replicate (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
 
clib_error_treplicate_dpo_init (vlib_main_t *vm)
 

Variables

vlib_log_class_t replicate_logger
 the logger More...
 
static char * replicate_dpo_error_strings []
 
replicate_treplicate_pool
 Pool of all DPOs. More...
 
replicate_main_t replicate_main
 The one instance of replicate main. More...
 
static const dpo_vft_t rep_vft
 
static const char *const replicate_ip4_nodes []
 The per-protocol VLIB graph nodes that are assigned to a replicate object. More...
 
static const char *const replicate_ip6_nodes []
 
static const char *const replicate_mpls_nodes []
 
static const char *const *const replicate_nodes [DPO_PROTO_NUM]
 
static vlib_cli_command_t replicate_show_command
 (constructor) VLIB_CLI_COMMAND (replicate_show_command) More...
 
vlib_node_registration_t ip4_replicate_node
 IP4 replication node. More...
 
vlib_node_registration_t ip6_replicate_node
 IPv6 replication node. More...
 
vlib_node_registration_t mpls_replicate_node
 MPLS replication node. More...
 

Macro Definition Documentation

◆ foreach_replicate_dpo_error

#define foreach_replicate_dpo_error   _(BUFFER_ALLOCATION_FAILURE, "Buffer Allocation Failure")

Definition at line 38 of file replicate_dpo.c.

◆ REP_DBG

#define REP_DBG (   _rep,
  _fmt,
  _args... 
)
Value:
{ \
vlib_log_debug(replicate_logger, \
"rep:[%U]:" _fmt, \
##_args); \
}
vlib_log_class_t replicate_logger
the logger
Definition: replicate_dpo.c:26
static index_t replicate_get_index(const replicate_t *rep)
Definition: replicate_dpo.c:70
u8 * format_replicate(u8 *s, va_list *args)

Definition at line 28 of file replicate_dpo.c.

Typedef Documentation

◆ replicate_trace_t

Enumeration Type Documentation

◆ replicate_dpo_error_t

Enumerator
REPLICATE_DPO_N_ERROR 

Definition at line 41 of file replicate_dpo.c.

Function Documentation

◆ format_replicate()

u8* format_replicate ( u8 s,
va_list *  args 
)

Definition at line 152 of file replicate_dpo.c.

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

◆ format_replicate_dpo()

static u8* format_replicate_dpo ( u8 s,
va_list *  args 
)
static

Definition at line 160 of file replicate_dpo.c.

+ Here is the call graph for this function:

◆ format_replicate_flags()

static u8* format_replicate_flags ( u8 s,
va_list *  args 
)
static

Definition at line 105 of file replicate_dpo.c.

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

◆ format_replicate_trace()

static u8* format_replicate_trace ( u8 s,
va_list *  args 
)
static

Definition at line 820 of file replicate_dpo.c.

+ Here is the call graph for this function:

◆ ip4_replicate()

static uword ip4_replicate ( vlib_main_t vm,
vlib_node_runtime_t node,
vlib_frame_t frame 
)
static

Definition at line 833 of file replicate_dpo.c.

+ Here is the call graph for this function:

◆ ip6_replicate()

static uword ip6_replicate ( vlib_main_t vm,
vlib_node_runtime_t node,
vlib_frame_t frame 
)
static

Definition at line 859 of file replicate_dpo.c.

+ Here is the call graph for this function:

◆ mpls_replicate()

static uword mpls_replicate ( vlib_main_t vm,
vlib_node_runtime_t node,
vlib_frame_t frame 
)
static

Definition at line 885 of file replicate_dpo.c.

+ Here is the call graph for this function:

◆ replicate_alloc_i()

static replicate_t* replicate_alloc_i ( void  )
static

Definition at line 89 of file replicate_dpo.c.

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

◆ replicate_create()

index_t replicate_create ( u32  n_buckets,
dpo_proto_t  rep_proto 
)

Definition at line 192 of file replicate_dpo.c.

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

◆ replicate_create_i()

static replicate_t* replicate_create_i ( u32  num_buckets,
dpo_proto_t  rep_proto 
)
static

Definition at line 170 of file replicate_dpo.c.

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

◆ replicate_destroy()

static void replicate_destroy ( replicate_t rep)
static

Definition at line 584 of file replicate_dpo.c.

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

◆ replicate_dpo_init()

clib_error_t* replicate_dpo_init ( vlib_main_t vm)

Definition at line 911 of file replicate_dpo.c.

+ Here is the call graph for this function:

◆ replicate_dup()

index_t replicate_dup ( replicate_flags_t  flags,
index_t  repi 
)

Definition at line 523 of file replicate_dpo.c.

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

◆ replicate_fill_buckets()

static void replicate_fill_buckets ( replicate_t rep,
load_balance_path_t nhs,
dpo_id_t buckets,
u32  n_buckets 
)
static

Definition at line 289 of file replicate_dpo.c.

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

◆ replicate_format()

static u8* replicate_format ( index_t  repi,
replicate_format_flags_t  flags,
u32  indent,
u8 s 
)
static

Definition at line 122 of file replicate_dpo.c.

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

◆ replicate_get_bucket()

const dpo_id_t* replicate_get_bucket ( index_t  repi,
u32  bucket 
)

Definition at line 252 of file replicate_dpo.c.

+ Here is the call graph for this function:

◆ replicate_get_buckets()

static dpo_id_t* replicate_get_buckets ( replicate_t rep)
inlinestatic

Definition at line 76 of file replicate_dpo.c.

+ Here is the caller graph for this function:

◆ replicate_get_index()

static index_t replicate_get_index ( const replicate_t rep)
inlinestatic

Definition at line 70 of file replicate_dpo.c.

+ Here is the caller graph for this function:

◆ replicate_inline()

static uword replicate_inline ( vlib_main_t vm,
vlib_node_runtime_t node,
vlib_frame_t frame 
)
static

Definition at line 724 of file replicate_dpo.c.

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

◆ replicate_is_drop()

int replicate_is_drop ( const dpo_id_t dpo)

Definition at line 233 of file replicate_dpo.c.

+ Here is the call graph for this function:

◆ replicate_lock()

static void replicate_lock ( dpo_id_t dpo)
static

Definition at line 513 of file replicate_dpo.c.

+ Here is the call graph for this function:

◆ replicate_mem_show()

static void replicate_mem_show ( void  )
static

Definition at line 621 of file replicate_dpo.c.

+ Here is the call graph for this function:

◆ replicate_module_init()

void replicate_module_init ( void  )

Definition at line 667 of file replicate_dpo.c.

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

◆ replicate_multipath_next_hop_fixup()

static load_balance_path_t* replicate_multipath_next_hop_fixup ( load_balance_path_t nhs,
dpo_proto_t  drop_proto 
)
static

Definition at line 265 of file replicate_dpo.c.

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

◆ replicate_multipath_update()

void replicate_multipath_update ( const dpo_id_t dpo,
load_balance_path_t next_hops 
)

Definition at line 318 of file replicate_dpo.c.

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

◆ replicate_set_bucket()

void replicate_set_bucket ( index_t  repi,
u32  bucket,
const dpo_id_t next 
)

Definition at line 216 of file replicate_dpo.c.

+ Here is the call graph for this function:

◆ replicate_set_bucket_i()

static void replicate_set_bucket_i ( replicate_t rep,
u32  bucket,
dpo_id_t buckets,
const dpo_id_t next 
)
inlinestatic

Definition at line 199 of file replicate_dpo.c.

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

◆ replicate_set_n_buckets()

static void replicate_set_n_buckets ( replicate_t rep,
u32  n_buckets 
)
inlinestatic

Definition at line 311 of file replicate_dpo.c.

+ Here is the caller graph for this function:

◆ replicate_show()

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

Definition at line 674 of file replicate_dpo.c.

+ Here is the call graph for this function:

◆ replicate_unlock()

static void replicate_unlock ( dpo_id_t dpo)
static

Definition at line 606 of file replicate_dpo.c.

+ Here is the call graph for this function:

Variable Documentation

◆ ip4_replicate_node

vlib_node_registration_t ip4_replicate_node
Initial value:
= {
.function = ip4_replicate,
.name = "ip4-replicate",
.vector_size = sizeof (u32),
.error_strings = replicate_dpo_error_strings,
.format_trace = format_replicate_trace,
.n_next_nodes = 1,
.next_nodes = {
[0] = "ip4-drop",
},
}
static u8 * format_replicate_trace(u8 *s, va_list *args)
static char * replicate_dpo_error_strings[]
Definition: replicate_dpo.c:48
unsigned int u32
Definition: types.h:88
#define ARRAY_LEN(x)
Definition: clib.h:66
static uword ip4_replicate(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)

IP4 replication node.

(constructor) VLIB_REGISTER_NODE (ip4_replicate_node)

Definition at line 843 of file replicate_dpo.c.

◆ ip6_replicate_node

vlib_node_registration_t ip6_replicate_node
Initial value:
= {
.function = ip6_replicate,
.name = "ip6-replicate",
.vector_size = sizeof (u32),
.error_strings = replicate_dpo_error_strings,
.format_trace = format_replicate_trace,
.n_next_nodes = 1,
.next_nodes = {
[0] = "ip6-drop",
},
}
static u8 * format_replicate_trace(u8 *s, va_list *args)
static char * replicate_dpo_error_strings[]
Definition: replicate_dpo.c:48
unsigned int u32
Definition: types.h:88
static uword ip6_replicate(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
#define ARRAY_LEN(x)
Definition: clib.h:66

IPv6 replication node.

(constructor) VLIB_REGISTER_NODE (ip6_replicate_node)

Definition at line 869 of file replicate_dpo.c.

◆ mpls_replicate_node

vlib_node_registration_t mpls_replicate_node
Initial value:
= {
.function = mpls_replicate,
.name = "mpls-replicate",
.vector_size = sizeof (u32),
.error_strings = replicate_dpo_error_strings,
.format_trace = format_replicate_trace,
.n_next_nodes = 1,
.next_nodes = {
[0] = "mpls-drop",
},
}
static u8 * format_replicate_trace(u8 *s, va_list *args)
static char * replicate_dpo_error_strings[]
Definition: replicate_dpo.c:48
unsigned int u32
Definition: types.h:88
#define ARRAY_LEN(x)
Definition: clib.h:66
static uword mpls_replicate(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)

MPLS replication node.

(constructor) VLIB_REGISTER_NODE (mpls_replicate_node)

Definition at line 895 of file replicate_dpo.c.

◆ rep_vft

const dpo_vft_t rep_vft
static
Initial value:
= {
.dv_lock = replicate_lock,
.dv_unlock = replicate_unlock,
.dv_format = format_replicate_dpo,
.dv_mem_show = replicate_mem_show,
}
static void replicate_unlock(dpo_id_t *dpo)
static void replicate_mem_show(void)
static void replicate_lock(dpo_id_t *dpo)
static u8 * format_replicate_dpo(u8 *s, va_list *args)

Definition at line 629 of file replicate_dpo.c.

◆ replicate_dpo_error_strings

char* replicate_dpo_error_strings[]
static
Initial value:
= {
#define _(sym,string)
}
#define foreach_replicate_dpo_error
Definition: replicate_dpo.c:38

Definition at line 48 of file replicate_dpo.c.

◆ replicate_ip4_nodes

const char* const replicate_ip4_nodes[]
static
Initial value:
=
{
"ip4-replicate",
NULL,
}

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

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

Definition at line 643 of file replicate_dpo.c.

◆ replicate_ip6_nodes

const char* const replicate_ip6_nodes[]
static
Initial value:
=
{
"ip6-replicate",
NULL,
}

Definition at line 648 of file replicate_dpo.c.

◆ replicate_logger

vlib_log_class_t replicate_logger

the logger

Definition at line 26 of file replicate_dpo.c.

◆ replicate_main

replicate_main_t replicate_main
Initial value:
= {
.repm_counters = {
.name = "mroutes",
.stat_segment_name = "/net/mroute",
},
}

The one instance of replicate main.

Definition at line 62 of file replicate_dpo.c.

◆ replicate_mpls_nodes

const char* const replicate_mpls_nodes[]
static
Initial value:
=
{
"mpls-replicate",
NULL,
}

Definition at line 653 of file replicate_dpo.c.

◆ replicate_nodes

const char* const* const replicate_nodes[DPO_PROTO_NUM]
static
Initial value:
=
{
}
static const char *const replicate_ip6_nodes[]
static const char *const replicate_ip4_nodes[]
The per-protocol VLIB graph nodes that are assigned to a replicate object.
static const char *const replicate_mpls_nodes[]

Definition at line 659 of file replicate_dpo.c.

◆ replicate_pool

replicate_t* replicate_pool

Pool of all DPOs.

The encapsulation breakages are for fast DP access.

It's not static so the DP can have fast access

Definition at line 57 of file replicate_dpo.c.

◆ replicate_show_command

vlib_cli_command_t replicate_show_command
static
Initial value:
= {
.path = "show replicate",
.short_help = "show replicate [<index>]",
.function = replicate_show,
}
static clib_error_t * replicate_show(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)

(constructor) VLIB_CLI_COMMAND (replicate_show_command)

Definition at line 711 of file replicate_dpo.c.