41 u32 feat_next_node_index[32];
64 s =
format (s,
"INACL: sw_if_index %d, next_index %d, table %d, offset %d",
73 #define foreach_l2_inacl_error \ 74 _(NONE, "valid input ACL packets") \ 75 _(MISS, "input ACL misses") \ 76 _(HIT, "input ACL hits") \ 77 _(CHAIN_HIT, "input ACL hits after chain walk") \ 78 _(TABLE_MISS, "input ACL table-miss drops") \ 79 _(SESSION_DENY, "input ACL session deny drops") 84 #define _(sym,str) L2_INACL_ERROR_##sym, 91 #define _(sym,string) string, 100 u32 n_left_from, *from, *to_next;
116 while (n_left_from > 2)
121 u32 sw_if_index0, sw_if_index1;
122 u32 table_index0, table_index1;
176 vnet_buffer (b0)->l2_classify.table_index = table_index0;
178 vnet_buffer (b1)->l2_classify.table_index = table_index1;
184 while (n_left_from > 0)
210 vnet_buffer (b0)->l2_classify.table_index = table_index0;
221 while (n_left_from > 0)
228 while (n_left_from > 0 && n_left_to_next > 0)
235 vnet_classify_entry_t *e0;
248 table_index1 =
vnet_buffer (p1)->l2_classify.table_index;
268 table_index0 =
vnet_buffer (b0)->l2_classify.table_index;
298 e0->next_index : next0;
303 L2_INACL_ERROR_SESSION_DENY : L2_INACL_ERROR_NONE;
323 L2_INACL_ERROR_TABLE_MISS : L2_INACL_ERROR_NONE;
338 (t0, (
u8 *) h0, hash0, now);
343 e0->next_index : next0;
348 L2_INACL_ERROR_SESSION_DENY : L2_INACL_ERROR_NONE;
369 to_next, n_left_to_next,
377 L2_INACL_ERROR_MISS, misses);
379 L2_INACL_ERROR_HIT, hits);
381 L2_INACL_ERROR_CHAIN_HIT, chain_hits);
388 .name =
"l2-input-acl",
389 .vector_size =
sizeof (
u32),
u64 vnet_classify_hash_packet(vnet_classify_table_t *t, u8 *h)
vnet_main_t * vnet_get_main(void)
u32 * classify_table_index_by_sw_if_index[INPUT_ACL_N_TABLES]
static f64 vlib_time_now(vlib_main_t *vm)
struct _vlib_node_registration vlib_node_registration_t
vlib_error_t * errors
Vector of errors for this node.
vnet_classify_main_t * vnet_classify_main
static u32 vnet_l2_feature_next(vlib_buffer_t *b, u32 *next_nodes, u32 feat_bit)
Return the graph node index for the feature corresponding to the next set bit after clearing the curr...
#define CLASSIFY_FLAG_USE_CURR_DATA
#define VLIB_INIT_FUNCTION(x)
#define vlib_prefetch_buffer_header(b, type)
Prefetch buffer metadata.
static void vnet_classify_prefetch_bucket(vnet_classify_table_t *t, u64 hash)
static void vnet_classify_prefetch_entry(vnet_classify_table_t *t, u64 hash)
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
static void * vlib_buffer_get_current(vlib_buffer_t *b)
Get pointer to current data to process.
u32 node_index
Node index.
#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).
vlib_error_t error
Error code for buffers to be enqueued to error handler.
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)
u32 feat_next_node_index[32]
#define CLIB_PREFETCH(addr, size, type)
static void feat_bitmap_init_next_nodes(vlib_main_t *vm, u32 node_index, u32 num_features, char **feat_names, u32 *next_nodes)
Initialize the feature next-node indexes of a graph node.
#define VLIB_BUFFER_IS_TRACED
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.
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.
static void vlib_buffer_advance(vlib_buffer_t *b, word l)
Advance current data pointer by the supplied (signed!) amount.
#define VLIB_NODE_FLAG_TRACE
static void * vlib_add_trace(vlib_main_t *vm, vlib_node_runtime_t *r, vlib_buffer_t *b, u32 n_data_bytes)
static void * vlib_frame_vector_args(vlib_frame_t *f)
Get pointer to frame vector data.
#define VLIB_NODE_FUNCTION_MULTIARCH(node, fn)
#define VLIB_REGISTER_NODE(x,...)
u16 flags
Copy of main node flags.
#define CLIB_CACHE_LINE_BYTES
u32 flags
buffer flags: VLIB_BUFFER_FREE_LIST_INDEX_MASK: bits used to store free list index, 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)