|
FD.io VPP
v21.10.1-2-g0a485f517
Vector Packet Processing
|
Go to the documentation of this file.
15 #ifndef __POLICE_INLINES_H__
16 #define __POLICE_INLINES_H__
22 #define IP4_NON_DSCP_BITS 0x03
23 #define IP4_DSCP_SHIFT 2
24 #define IP6_NON_DSCP_BITS 0xf03fffff
25 #define IP6_DSCP_SHIFT 22
36 type = clib_net_to_host_u16 (eh->
type);
60 u64 time_in_policer_periods,
63 qos_action_type_en act;
95 policer_index, 1,
len);
126 u32 this_thread, policer_thread;
127 bool single_policer_node = (policer_index != ~0);
130 if (single_policer_node)
132 policer = &pm->
policers[policer_index];
146 if (!single_policer_node)
149 policer = &pm->
policers[policer_index];
154 ti[0] = policer_thread;
158 b[0]->
flags & VLIB_BUFFER_IS_TRACED))
173 thread_indices,
frame->n_vectors, 1);
178 frame->n_vectors - n_enq);
182 #endif // __POLICE_INLINES_H__
vlib_buffer_t * bufs[VLIB_FRAME_SIZE]
static policer_result_e vnet_police_packet(policer_t *policer, u32 packet_length, policer_result_e packet_color, u64 time)
enum ip_dscp_t_ ip_dscp_t
static_always_inline u32 vlib_buffer_enqueue_to_thread(vlib_main_t *vm, vlib_node_runtime_t *node, u32 frame_queue_index, u32 *buffer_indices, u16 *thread_indices, u32 n_packets, int drop_on_congestion)
vlib_main_t vlib_node_runtime_t vlib_frame_t * frame
vnet_policer_main_t vnet_policer_main
struct policer_handoff_trace_t_ policer_handoff_trace_t
vlib_get_buffers(vm, from, b, n_left_from)
vlib_main_t vlib_node_runtime_t * node
#define IP6_NON_DSCP_BITS
vlib_main_t * vm
X-connect all packets from the HOST to the PHY.
#define IP4_NON_DSCP_BITS
qos_action_type_en action[3]
static uword vlib_buffer_length_in_chain(vlib_main_t *vm, vlib_buffer_t *b)
Get length in bytes of the buffer chain.
static_always_inline uword policer_handoff(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame, u32 fq_index, u32 policer_index)
@ POLICER_HANDOFF_ERROR_CONGESTION_DROP
vlib_combined_counter_main_t policer_counters[]
u8 * format_policer_handoff_trace(u8 *s, va_list *args)
#define VLIB_NODE_FLAG_TRACE
static void * vlib_frame_vector_args(vlib_frame_t *f)
Get pointer to frame vector data.
static void vlib_prefetch_combined_counter(const vlib_combined_counter_main_t *cm, u32 thread_index, u32 index)
Pre-fetch a per-thread combined counter for the given object index.
#define static_always_inline
@ QOS_ACTION_MARK_AND_TRANSMIT
static void vlib_node_increment_counter(vlib_main_t *vm, u32 node_index, u32 counter_index, u64 increment)
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)
#define clib_atomic_cmp_and_swap(addr, old, new)
void * vlib_add_trace(vlib_main_t *vm, vlib_node_runtime_t *r, vlib_buffer_t *b, u32 n_data_bytes)
static u16 ip4_header_checksum(ip4_header_t *i)
vl_api_fib_path_type_t type
static_always_inline void vnet_policer_mark(vlib_buffer_t *b, ip_dscp_t dscp)
vlib_increment_combined_counter(ccm, ti, sw_if_index, n_buffers, n_bytes)
u32 flags
buffer flags: VLIB_BUFFER_FREE_LIST_INDEX_MASK: bits used to store free list index,...
VLIB buffer representation.