FD.io VPP  v19.04.2-12-g66b1689
Vector Packet Processing
punt.c File Reference
+ Include dependency graph for punt.c:

Go to the source code of this file.

Data Structures

struct  punt_reason_data_t_
 A punt reason. More...
 
struct  punt_reg_t_
 A registration, by a client, to direct punted traffic to a given node. More...
 
struct  punt_client_t_
 A client using the punt serivce and its registrations. More...
 

Typedefs

typedef struct punt_reason_data_t_ punt_reason_data_t
 A punt reason. More...
 
typedef enum punt_format_flags_t_ punt_format_flags_t
 
typedef struct punt_reg_t_ punt_reg_t
 A registration, by a client, to direct punted traffic to a given node. More...
 
typedef struct punt_client_t_ punt_client_t
 A client using the punt serivce and its registrations. More...
 

Enumerations

enum  punt_format_flags_t_ { PUNT_FORMAT_FLAG_NONE = 0, PUNT_FORMAT_FLAG_DETAIL = (1 << 0) }
 

Functions

u8format_vlib_punt_reason (u8 *s, va_list *args)
 Format a punt reason. More...
 
vlib_punt_hdl_t vlib_punt_client_register (const char *who)
 Register a new clinet. More...
 
static int punt_validate_client (vlib_punt_hdl_t client)
 
static u64 punt_reg_mk_key (vlib_punt_reason_t reason, u32 node_index)
 
static u32 punt_reg_find (vlib_punt_reason_t reason, u32 node_index)
 
static void punt_reg_add (const punt_reg_t *pr)
 
static void punt_reg_remove (const punt_reg_t *pr)
 
static void punt_reg_mk_dp (vlib_punt_reason_t reason)
 reconstruct the DP per-reason DB More...
 
int vlib_punt_register (vlib_punt_hdl_t client, vlib_punt_reason_t reason, const char *node_name)
 Register a node to receive particular punted buffers. More...
 
int vlib_punt_unregister (vlib_punt_hdl_t client, vlib_punt_reason_t reason, const char *node_name)
 
int vlib_punt_reason_alloc (vlib_punt_hdl_t client, const char *reason_name, vlib_punt_reason_t *reason)
 Allocate a new punt reason. More...
 
uword unformat_punt_client (unformat_input_t *input, va_list *args)
 
u8format_punt_reg (u8 *s, va_list *args)
 
u8format_punt_reason_data (u8 *s, va_list *args)
 
u8format_punt_client (u8 *s, va_list *args)
 
