}
vnet_classify_table_t *
-vnet_classify_new_table (vnet_classify_main_t * cm,
- u8 * mask, u32 nbuckets, u32 memory_size,
- u32 skip_n_vectors, u32 match_n_vectors)
+vnet_classify_new_table (vnet_classify_main_t *cm, const u8 *mask,
+ u32 nbuckets, u32 memory_size, u32 skip_n_vectors,
+ u32 match_n_vectors)
{
vnet_classify_table_t *t;
void *oldheap;
nbuckets = 1 << (max_log2 (nbuckets));
- pool_get_aligned (cm->tables, t, CLIB_CACHE_LINE_BYTES);
- clib_memset (t, 0, sizeof (*t));
+ pool_get_aligned_zero (cm->tables, t, CLIB_CACHE_LINE_BYTES);
vec_validate_aligned (t->mask, match_n_vectors - 1, sizeof (u32x4));
clib_memcpy_fast (t->mask, mask, match_n_vectors * sizeof (u32x4));
fib_table_lock (e->metadata, FIB_PROTOCOL_IP6, FIB_SOURCE_CLASSIFY);
break;
case CLASSIFY_ACTION_SET_METADATA:
+ case CLASSIFY_ACTION_NONE:
break;
}
}
fib_table_unlock (e->metadata, FIB_PROTOCOL_IP6, FIB_SOURCE_CLASSIFY);
break;
case CLASSIFY_ACTION_SET_METADATA:
+ case CLASSIFY_ACTION_NONE:
break;
}
}
-int
-vnet_classify_add_del (vnet_classify_table_t * t,
- vnet_classify_entry_t * add_v, int is_add)
+static int
+vnet_classify_add_del (vnet_classify_table_t *t, vnet_classify_entry_t *add_v,
+ int is_add)
{
u32 bucket_index;
vnet_classify_bucket_t *b, tmp_b;
}
int
-vnet_classify_add_del_table (vnet_classify_main_t * cm,
- u8 * mask,
- u32 nbuckets,
- u32 memory_size,
- u32 skip,
- u32 match,
- u32 next_table_index,
- u32 miss_next_index,
- u32 * table_index,
- u8 current_data_flag,
- i16 current_data_offset,
+vnet_classify_add_del_table (vnet_classify_main_t *cm, const u8 *mask,
+ u32 nbuckets, u32 memory_size, u32 skip,
+ u32 match, u32 next_table_index,
+ u32 miss_next_index, u32 *table_index,
+ u8 current_data_flag, i16 current_data_offset,
int is_add, int del_chain)
{
vnet_classify_table_t *t;
* Put the table index where device drivers can find them.
* This table index will be either a valid table or a ~0 to clear it.
*/
- cm->classify_table_index_by_sw_if_index[sw_if_index] = table_index;
+ if (vec_len (cm->classify_table_index_by_sw_if_index) > sw_if_index)
+ cm->classify_table_index_by_sw_if_index[sw_if_index] = table_index;
if (sw_if_index > 0)
{
vnet_hw_interface_t *hi;
};
/* *INDENT-ON* */
-
-
-
-static u8 *
-format_vnet_classify_table (u8 * s, va_list * args)
+u8 *
+format_vnet_classify_table (u8 *s, va_list *args)
{
vnet_classify_main_t *cm = va_arg (*args, vnet_classify_main_t *);
int verbose = va_arg (*args, int);
}
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)
+vnet_classify_add_del_session (vnet_classify_main_t *cm, u32 table_index,
+ const u8 *match, u32 hit_next_index,
+ u32 opaque_index, i32 advance, u8 action,
+ u16 metadata, int is_add)
{
vnet_classify_table_t *t;
vnet_classify_entry_5_t _max_e __attribute__ ((aligned (16)));