|
FD.io VPP
v21.10.1-2-g0a485f517
Vector Packet Processing
|
Go to the documentation of this file.
16 #ifndef __IP_PUNT_DROP_H__
17 #define __IP_PUNT_DROP_H__
46 #define foreach_ip_punt_policer_error \
47 _(DROP, "ip punt policer drop")
51 #define _(sym,str) IP_PUNT_POLICER_ERROR_##sym,
72 u64 time_in_policer_periods;
76 time_in_policer_periods =
95 bi0 = to_next[0] =
from[0];
96 bi1 = to_next[1] =
from[1];
128 b0->
error =
node->errors[IP_PUNT_POLICER_ERROR_DROP];
133 b1->
error =
node->errors[IP_PUNT_POLICER_ERROR_DROP];
154 bi0, bi1, next0, next1);
164 bi0 = to_next[0] =
from[0];
188 b0->
error =
node->errors[IP_PUNT_POLICER_ERROR_DROP];
200 n_left_to_next, bi0, next0);
205 return frame->n_vectors;
283 redirect,
void *arg);
314 u32 rx_sw_if_index0, rrxi0;
322 bi0 = to_next[0] =
from[0];
340 if (
vec_len (redirects) > rx_sw_if_index0)
342 rrxi0 = redirects[rx_sw_if_index0];
344 rrxi0 = redirects[0];
346 else if (
vec_len (redirects) >= 1)
347 rrxi0 = redirects[0];
352 b0->
flags |= VNET_BUFFER_F_LOCALLY_ORIGINATED;
367 n_left_to_next, bi0, next0);
373 return frame->n_vectors;
394 u32 next0, next1, next2, next3;
395 u32 bi0, bi1, bi2, bi3;
397 next0 = next1 = next2 = next3 = 0;
414 bi0 = to_next[0] =
from[0];
415 bi1 = to_next[1] =
from[1];
416 bi2 = to_next[2] =
from[2];
417 bi3 = to_next[3] =
from[3];
437 to_next, n_left_to_next,
439 next0, next1, next2, next3);
449 bi0 = to_next[0] =
from[0];
461 n_left_to_next, bi0, next0);
466 return frame->n_vectors;
vlib_node_registration_t ip6_punt_policer_node
(constructor) VLIB_REGISTER_NODE (ip6_punt_policer_node)
u16 dpoi_next_node
The next VLIB node to follow.
index_t dpoi_index
the index of objects of that type
vnet_config_main_t config_main
#define vlib_prefetch_buffer_header(b, type)
Prefetch buffer metadata.
vlib_main_t vlib_node_runtime_t vlib_frame_t * frame
nat44_ei_hairpin_src_next_t next_index
index_t ip_punt_redirect_find(fib_protocol_t fproto, u32 rx_sw_if_index)
static vlib_buffer_t * vlib_get_buffer(vlib_main_t *vm, u32 buffer_index)
Translate buffer index into buffer pointer.
@ IP_PUNT_REDIRECT_NEXT_TX
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
@ IP_PUNT_POLICER_NEXT_DROP
u8 * format_ip_punt_redirect(u8 *s, va_list *args)
vlib_main_t vlib_node_runtime_t * node
#define foreach_ip_punt_policer_error
#define vlib_validate_buffer_enqueue_x4(vm, node, next_index, to_next, n_left_to_next, bi0, bi1, bi2, bi3, next0, next1, next2, next3)
Finish enqueueing four buffers forward in the graph.
vlib_main_t * vm
X-connect all packets from the HOST to the PHY.
void ip_punt_redirect_add(fib_protocol_t fproto, u32 rx_sw_if_index, fib_forward_chain_type_t ct, const fib_route_path_t *rpaths)
Add a punt redirect entry.
struct ip_punt_policer_trace_t_ ip_punt_policer_trace_t
@ IP4_PUNT_POLICER_N_ERROR
ip_punt_redirect_cfg_t ip_punt_redirect_cfg
index_t * redirect_by_rx_sw_if_index[FIB_PROTOCOL_IP_MAX]
per-RX interface configuration.
struct ip_punt_policer_t_ ip_punt_policer_t
IP4 punt policer configuration we police the punt rate to prevent overloading the host.
IP4 punt policer configuration we police the punt rate to prevent overloading the host.
struct ip_punt_redirect_rx_t_ ip_punt_redirect_rx_t
IP4 punt redirect per-rx interface configuration redirect punted traffic to another location.
fib_node_t node
Node linkage into the FIB graph.
enum ip_punt_policer_next_t_ ip_punt_policer_next_t
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
vlib_error_t error
Error code for buffers to be enqueued to error handler.
enum fib_forward_chain_type_t_ fib_forward_chain_type_t
FIB output chain type.
#define FIB_PROTOCOL_IP_MAX
Definition outside of enum so it does not need to be included in non-defaulted switch statements.
static uword ip_punt_redirect(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame, u8 arc_index, fib_protocol_t fproto)
static void * vlib_frame_vector_args(vlib_frame_t *f)
Get pointer to frame vector data.
u32 index_t
A Data-Path Object is an object that represents actions that are applied to packets are they are swit...
#define static_always_inline
walk_rc_t(* ip_punt_redirect_walk_cb_t)(u32 rx_sw_if_index, const ip_punt_redirect_rx_t *redirect, void *arg)
u32 fib_node_index_t
A typedef of a node index.
vnet_feature_config_main_t * cm
static uword ip_punt_policer(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame, u8 arc_index, u32 policer_index)
IP punt policing node function.
static_always_inline u8 vnet_policer_police(vlib_main_t *vm, vlib_buffer_t *b, u32 policer_index, u64 time_in_policer_periods, policer_result_e packet_color, bool handoff)
enum fib_protocol_t_ fib_protocol_t
Protocol Type.
IP4 punt redirect per-rx interface configuration redirect punted traffic to another location.
vnet_feature_main_t feature_main
@ IP_PUNT_POLICER_NEXT_HANDOFF
struct _vlib_node_registration vlib_node_registration_t
void ip_punt_redirect_del(fib_protocol_t fproto, u32 rx_sw_if_index)
fib_forward_chain_type_t payload_type
#define POLICER_TICKS_PER_PERIOD_SHIFT
u32 current_config_index
Used by feature subgraph arcs to visit enabled feature nodes.
void ip_punt_redirect_walk(fib_protocol_t fproto, ip_punt_redirect_walk_cb_t cb, void *ctx)
u8 * format_ip_punt_redirect_trace(u8 *s, va_list *args)
dpo_id_t dpo
redirect forwarding
#define vlib_validate_buffer_enqueue_x1(vm, node, next_index, to_next, n_left_to_next, bi0, next0)
Finish enqueueing one buffer forward in the graph.
ip_punt_redirect_next_t_
IP punt redirect next nodes.
vlib_put_next_frame(vm, node, next_index, 0)
u8 * format_ip_punt_policer_trace(u8 *s, va_list *args)
A representation of a path as described by a route producer.
ip_punt_policer_t ip6_punt_policer_cfg
static_always_inline ip_punt_redirect_rx_t * ip_punt_redirect_get(index_t rrxi)
@ IP_PUNT_REDIRECT_NEXT_ARP
An node in the FIB graph.
void * vlib_add_trace(vlib_main_t *vm, vlib_node_runtime_t *r, vlib_buffer_t *b, u32 n_data_bytes)
@ IP_PUNT_REDIRECT_N_NEXT
static void * vnet_get_config_data(vnet_config_main_t *cm, u32 *config_index, u32 *next_index, u32 n_data_bytes)
enum ip_punt_redirect_next_t_ ip_punt_redirect_next_t
IP punt redirect next nodes.
static_always_inline void vnet_feature_arc_start(u8 arc, u32 sw_if_index, u32 *next0, vlib_buffer_t *b0)
The identity of a DPO is a combination of its type and its instance number/index of objects of that t...
#define vlib_validate_buffer_enqueue_x2(vm, node, next_index, to_next, n_left_to_next, bi0, bi1, next0, next1)
Finish enqueueing two buffers forward in the graph.
@ IP_PUNT_REDIRECT_NEXT_DROP
vnet_feature_config_main_t * feature_config_mains
feature config main objects
IP punt redirect configuration.
static uword ip_drop_or_punt(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame, u8 arc_index)
static u64 clib_cpu_time_now(void)
#define INDEX_INVALID
Invalid index - used when no index is known blazoned capitals INVALID speak volumes where ~0 does not...
struct ip_punt_redirect_t_ ip_punt_redirect_cfg_t
IP punt redirect configuration.
#define vlib_get_next_frame(vm, node, next_index, vectors, n_vectors_left)
Get pointer to next frame vector data by (vlib_node_runtime_t, next_index).
enum walk_rc_t_ walk_rc_t
Walk return code.
vlib_node_registration_t ip4_punt_policer_node
(constructor) VLIB_REGISTER_NODE (ip4_punt_policer_node)
struct ip4_punt_redirect_trace_t_ ip_punt_redirect_trace_t
IP Punt redirect trace.
ip_punt_redirect_rx_t * pool
ip_punt_policer_t ip4_punt_policer_cfg
u32 flags
buffer flags: VLIB_BUFFER_FREE_LIST_INDEX_MASK: bits used to store free list index,...
VLIB buffer representation.