FD.io VPP  v17.01-9-ge7dcee4
Vector Packet Processing
sr_replicate.c File Reference

Functions for replicating packets across SR tunnels. More...

+ Include dependency graph for sr_replicate.c:

Go to the source code of this file.

Data Structures

struct  sr_replicate_main_t
 sr_replicate state. More...
 
struct  sr_replicate_trace_t
 Information to display in packet trace. More...
 

Macros

#define foreach_sr_replicate_error
 

Enumerations

enum  sr_replicate_error_t { SR_REPLICATE_N_ERROR }
 Struct for SR replicate errors. More...
 
enum  sr_replicate_next_t { SR_REPLICATE_NEXT_IP6_LOOKUP, SR_REPLICATE_N_NEXT }
 Defines next-nodes for packet processing. More...
 

Functions

static u8format_sr_replicate_trace (u8 *s, va_list *args)
 packet trace format function. More...
 
static uword sr_replicate_node_fn (vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
 Single loop packet replicator. More...
 
clib_error_tsr_replicate_init (vlib_main_t *vm)
 

Variables

sr_replicate_main_t sr_replicate_main
 
static char * sr_replicate_error_strings []
 Error strings for SR replicate. More...
 
vlib_node_registration_t sr_replicate_node
 (constructor) VLIB_REGISTER_NODE (sr_replicate_node) More...
 

Detailed Description

Functions for replicating packets across SR tunnels.

Leverages rte_pktmbuf_clone() so there is no memcpy for invariant parts of the packet.

Note
Currently requires DPDK

Definition in file sr_replicate.c.

Macro Definition Documentation

#define foreach_sr_replicate_error
Value:
_(REPLICATED, "sr packets replicated") \
_(NO_BUFFERS, "error allocating buffers for replicas") \
_(NO_REPLICAS, "no replicas were needed") \
_(NO_BUFFER_DROPS, "sr no buffer drops")

Definition at line 98 of file sr_replicate.c.

Enumeration Type Documentation

Struct for SR replicate errors.

Enumerator
SR_REPLICATE_N_ERROR 

Definition at line 107 of file sr_replicate.c.

Defines next-nodes for packet processing.

Enumerator
SR_REPLICATE_NEXT_IP6_LOOKUP 
SR_REPLICATE_N_NEXT 

Definition at line 128 of file sr_replicate.c.

Function Documentation

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

packet trace format function.

Parameters
*su8 used for string output
*argsva_list structured input to va_arg to output sr_replicate_trace_t
Returns
*s u8 - formatted trace output

Definition at line 74 of file sr_replicate.c.

+ Here is the call graph for this function:

clib_error_t* sr_replicate_init ( vlib_main_t vm)

Definition at line 470 of file sr_replicate.c.

+ Here is the call graph for this function:

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

Single loop packet replicator.

Node Identifier:
sr-replicate
Parameters
vmvlib_main_t
Returns
frame->n_vectors uword

Definition at line 142 of file sr_replicate.c.

+ Here is the call graph for this function:

Variable Documentation

char* sr_replicate_error_strings[]
static
Initial value:
= {
#define _(sym,string)
}
#define foreach_sr_replicate_error
Definition: sr_replicate.c:98

Error strings for SR replicate.

Definition at line 118 of file sr_replicate.c.

sr_replicate_main_t sr_replicate_main

Definition at line 51 of file sr_replicate.c.

vlib_node_registration_t sr_replicate_node
Initial value:
= {
.function = sr_replicate_node_fn,
.name = "sr-replicate",
.vector_size = sizeof (u32),
.format_trace = format_sr_replicate_trace,
.error_strings = sr_replicate_error_strings,
.n_next_nodes = SR_REPLICATE_N_NEXT,
.next_nodes = {
[SR_REPLICATE_NEXT_IP6_LOOKUP] = "ip6-lookup",
},
}
bad routing header type(not 4)") sr_error (NO_MORE_SEGMENTS
static uword sr_replicate_node_fn(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
Single loop packet replicator.
Definition: sr_replicate.c:142
static u8 * format_sr_replicate_trace(u8 *s, va_list *args)
packet trace format function.
Definition: sr_replicate.c:74
static char * sr_replicate_error_strings[]
Error strings for SR replicate.
Definition: sr_replicate.c:118
#define ARRAY_LEN(x)
Definition: clib.h:59
unsigned int u32
Definition: types.h:88

(constructor) VLIB_REGISTER_NODE (sr_replicate_node)

Definition at line 449 of file sr_replicate.c.