38 s =
format (s,
"FLOW_CLASSIFY: sw_if_index %d next %d table %d offset %d",
43 #define foreach_flow_classify_error \ 44 _(MISS, "Flow classify misses") \ 45 _(HIT, "Flow classify hits") \ 46 _(CHAIN_HIT, "Flow classify hits after chain walk") \ 47 _(DROP, "Flow classify action drop") 50 #define _(sym,str) FLOW_CLASSIFY_ERROR_##sym, 57 #define _(sym,string) string, 68 u32 n_left_from, * from, * to_next;
82 while (n_left_from > 2)
87 u32 sw_if_index0, sw_if_index1;
88 u32 table_index0, table_index1;
132 vnet_buffer(b0)->l2_classify.table_index = table_index0;
134 vnet_buffer(b1)->l2_classify.table_index = table_index1;
140 while (n_left_from > 0)
160 vnet_buffer(b0)->l2_classify.table_index = table_index0;
171 while (n_left_from > 0)
178 while (n_left_from > 0 && n_left_to_next > 0)
185 vnet_classify_entry_t * e0;
197 table_index1 =
vnet_buffer(p1)->l2_classify.table_index;
217 table_index0 =
vnet_buffer(b0)->l2_classify.table_index;
239 h0, ~0, 0, 0, 0, 0, 1);
257 n_left_to_next, bi0, next0);
264 FLOW_CLASSIFY_ERROR_MISS,
267 FLOW_CLASSIFY_ERROR_HIT,
270 FLOW_CLASSIFY_ERROR_CHAIN_HIT,
273 FLOW_CLASSIFY_ERROR_DROP,
289 .name =
"ip4-flow-classify",
290 .vector_size =
sizeof (
u32),
312 .name =
"ip6-flow-classify",
313 .vector_size =
sizeof (
u32),
u64 vnet_classify_hash_packet(vnet_classify_table_t *t, u8 *h)
vnet_config_main_t * vnet_config_main[FLOW_CLASSIFY_N_TABLES]
static char * flow_classify_error_strings[]
u32 current_config_index
Used by feature subgraph arcs to visit enabled feature nodes.
VLIB_NODE_FUNCTION_MULTIARCH(ip4_flow_classify_node, ip4_flow_classify)
vnet_main_t * vnet_get_main(void)
static f64 vlib_time_now(vlib_main_t *vm)
void vlib_put_next_frame(vlib_main_t *vm, vlib_node_runtime_t *r, u32 next_index, u32 n_vectors_left)
Release pointer to next frame vector data.
flow_classify_next_index_t
vlib_node_registration_t ip6_flow_classify_node
(constructor) VLIB_REGISTER_NODE (ip6_flow_classify_node)
#define VLIB_INIT_FUNCTION(x)
static clib_error_t * flow_classify_init(vlib_main_t *vm)
u32 * classify_table_index_by_sw_if_index[FLOW_CLASSIFY_N_TABLES]
#define vlib_prefetch_buffer_header(b, type)
Prefetch buffer metadata.
static void vnet_classify_prefetch_bucket(vnet_classify_table_t *t, u64 hash)
#define foreach_flow_classify_error
flow_classify_main_t flow_classify_main
static uword ip6_flow_classify(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
static void vnet_classify_prefetch_entry(vnet_classify_table_t *t, u64 hash)
int vnet_classify_add_del_session(vnet_classify_main_t *cm, u32 table_index, u8 *match, u32 hit_next_index, u32 opaque_index, i32 advance, u8 action, u32 metadata, int is_add)
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
static u8 * format_flow_classify_trace(u8 *s, va_list *args)
static void * vnet_get_config_data(vnet_config_main_t *cm, u32 *config_index, u32 *next_index, u32 n_data_bytes)
u32 node_index
Node index.
static uword flow_classify_inline(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame, flow_classify_table_id_t tid)
#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.
#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 void vlib_node_increment_counter(vlib_main_t *vm, u32 node_index, u32 counter_index, u64 increment)
static uword vnet_classify_get_offset(vnet_classify_table_t *t, vnet_classify_entry_t *v)
#define CLIB_PREFETCH(addr, size, type)
#define VLIB_BUFFER_IS_TRACED
struct _vnet_classify_main vnet_classify_main_t
u16 cached_next_index
Next frame index that vector arguments were last enqueued to last time this node ran.
#define VLIB_NODE_FLAG_TRACE
vnet_classify_main_t vnet_classify_main
static void * vlib_add_trace(vlib_main_t *vm, vlib_node_runtime_t *r, vlib_buffer_t *b, u32 n_data_bytes)
vnet_classify_main_t * vnet_classify_main
vlib_node_registration_t ip4_flow_classify_node
(constructor) VLIB_REGISTER_NODE (ip4_flow_classify_node)
static void * vlib_frame_vector_args(vlib_frame_t *f)
Get pointer to frame vector data.
static uword ip4_flow_classify(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
#define VLIB_REGISTER_NODE(x,...)
u16 flags
Copy of main node flags.
#define CLIB_CACHE_LINE_BYTES
u32 flags
buffer flags: VLIB_BUFFER_IS_TRACED: trace this buffer.
static vlib_buffer_t * vlib_get_buffer(vlib_main_t *vm, u32 buffer_index)
Translate buffer index into buffer pointer.
vnet_classify_entry_t * vnet_classify_find_entry(vnet_classify_table_t *t, u8 *h, u64 hash, f64 now)