FD.io VPP  v19.08.3-2-gbabecb413
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_validate (vlib_punt_reason_t reason)
 Validate that a punt reason is assigned. More...
 
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...
 
void punt_reason_walk (punt_reason_walk_cb_t cb, void *ctx)
 
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

◆ punt_client_t

typedef struct punt_client_t_ punt_client_t

A client using the punt serivce and its registrations.

◆ punt_format_flags_t

◆ punt_reason_data_t

A punt reason.

◆ punt_reg_t

typedef struct punt_reg_t_ punt_reg_t

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

Enumeration Type Documentation

◆ punt_format_flags_t_

Enumerator
PUNT_FORMAT_FLAG_NONE 
PUNT_FORMAT_FLAG_DETAIL 

Definition at line 57 of file punt.c.

Function Documentation

◆ format_punt_client()

u8* format_punt_client ( u8 s,
va_list *  args 
)

Definition at line 459 of file punt.c.

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

◆ format_punt_reason_data()

u8* format_punt_reason_data ( u8 s,
va_list *  args 
)

Definition at line 441 of file punt.c.

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

◆ format_punt_reg()

u8* format_punt_reg ( u8 s,
va_list *  args 
)

Definition at line 426 of file punt.c.

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

◆ format_vlib_punt_reason()

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:

◆ punt_client_show()

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

Definition at line 497 of file punt.c.

+ Here is the call graph for this function:

◆ punt_db_show()

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

Definition at line 564 of file punt.c.

+ Here is the call graph for this function:

◆ punt_init()

static clib_error_t* punt_init ( vlib_main_t vm)
static

Definition at line 634 of file punt.c.

+ Here is the caller graph for this function:

◆ punt_reason_show()

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

Definition at line 541 of file punt.c.

+ Here is the call graph for this function:

◆ punt_reason_walk()

void punt_reason_walk ( punt_reason_walk_cb_t  cb,
void *  ctx 
)

Definition at line 405 of file punt.c.

+ Here is the caller graph for this function:

◆ punt_reg_add()

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:

◆ punt_reg_find()

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:

◆ punt_reg_mk_dp()

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:

◆ punt_reg_mk_key()

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:

◆ punt_reg_remove()

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:

◆ punt_stats_show()

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

Definition at line 607 of file punt.c.

+ Here is the call graph for this function:

◆ punt_validate_client()

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:

◆ unformat_punt_client()

uword unformat_punt_client ( unformat_input_t input,
va_list *  args 
)

Definition at line 417 of file punt.c.

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

◆ vlib_punt_client_register()

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:

◆ vlib_punt_reason_alloc()

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 379 of file punt.c.

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

◆ vlib_punt_reason_validate()

int vlib_punt_reason_validate ( vlib_punt_reason_t  reason)

Validate that a punt reason is assigned.

Definition at line 370 of file punt.c.

+ Here is the caller graph for this function:

◆ vlib_punt_register()

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:

◆ vlib_punt_unregister()

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

◆ punt_client_db

uword* punt_client_db
static

DB of clients key'd by their name.

Definition at line 129 of file punt.c.

◆ punt_client_pool

punt_client_t* punt_client_pool
static

Pool of clients.

Definition at line 124 of file punt.c.

◆ punt_client_show_command

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:497

(constructor) VLIB_CLI_COMMAND (punt_client_show_command)

Definition at line 532 of file punt.c.

◆ punt_counters

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.

◆ punt_db_show_command

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:564

(constructor) VLIB_CLI_COMMAND (punt_db_show_command)

Definition at line 598 of file punt.c.

◆ punt_dp_db

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

punt_reason_data_t* punt_reason_data
static

data for each punt reason

Definition at line 55 of file punt.c.

◆ punt_reason_last

vlib_punt_reason_t punt_reason_last
static

The last allocated punt reason.

Definition at line 21 of file punt.c.

◆ punt_reason_show_command

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:541

(constructor) VLIB_CLI_COMMAND (punt_reason_show_command)

Definition at line 555 of file punt.c.

◆ punt_reg_db

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_pool

punt_reg_t* punt_reg_pool
static

Pool of registrations.

Definition at line 92 of file punt.c.

◆ punt_stats_show_command

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:607

(constructor) VLIB_CLI_COMMAND (punt_stats_show_command)

Definition at line 625 of file punt.c.