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)
144 while (n_left_from > 0)
146 if (!single_policer_node)
154 ti[0] = policer_thread;
158 b[0]->
flags & VLIB_BUFFER_IS_TRACED))
182 #endif // __POLICE_INLINES_H__ struct policer_handoff_trace_t_ policer_handoff_trace_t
u32 flags
buffer flags: VLIB_BUFFER_FREE_LIST_INDEX_MASK: bits used to store free list index, VLIB_BUFFER_IS_TRACED: trace this buffer.
u8 * format_policer_handoff_trace(u8 *s, va_list *args)
vlib_increment_combined_counter(ccm, ti, sw_if_index, n_buffers, n_bytes)
vlib_main_t vlib_node_runtime_t vlib_frame_t * frame
static uword vlib_buffer_length_in_chain(vlib_main_t *vm, vlib_buffer_t *b)
Get length in bytes of the buffer chain.
vnet_policer_main_t vnet_policer_main
static policer_result_e vnet_police_packet(policer_t *policer, u32 packet_length, policer_result_e packet_color, u64 time)
#define static_always_inline
vlib_get_buffers(vm, from, b, n_left_from)
vl_api_fib_path_type_t type
qos_action_type_en action[3]
vlib_combined_counter_main_t policer_counters[]
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.
vlib_main_t * vm
X-connect all packets from the HOST to the PHY.
u32 node_index
Node index.
static void vlib_node_increment_counter(vlib_main_t *vm, u32 node_index, u32 counter_index, u64 increment)
#define IP6_NON_DSCP_BITS
#define clib_atomic_cmp_and_swap(addr, old, new)
#define IP4_NON_DSCP_BITS
enum ip_dscp_t_ ip_dscp_t
static_always_inline void vnet_policer_mark(vlib_buffer_t *b, ip_dscp_t dscp)
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)
vlib_main_t vlib_node_runtime_t * node
VLIB buffer representation.
static void * vlib_frame_vector_args(vlib_frame_t *f)
Get pointer to frame vector data.
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)
u16 flags
Copy of main node flags.
void * vlib_add_trace(vlib_main_t *vm, vlib_node_runtime_t *r, vlib_buffer_t *b, u32 n_data_bytes)
#define VLIB_NODE_FLAG_TRACE
vlib_buffer_t * bufs[VLIB_FRAME_SIZE]
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)
static u16 ip4_header_checksum(ip4_header_t *i)