FD.io VPP  v21.06-1-gbb7418cf9
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...
 
u32 vlib_punt_reason_get_flags (vlib_punt_reason_t pr)
 
int vlib_punt_reason_alloc (vlib_punt_hdl_t client, const char *reason_name, punt_interested_listener_t fn, void *data, vlib_punt_reason_t *reason, u32 flags, format_function_t *flags_format)
 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)
 
uword unformat_punt_reason (unformat_input_t *input, va_list *args)
 Unformat a punt reason. More...
 
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 = 1
 The last allocated punt reason Value 0 is reserved for invalid index. 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 83 of file punt.c.

Function Documentation

◆ format_punt_client()

u8* format_punt_client ( u8 s,
va_list *  args 
)

Definition at line 537 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 516 of file punt.c.

+ Here is the caller graph for this function:

◆ format_punt_reg()

u8* format_punt_reg ( u8 s,
va_list *  args 
)

Definition at line 501 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 158 of file punt.c.

+ 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 575 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 642 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 712 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 619 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 457 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 226 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 213 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 244 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 207 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 234 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 685 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 201 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 469 of file punt.c.

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

◆ unformat_punt_reason()

uword unformat_punt_reason ( unformat_input_t input,
va_list *  args 
)

Unformat a punt reason.

Definition at line 479 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 171 of file punt.c.

+ 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,
punt_interested_listener_t  fn,
void *  data,
vlib_punt_reason_t reason,
u32  flags,
format_function_t flags_format 
)

Allocate a new punt reason.

Parameters
fn- A callback to invoke when an entity becomes [un]interested in the punt code.
data- To be passed in the callback function.
flags- flags associated with the punt reason
flags_format- formatting function to display those flags (may be NULL)

Definition at line 425 of file punt.c.

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

◆ vlib_punt_reason_get_flags()

u32 vlib_punt_reason_get_flags ( vlib_punt_reason_t  pr)

Definition at line 419 of file punt.c.

+ 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 410 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 283 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 352 of file punt.c.

+ Here is the call graph for this function:
+ Here is the caller 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 155 of file punt.c.

◆ punt_client_pool

punt_client_t* punt_client_pool
static

Pool of clients.

Definition at line 150 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:575

(constructor) VLIB_CLI_COMMAND (punt_client_show_command)

Definition at line 610 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 27 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:642

(constructor) VLIB_CLI_COMMAND (punt_db_show_command)

Definition at line 676 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 129 of file punt.c.

◆ punt_reason_data

punt_reason_data_t* punt_reason_data
static

data for each punt reason

Definition at line 81 of file punt.c.

◆ punt_reason_last

vlib_punt_reason_t punt_reason_last = 1
static

The last allocated punt reason Value 0 is reserved for invalid index.

Definition at line 22 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:619

(constructor) VLIB_CLI_COMMAND (punt_reason_show_command)

Definition at line 633 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 123 of file punt.c.

◆ punt_reg_pool

punt_reg_t* punt_reg_pool
static

Pool of registrations.

Definition at line 118 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:685

(constructor) VLIB_CLI_COMMAND (punt_stats_show_command)

Definition at line 703 of file punt.c.