16 #ifndef included_features_h 17 #define included_features_h 24 typedef struct _vnet_feature_arc_registration
27 struct _vnet_feature_arc_registration *next;
40 (
u32 sw_if_index,
int enable_disable);
43 typedef struct _vnet_feature_registration
46 struct _vnet_feature_registration *next, *next_in_arc;
52 u32 *feature_index_ptr;
102 #ifndef CLIB_MARCH_VARIANT 103 #define VNET_FEATURE_ARC_INIT(x,...) \ 104 __VA_ARGS__ vnet_feature_arc_registration_t vnet_feat_arc_##x;\ 105 static void __vnet_add_feature_arc_registration_##x (void) \ 106 __attribute__((__constructor__)) ; \ 107 static void __vnet_add_feature_arc_registration_##x (void) \ 109 vnet_feature_main_t * fm = &feature_main; \ 110 vnet_feat_arc_##x.next = fm->next_arc; \ 111 fm->next_arc = & vnet_feat_arc_##x; \ 113 static void __vnet_rm_feature_arc_registration_##x (void) \ 114 __attribute__((__destructor__)) ; \ 115 static void __vnet_rm_feature_arc_registration_##x (void) \ 117 vnet_feature_main_t * fm = &feature_main; \ 118 vnet_feature_arc_registration_t *r = &vnet_feat_arc_##x; \ 119 VLIB_REMOVE_FROM_LINKED_LIST (fm->next_arc, r, next); \ 121 __VA_ARGS__ vnet_feature_arc_registration_t vnet_feat_arc_##x 123 #define VNET_FEATURE_INIT(x,...) \ 124 __VA_ARGS__ vnet_feature_registration_t vnet_feat_##x; \ 125 static void __vnet_add_feature_registration_##x (void) \ 126 __attribute__((__constructor__)) ; \ 127 static void __vnet_add_feature_registration_##x (void) \ 129 vnet_feature_main_t * fm = &feature_main; \ 130 vnet_feat_##x.next = fm->next_feature; \ 131 fm->next_feature = & vnet_feat_##x; \ 133 static void __vnet_rm_feature_registration_##x (void) \ 134 __attribute__((__destructor__)) ; \ 135 static void __vnet_rm_feature_registration_##x (void) \ 137 vnet_feature_main_t * fm = &feature_main; \ 138 vnet_feature_registration_t *r = &vnet_feat_##x; \ 139 VLIB_REMOVE_FROM_LINKED_LIST (fm->next_feature, r, next); \ 141 __VA_ARGS__ vnet_feature_registration_t vnet_feat_##x 143 #define VNET_FEATURE_ARC_INIT(x,...) \ 144 extern vnet_feature_arc_registration_t __clib_unused vnet_feat_arc_##x; \ 145 static vnet_feature_arc_registration_t __clib_unused __clib_unused_vnet_feat_arc_##x 146 #define VNET_FEATURE_INIT(x,...) \ 147 extern vnet_feature_registration_t __clib_unused vnet_feat_##x; \ 148 static vnet_feature_registration_t __clib_unused __clib_unused_vnet_feat_##x 153 u32 sw_if_index,
int is_add);
158 const char *node_name);
163 u32 sw_if_index,
int enable_disable,
164 void *feature_config,
165 u32 n_feature_config_bytes);
169 u32 sw_if_index,
int enable_disable,
170 void *feature_config,
171 u32 n_feature_config_bytes);
178 if (arc_index == (
u8) ~ 0)
280 vnet_buffer (b0)->feature_arc_index = feature_arc_index;
315 vnet_buffer (b0)->feature_arc_index = feature_arc_index;
316 vnet_buffer (b1)->feature_arc_index = feature_arc_index;
364 vnet_buffer (b0)->feature_arc_index = feature_arc_index;
365 vnet_buffer (b1)->feature_arc_index = feature_arc_index;
366 vnet_buffer (b2)->feature_arc_index = feature_arc_index;
367 vnet_buffer (b3)->feature_arc_index = feature_arc_index;
386 #define VNET_FEATURES(...) (char*[]) { __VA_ARGS__, 0} 390 char **feature_start_nodes,
391 int num_feature_start_nodes,
393 first_reg,
char ***feature_nodes);
vnet_config_main_t config_main
struct vnet_feature_config_main_t_ vnet_feature_config_main_t
u32 current_config_index
Used by feature subgraph arcs to visit enabled feature nodes.
char *** feature_nodes
Save partial order results for show command.
vnet_feature_registration_t * next_feature
feature path configuration lists
static_always_inline void vnet_feature_start_device_input_x4(u32 sw_if_index, u32 *next0, u32 *next1, u32 *next2, u32 *next3, vlib_buffer_t *b0, vlib_buffer_t *b1, vlib_buffer_t *b2, vlib_buffer_t *b3)
u32 * config_index_by_sw_if_index
static_always_inline int vnet_have_features(u8 arc, u32 sw_if_index)
void vnet_config_update_feature_count(vnet_feature_main_t *fm, u8 arc, u32 sw_if_index, int is_add)
#define static_always_inline
u8 vnet_get_feature_arc_index(const char *s)
vlib_main_t * vlib_main
convenience
static_always_inline int vnet_device_input_have_features(u32 sw_if_index)
void vnet_interface_features_show(vlib_main_t *vm, u32 sw_if_index, int verbose)
Display the set of driver features configured on a specific interface Called by "show interface" hand...
vnet_feature_main_t feature_main
static_always_inline void * vnet_feature_next_with_data(u32 *next0, vlib_buffer_t *b0, u32 n_data_bytes)
const u32 device_input_next_node_advance[((VNET_DEVICE_INPUT_N_NEXT_NODES/CLIB_CACHE_LINE_BYTES)+1)*CLIB_CACHE_LINE_BYTES]
clib_error_t * vnet_feature_arc_init(vlib_main_t *vm, vnet_config_main_t *vcm, char **feature_start_nodes, int num_feature_start_nodes, vnet_feature_registration_t *first_reg, char ***feature_nodes)
Initialize a feature graph arc.
static void * vnet_get_config_data(vnet_config_main_t *cm, u32 *config_index, u32 *next_index, u32 n_data_bytes)
uword ** next_feature_by_name
static_always_inline void vnet_feature_start_device_input_x2(u32 sw_if_index, u32 *next0, u32 *next1, vlib_buffer_t *b0, vlib_buffer_t *b1)
int vnet_feature_enable_disable_with_index(u8 arc_index, u32 feature_index, u32 sw_if_index, int enable_disable, void *feature_config, u32 n_feature_config_bytes)
static_always_inline void vnet_feature_next(u32 *next0, vlib_buffer_t *b0)
u32 vnet_get_feature_index(u8 arc, const char *s)
static uword clib_bitmap_get(uword *ai, uword i)
Gets the ith bit value from a bitmap.
uword ** arc_index_by_name
i16 ** feature_count_by_sw_if_index
feature reference counts by interface
vnet_feature_registration_t ** next_feature_by_arc
static void vlib_buffer_advance(vlib_buffer_t *b, word l)
Advance current data pointer by the supplied (signed!) amount.
int vnet_feature_enable_disable(const char *arc_name, const char *node_name, u32 sw_if_index, int enable_disable, void *feature_config, u32 n_feature_config_bytes)
clib_error_t *( vnet_feature_enable_disable_function_t)(u32 sw_if_index, int enable_disable)
#define vec_elt(v, i)
Get vector value at index i.
u8 device_input_feature_arc_index
Feature arc index for device-input.
static_always_inline u32 vnet_get_feature_config_index(u8 arc, u32 sw_if_index)
static_always_inline void * vnet_feature_arc_start_with_data(u8 arc, u32 sw_if_index, u32 *next, vlib_buffer_t *b, u32 n_data_bytes)
static vnet_feature_config_main_t * vnet_get_feature_arc_config_main(u8 arc_index)
struct _vnet_feature_arc_registration vnet_feature_arc_registration_t
feature registration object
vnet_feature_arc_registration_t * next_arc
feature arc configuration list
static_always_inline void vnet_feature_start_device_input_x1(u32 sw_if_index, u32 *next0, vlib_buffer_t *b0)
uword ** sw_if_index_has_features
bitmap of interfaces which have driver rx features configured
vnet_feature_registration_t * vnet_get_feature_reg(const char *arc_name, const char *node_name)
vnet_feature_config_main_t * feature_config_mains
feature config main objects
static_always_inline vnet_feature_config_main_t * vnet_feature_get_config_main(u16 arc)
struct _vnet_feature_registration vnet_feature_registration_t
feature registration object
static_always_inline void vnet_feature_arc_start(u8 arc, u32 sw_if_index, u32 *next0, vlib_buffer_t *b0)