FD.io VPP  v18.04-17-g3a0d853
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(_p, _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 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)
 
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

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

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

Definition at line 38 of file replicate_dpo.c.

#define REP_DBG (   _p,
  _fmt,
  _args... 
)

Definition at line 35 of file replicate_dpo.c.

Typedef Documentation

Enumeration Type Documentation

Enumerator
REPLICATE_DPO_N_ERROR 

Definition at line 41 of file replicate_dpo.c.

Function Documentation

u8* format_replicate ( u8 s,
va_list *  args 
)

Definition at line 129 of file replicate_dpo.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Definition at line 137 of file replicate_dpo.c.

+ Here is the call graph for this function:

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

Definition at line 722 of file replicate_dpo.c.

+ Here is the call graph for this function:

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

Definition at line 735 of file replicate_dpo.c.

+ Here is the call graph for this function:

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

Definition at line 761 of file replicate_dpo.c.

+ Here is the call graph for this function:

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

Definition at line 787 of file replicate_dpo.c.

+ Here is the call graph for this function:

static replicate_t* replicate_alloc_i ( void  )
static

Definition at line 84 of file replicate_dpo.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

index_t replicate_create ( u32  n_buckets,
dpo_proto_t  rep_proto 
)

Definition at line 169 of file replicate_dpo.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Definition at line 147 of file replicate_dpo.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void replicate_destroy ( replicate_t rep)
static

Definition at line 492 of file replicate_dpo.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

clib_error_t* replicate_dpo_init ( vlib_main_t vm)

Definition at line 813 of file replicate_dpo.c.

+ Here is the call graph for this function:

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

Definition at line 258 of file replicate_dpo.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Definition at line 100 of file replicate_dpo.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

const dpo_id_t* replicate_get_bucket ( index_t  repi,
u32  bucket 
)

Definition at line 221 of file replicate_dpo.c.

+ Here is the call graph for this function:

static dpo_id_t* replicate_get_buckets ( replicate_t rep)
inlinestatic

Definition at line 71 of file replicate_dpo.c.

+ Here is the caller graph for this function:

static index_t replicate_get_index ( const replicate_t rep)
inlinestatic

Definition at line 65 of file replicate_dpo.c.

+ Here is the caller graph for this function:

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

Definition at line 628 of file replicate_dpo.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int replicate_is_drop ( const dpo_id_t dpo)

Definition at line 202 of file replicate_dpo.c.

+ Here is the call graph for this function:

static void replicate_lock ( dpo_id_t dpo)
static

Definition at line 482 of file replicate_dpo.c.

+ Here is the call graph for this function:

static void replicate_mem_show ( void  )
static

Definition at line 529 of file replicate_dpo.c.

+ Here is the call graph for this function:

void replicate_module_init ( void  )

Definition at line 575 of file replicate_dpo.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Definition at line 234 of file replicate_dpo.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void replicate_multipath_update ( const dpo_id_t dpo,
load_balance_path_t next_hops 
)

Definition at line 287 of file replicate_dpo.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Definition at line 185 of file replicate_dpo.c.

+ Here is the call graph for this function:

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

Definition at line 176 of file replicate_dpo.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void replicate_set_n_buckets ( replicate_t rep,
u32  n_buckets 
)
inlinestatic

Definition at line 280 of file replicate_dpo.c.

+ Here is the caller graph for this function:

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

Definition at line 581 of file replicate_dpo.c.

+ Here is the call graph for this function:

static void replicate_unlock ( dpo_id_t dpo)
static

Definition at line 514 of file replicate_dpo.c.

+ Here is the call graph for this function:

Variable Documentation

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
#define ARRAY_LEN(x)
Definition: clib.h:59
unsigned int u32
Definition: types.h:88
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 745 of file replicate_dpo.c.

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
static uword ip6_replicate(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
#define ARRAY_LEN(x)
Definition: clib.h:59
unsigned int u32
Definition: types.h:88

IPv6 replication node.

(constructor) VLIB_REGISTER_NODE (ip6_replicate_node)

Definition at line 771 of file replicate_dpo.c.

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
#define ARRAY_LEN(x)
Definition: clib.h:59
unsigned int u32
Definition: types.h:88
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 797 of file replicate_dpo.c.

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 537 of file replicate_dpo.c.

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.

const char* const replicate_ip4_nodes[]
static
Initial value:
=
{
"ip4-replicate",
}
#define NULL
Definition: clib.h:55

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 551 of file replicate_dpo.c.

const char* const replicate_ip6_nodes[]
static
Initial value:
=
{
"ip6-replicate",
}
#define NULL
Definition: clib.h:55

Definition at line 556 of file replicate_dpo.c.

replicate_main_t replicate_main

The one instance of replicate main.

Definition at line 62 of file replicate_dpo.c.

const char* const replicate_mpls_nodes[]
static
Initial value:
=
{
"mpls-replicate",
}
#define NULL
Definition: clib.h:55

Definition at line 561 of file replicate_dpo.c.

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 567 of file replicate_dpo.c.

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.

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 615 of file replicate_dpo.c.