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 =
83 while (n_left_from > 0)
87 while (n_left_from >= 4 && n_left_to_next >= 2)
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);
156 while (n_left_from > 0 && n_left_to_next > 0)
164 bi0 = to_next[0] = from[0];
188 b0->
error = node->
errors[IP_PUNT_POLICER_ERROR_DROP];
200 n_left_to_next, bi0, next0);
284 redirect,
void *arg);
309 while (n_left_from > 0)
313 while (n_left_from > 0 && n_left_to_next > 0)
315 u32 rx_sw_if_index0, rrxi0;
323 bi0 = to_next[0] = from[0];
341 if (
vec_len (redirects) > rx_sw_if_index0)
343 rrxi0 = redirects[rx_sw_if_index0];
345 rrxi0 = redirects[0];
347 else if (
vec_len (redirects) >= 1)
348 rrxi0 = redirects[0];
353 b0->
flags |= VNET_BUFFER_F_LOCALLY_ORIGINATED;
368 n_left_to_next, bi0, next0);
388 while (n_left_from > 0)
392 while (n_left_from >= 8 && n_left_to_next >= 4)
395 u32 next0, next1, next2, next3;
396 u32 bi0, bi1, bi2, bi3;
398 next0 = next1 = next2 = next3 = 0;
415 bi0 = to_next[0] = from[0];
416 bi1 = to_next[1] = from[1];
417 bi2 = to_next[2] = from[2];
418 bi3 = to_next[3] = from[3];
438 to_next, n_left_to_next,
440 next0, next1, next2, next3);
443 while (n_left_from > 0 && n_left_to_next > 0)
450 bi0 = to_next[0] = from[0];
462 n_left_to_next, bi0, next0);
vnet_config_main_t config_main
u32 flags
buffer flags: VLIB_BUFFER_FREE_LIST_INDEX_MASK: bits used to store free list index, VLIB_BUFFER_IS_TRACED: trace this buffer.
ip_punt_redirect_rx_t * pool
index_t ip_punt_redirect_find(fib_protocol_t fproto, u32 rx_sw_if_index)
#define POLICER_TICKS_PER_PERIOD_SHIFT
A representation of a path as described by a route producer.
u8 * format_ip_punt_policer_trace(u8 *s, va_list *args)
vnet_feature_config_main_t * cm
#define FIB_PROTOCOL_IP_MAX
Definition outside of enum so it does not need to be included in non-defaulted switch statements...
vlib_main_t vlib_node_runtime_t vlib_frame_t * frame
u32 index_t
A Data-Path Object is an object that represents actions that are applied to packets are they are swit...
static u64 clib_cpu_time_now(void)
#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.
static uword ip_drop_or_punt(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame, u8 arc_index)
vlib_node_registration_t ip6_punt_policer_node
(constructor) VLIB_REGISTER_NODE (ip6_punt_policer_node)
vlib_error_t * errors
Vector of errors for this node.
u8 * format_ip_punt_redirect(u8 *s, va_list *args)
enum fib_protocol_t_ fib_protocol_t
Protocol Type.
enum walk_rc_t_ walk_rc_t
Walk return code.
struct ip_punt_policer_t_ ip_punt_policer_t
IP4 punt policer configuration we police the punt rate to prevent overloading the host...
#define static_always_inline
ip_punt_redirect_next_t_
IP punt redirect next nodes.
fib_forward_chain_type_t payload_type
#define vlib_prefetch_buffer_header(b, type)
Prefetch buffer metadata.
ip_punt_policer_t ip4_punt_policer_cfg
u8 * format_ip_punt_redirect_trace(u8 *s, va_list *args)
struct ip4_punt_redirect_trace_t_ ip_punt_redirect_trace_t
IP Punt redirect trace.
#define foreach_ip_punt_policer_error
IP punt redirect configuration.
void ip_punt_redirect_del(fib_protocol_t fproto, u32 rx_sw_if_index)
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.
vlib_error_t error
Error code for buffers to be enqueued to error handler.
The identity of a DPO is a combination of its type and its instance number/index of objects of that t...
fib_node_t node
Node linkage into the FIB graph.
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
void ip_punt_redirect_add(fib_protocol_t fproto, u32 rx_sw_if_index, fib_forward_chain_type_t ct, fib_route_path_t *rpaths)
Add a punt redirect entry.
static void * vnet_get_config_data(vnet_config_main_t *cm, u32 *config_index, u32 *next_index, u32 n_data_bytes)
vlib_main_t * vm
X-connect all packets from the HOST to the PHY.
#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.
#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.
An node in the FIB graph.
#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).
static_always_inline ip_punt_redirect_rx_t * ip_punt_redirect_get(index_t rrxi)
IP4 punt redirect per-rx interface configuration redirect punted traffic to another location...
dpo_id_t dpo
redirect forwarding
vnet_feature_main_t feature_main
u32 fib_node_index_t
A typedef of a node index.
u32 current_config_index
Used by feature subgraph arcs to visit enabled feature nodes.
struct ip_punt_redirect_t_ ip_punt_redirect_cfg_t
IP punt redirect configuration.
u16 cached_next_index
Next frame index that vector arguments were last enqueued to last time this node ran.
IP4 punt policer configuration we police the punt rate to prevent overloading the host...
enum fib_forward_chain_type_t_ fib_forward_chain_type_t
FIB output chain type.
walk_rc_t(* ip_punt_redirect_walk_cb_t)(u32 rx_sw_if_index, const ip_punt_redirect_rx_t *redirect, void *arg)
vlib_put_next_frame(vm, node, next_index, 0)
struct ip_punt_policer_trace_t_ ip_punt_policer_trace_t
vlib_node_registration_t ip4_punt_policer_node
(constructor) VLIB_REGISTER_NODE (ip4_punt_policer_node)
struct ip_punt_redirect_rx_t_ ip_punt_redirect_rx_t
IP4 punt redirect per-rx interface configuration redirect punted traffic to another location...
nat44_ei_hairpin_src_next_t next_index
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)
struct _vlib_node_registration vlib_node_registration_t
index_t dpoi_index
the index of objects of that type
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
vlib_main_t vlib_node_runtime_t * node
enum ip_punt_policer_next_t_ ip_punt_policer_next_t
#define INDEX_INVALID
Invalid index - used when no index is known blazoned capitals INVALID speak volumes where ~0 does not...
VLIB buffer representation.
static void * vlib_frame_vector_args(vlib_frame_t *f)
Get pointer to frame vector data.
index_t * redirect_by_rx_sw_if_index[FIB_PROTOCOL_IP_MAX]
per-RX interface configuration.
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)
void * vlib_add_trace(vlib_main_t *vm, vlib_node_runtime_t *r, vlib_buffer_t *b, u32 n_data_bytes)
u16 dpoi_next_node
The next VLIB node to follow.
vnet_feature_config_main_t * feature_config_mains
feature config main objects
ip_punt_policer_t ip6_punt_policer_cfg
enum ip_punt_redirect_next_t_ ip_punt_redirect_next_t
IP punt redirect next nodes.
static vlib_buffer_t * vlib_get_buffer(vlib_main_t *vm, u32 buffer_index)
Translate buffer index into buffer pointer.
ip_punt_redirect_cfg_t ip_punt_redirect_cfg
void ip_punt_redirect_walk(fib_protocol_t fproto, ip_punt_redirect_walk_cb_t cb, void *ctx)
static_always_inline void vnet_feature_arc_start(u8 arc, u32 sw_if_index, u32 *next0, vlib_buffer_t *b0)