|
FD.io VPP
v21.10.1-2-g0a485f517
Vector Packet Processing
|
Go to the documentation of this file.
29 .stat_segment_name =
"/net/punt",
165 flags_format,
flags));
177 pc_name =
format (NULL,
"%s", who);
187 pc->pc_name = pc_name;
246 u32 pri, *prip, *pris;
471 u32 *result = va_arg (*args,
u32 *);
481 u32 *result = va_arg (*args,
u32 *);
489 if (
unformat (input, (
const char *) s))
503 u32 pri = va_arg (*args,
u32);
508 s =
format (s,
"%U -> %U",
529 s =
format (s,
"%v ", pc->pc_name);
539 u32 pci = va_arg (*args,
u32);
545 s =
format (s,
"%v", pc->pc_name);
552 s =
format (s,
"\n registrations:");
558 s =
format (s,
"\n reasons:");
612 .path =
"show punt client",
613 .short_help =
"show client[s] registered with the punt infra",
635 .path =
"show punt reasons",
636 .short_help =
"show all punt reasons",
657 " (for each punt-reason the edge[s] from punt-dispatch)");
678 .path =
"show punt db",
679 .short_help =
"show the punt DB",
705 .path =
"show punt stats",
706 .short_help =
"show the punt stats",
#define vec_reset_length(v)
Reset vector length to zero NULL-pointer tolerant.
A client using the punt serivce and its registrations.
enum vlib_punt_reason_t_ vlib_punt_reason_t
The 'syatem' defined punt reasons.
static uword * punt_reg_db
A DB of all the register nodes against punt reason and node index.
static vlib_cli_command_t punt_stats_show_command
(constructor) VLIB_CLI_COMMAND (punt_stats_show_command)
#define hash_set(h, key, value)
static uword vlib_node_add_next(vlib_main_t *vm, uword node, uword next_node)
A registration, by a client, to direct punted traffic to a given node.
void * pd_data
Data to pass to the callback.
static int punt_validate_client(vlib_punt_hdl_t client)
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
#define vec_end(v)
End (last data address) of vector.
struct punt_client_t_ punt_client_t
A client using the punt serivce and its registrations.
#define hash_foreach(key_var, value_var, h, body)
static punt_reason_data_t * punt_reason_data
data for each punt reason
#define hash_set_mem(h, key, value)
static clib_error_t * punt_init(vlib_main_t *vm)
void vlib_validate_combined_counter(vlib_combined_counter_main_t *cm, u32 index)
validate a combined counter
#define pool_put(P, E)
Free an object E in pool P.
vlib_main_t * vm
X-connect all packets from the HOST to the PHY.
u32 * pc_regs
The registrations is has made.
struct punt_reason_data_t_ punt_reason_data_t
A punt reason.
char * name
The counter collection's name.
static clib_error_t * punt_client_show(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
void punt_reason_walk(punt_reason_walk_cb_t cb, void *ctx)
u32 vlib_punt_reason_get_flags(vlib_punt_reason_t pr)
static clib_error_t * punt_reason_show(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
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.
static punt_reg_t * punt_reg_pool
Pool of registrations.
#define hash_unset(h, key)
u8 * format_punt_reg(u8 *s, va_list *args)
#define pool_is_free_index(P, I)
Use free bitmap to query whether given index is free.
u8 * format_vlib_punt_reason(u8 *s, va_list *args)
Format a punt reason.
uword unformat_punt_client(unformat_input_t *input, va_list *args)
u32 * pd_owners
Clients/owners that have registered this reason.
static u64 punt_reg_mk_key(vlib_punt_reason_t reason, u32 node_index)
u16 pr_edge
The edge from the punt dispatch node to the requested node.
struct punt_reg_t_ punt_reg_t
A registration, by a client, to direct punted traffic to a given node.
static void punt_reg_mk_dp(vlib_punt_reason_t reason)
reconstruct the DP per-reason DB
vlib_combined_counter_main_t punt_counters
Counters per punt-reason.
#define vec_add1(V, E)
Add 1 element to end of vector (unspecified alignment).
#define vec_elt_at_index(v, i)
Get vector value at index i checking that i is in bounds.
Combined counter to hold both packets and byte differences.
void(* punt_interested_listener_t)(vlib_enable_or_disable_t i, void *data)
u16 ** punt_dp_db
A DB used in the DP per-reason to dispatch packets to the requested nodes.
#define vec_foreach_index(var, v)
Iterate over vector indices.
static void vlib_zero_combined_counter(vlib_combined_counter_main_t *cm, u32 index)
Clear a combined counter Clears the set of per-thread counters.
vnet_feature_config_main_t * cm
#define pool_get(P, E)
Allocate an object E from a pool P (unspecified alignment).
#define vec_validate(V, I)
Make sure vector is long enough for given index (no header, unspecified alignment)
int vlib_punt_unregister(vlib_punt_hdl_t client, vlib_punt_reason_t reason, const char *node_name)
#define VLIB_CLI_COMMAND(x,...)
enum punt_format_flags_t_ punt_format_flags_t
static u32 punt_reg_find(vlib_punt_reason_t reason, u32 node_index)
void vlib_cli_output(vlib_main_t *vm, char *fmt,...)
@ PUNT_FORMAT_FLAG_DETAIL
#define vec_search(v, E)
Search a vector for the index of the entry that matches.
u32 vlib_combined_counter_n_counters(const vlib_combined_counter_main_t *cm)
The number of counters (not the number of per-thread counters)
#define hash_create_vec(elts, key_bytes, value_bytes)
unformat_function_t unformat_hash_vec_string
u8 * pc_name
The name of the client.
static void vlib_get_combined_counter(const vlib_combined_counter_main_t *cm, u32 index, vlib_counter_t *result)
Get the value of a combined counter, never called in the speed path Scrapes the entire set of per-thr...
#define hash_get_mem(h, key)
static uword * punt_client_db
DB of clients key'd by their name.
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.
#define vec_free(V)
Free vector's memory (no header).
static void punt_reg_remove(const punt_reg_t *pr)
vlib_node_t * vlib_get_node_by_name(vlib_main_t *vm, u8 *name)
uword unformat_punt_reason(unformat_input_t *input, va_list *args)
Unformat a punt reason.
format_function_t format_vlib_node_name
u8 * format_punt_client(u8 *s, va_list *args)
static vlib_cli_command_t punt_db_show_command
(constructor) VLIB_CLI_COMMAND (punt_db_show_command)
description fragment has unexpected format
u8 * pd_name
The reason name.
A collection of combined counters.
vlib_punt_reason_t pd_reason
The allocated reason value.
#define VLIB_INIT_FUNCTION(x)
punt_interested_listener_t pd_fn
function to invoke if a client becomes interested in the code.
u32 pr_node_index
node-index to send punted packets to
static void punt_reg_add(const punt_reg_t *pr)
static vlib_cli_command_t punt_client_show_command
(constructor) VLIB_CLI_COMMAND (punt_client_show_command)
#define vec_foreach(var, vec)
Vector iterator.
int vlib_punt_hdl_t
Typedef for a client handle.
u32 pd_users
clients interested/listening to this reason
static vlib_main_t * vlib_get_main(void)
static vlib_punt_reason_t punt_reason_last
The last allocated punt reason Value 0 is reserved for invalid index.
clib_error_t *() vlib_init_function_t(struct vlib_main_t *vm)
u16 pr_locks
number of clients that have made this registration
u32 flags
Flags associated to the reason.
int vlib_punt_reason_validate(vlib_punt_reason_t reason)
Validate that a punt reason is assigned.
vlib_punt_reason_t pr_reason
Reason the packets were punted.
static clib_error_t * punt_stats_show(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
format_function_t * flags_format
Formatting function for flags;.
vlib_punt_hdl_t vlib_punt_client_register(const char *who)
Register a new clinet.
u8 * format_punt_reason_data(u8 *s, va_list *args)
int(* punt_reason_walk_cb_t)(vlib_punt_reason_t id, const u8 *name, void *ctx)
Walk each punt reason.
static clib_error_t * punt_db_show(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
#define vec_del1(v, i)
Delete the element at index I.
static punt_client_t * punt_client_pool
Pool of clients.
static vlib_cli_command_t punt_reason_show_command
(constructor) VLIB_CLI_COMMAND (punt_reason_show_command)
vl_api_wireguard_peer_flags_t flags