static clib_error_tpunt_client_show (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
 
static clib_error_tpunt_reason_show (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
 
static clib_error_tpunt_db_show (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
 
static clib_error_tpunt_stats_show (vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
 
static clib_error_tpunt_init (vlib_main_t *vm)
 

Variables

static vlib_punt_reason_t punt_reason_last
 The last allocated punt reason. More...
 
vlib_combined_counter_main_t punt_counters
 Counters per punt-reason. More...
 
static punt_reason_data_tpunt_reason_data
 data for each punt reason More...
 
static punt_reg_tpunt_reg_pool
 Pool of registrations. More...
 
static uwordpunt_reg_db
 A DB of all the register nodes against punt reason and node index. More...
 
u16 ** punt_dp_db
 A DB used in the DP per-reason to dispatch packets to the requested nodes. More...
 
static punt_client_tpunt_client_pool
 Pool of clients. More...
 
static uwordpunt_client_db
 DB of clients key'd by their name. More...
 
static vlib_cli_command_t punt_client_show_command
 (constructor) VLIB_CLI_COMMAND (punt_client_show_command) More...
 
static vlib_cli_command_t punt_reason_show_command
 (constructor) VLIB_CLI_COMMAND (punt_reason_show_command) More...
 
static vlib_cli_command_t punt_db_show_command
 (constructor) VLIB_CLI_COMMAND (punt_db_show_command) More...
 
static vlib_cli_command_t punt_stats_show_command
 (constructor) VLIB_CLI_COMMAND (punt_stats_show_command) More...
 

Typedef Documentation

typedef struct punt_client_t_ punt_client_t

A client using the punt serivce and its registrations.

A punt reason.

typedef struct punt_reg_t_ punt_reg_t

A registration, by a client, to direct punted traffic to a given node.

Enumeration Type Documentation

Enumerator
PUNT_FORMAT_FLAG_NONE 
PUNT_FORMAT_FLAG_DETAIL 

Definition at line 57 of file punt.c.

Function Documentation

u8* format_punt_client ( u8 s,
va_list *  args 
)

Definition at line 439 of file punt.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

u8* format_punt_reason_data ( u8 s,
va_list *  args 
)

Definition at line 421 of file punt.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

u8* format_punt_reg ( u8 s,
va_list *  args 
)

Definition at line 406 of file punt.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

u8* format_vlib_punt_reason ( u8 s,
va_list *  args 
)

Format a punt reason.

Definition at line 132 of file punt.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Definition at line 477 of file punt.c.

+ Here is the call graph for this function:

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

Definition at line 544 of file punt.c.

+ Here is the call graph for this function:

static clib_error_t* punt_init ( vlib_main_t vm)
static

Definition at line 614 of file punt.c.

+ Here is the caller graph for this function:

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

Definition at line 521 of file punt.c.

+ Here is the call graph for this function:

static void punt_reg_add ( const punt_reg_t pr)
static

Definition at line 195 of file punt.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static u32 punt_reg_find ( vlib_punt_reason_t  reason,
u32  node_index 
)
static

Definition at line 182 of file punt.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void punt_reg_mk_dp ( vlib_punt_reason_t  reason)
static

reconstruct the DP per-reason DB

Definition at line 213 of file punt.c.

+ Here is the caller graph for this function:

static u64 punt_reg_mk_key ( vlib_punt_reason_t  reason,
u32  node_index 
)
static

Definition at line 176 of file punt.c.

+ Here is the caller graph for this function:

static void punt_reg_remove ( const punt_reg_t pr)
static

Definition at line 203 of file punt.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Definition at line 587 of file punt.c.

+ Here is the call graph for this function:

static int punt_validate_client ( vlib_punt_hdl_t  client)
static

Definition at line 170 of file punt.c.

+ Here is the caller graph for this function:

uword unformat_punt_client ( unformat_input_t input,
va_list *  args 
)

Definition at line 397 of file punt.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

vlib_punt_hdl_t vlib_punt_client_register ( const char *  who)

Register a new clinet.

Parameters
who- The name of the client

the handle the punt infra allocated for this client that must be used when the client wishes to use the infra

Definition at line 140 of file punt.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int vlib_punt_reason_alloc ( vlib_punt_hdl_t  client,
const char *  reason_name,
vlib_punt_reason_t reason 
)

Allocate a new punt reason.

Definition at line 370 of file punt.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int vlib_punt_register ( vlib_punt_hdl_t  client,
vlib_punt_reason_t  reason,
const char *  node 
)

Register a node to receive particular punted buffers.

client - The registered client registering for the packets

Parameters
reason- The reason the packet was punted
node- The node to which the punted packets will be sent

Definition at line 252 of file punt.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int vlib_punt_unregister ( vlib_punt_hdl_t  client,
vlib_punt_reason_t  reason,
const char *  node_name 
)

Definition at line 316 of file punt.c.

+ Here is the call graph for this function:

Variable Documentation

uword* punt_client_db
static

DB of clients key'd by their name.

Definition at line 129 of file punt.c.

punt_client_t* punt_client_pool
static

Pool of clients.

Definition at line 124 of file punt.c.

vlib_cli_command_t punt_client_show_command
static
Initial value:
=
{
.path = "show punt client",
.short_help = "show client[s] registered with the punt infra",
.function = punt_client_show,
}
static clib_error_t * punt_client_show(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: punt.c:477

(constructor) VLIB_CLI_COMMAND (punt_client_show_command)

Definition at line 512 of file punt.c.

Initial value:
= {
.name = "punt",
.stat_segment_name = "/net/punt",
}

Counters per punt-reason.

FOR USE IN THE DP ONLY.

Definition at line 26 of file punt.c.

vlib_cli_command_t punt_db_show_command
static
Initial value:
=
{
.path = "show punt db",
.short_help = "show the punt DB",
.function = punt_db_show,
}
static clib_error_t * punt_db_show(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: punt.c:544

(constructor) VLIB_CLI_COMMAND (punt_db_show_command)

Definition at line 578 of file punt.c.

u16** punt_dp_db

A DB used in the DP per-reason to dispatch packets to the requested nodes.

FOR USE IN THE DP ONLY.

this is a vector of edges per-reason

Definition at line 103 of file punt.c.

punt_reason_data_t* punt_reason_data
static

data for each punt reason

Definition at line 55 of file punt.c.

vlib_punt_reason_t punt_reason_last
static

The last allocated punt reason.

Definition at line 21 of file punt.c.

vlib_cli_command_t punt_reason_show_command
static
Initial value:
=
{
.path = "show punt reasons",
.short_help = "show all punt reasons",
.function = punt_reason_show,
}
static clib_error_t * punt_reason_show(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: punt.c:521

(constructor) VLIB_CLI_COMMAND (punt_reason_show_command)

Definition at line 535 of file punt.c.

uword* punt_reg_db
static

A DB of all the register nodes against punt reason and node index.

Definition at line 97 of file punt.c.

punt_reg_t* punt_reg_pool
static

Pool of registrations.

Definition at line 92 of file punt.c.

vlib_cli_command_t punt_stats_show_command
static
Initial value:
=
{
.path = "show punt stats",
.short_help = "show the punt stats",
.function = punt_stats_show,
}
static clib_error_t * punt_stats_show(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
Definition: punt.c:587

(constructor) VLIB_CLI_COMMAND (punt_stats_show_command)

Definition at line 605 of file punt.c.