16 #ifndef included_features_h 17 #define included_features_h 23 typedef struct _vnet_feature_arc_registration
26 struct _vnet_feature_arc_registration *next;
41 (
u32 sw_if_index,
int enable_disable);
44 typedef struct _vnet_feature_registration
47 struct _vnet_feature_registration *next;
53 u32 *feature_index_ptr;
104 #define VNET_FEATURE_ARC_INIT(x,...) \ 105 __VA_ARGS__ vnet_feature_arc_registration_t vnet_feat_arc_##x;\ 106 static void __vnet_add_feature_arc_registration_##x (void) \ 107 __attribute__((__constructor__)) ; \ 108 static void __vnet_add_feature_arc_registration_##x (void) \ 110 vnet_feature_main_t * fm = &feature_main; \ 111 vnet_feat_arc_##x.next = fm->next_arc; \ 112 fm->next_arc = & vnet_feat_arc_##x; \ 114 __VA_ARGS__ vnet_feature_arc_registration_t vnet_feat_arc_##x 116 #define VNET_FEATURE_INIT(x,...) \ 117 __VA_ARGS__ vnet_feature_registration_t vnet_feat_##x; \ 118 static void __vnet_add_feature_registration_##x (void) \ 119 __attribute__((__constructor__)) ; \ 120 static void __vnet_add_feature_registration_##x (void) \ 122 vnet_feature_main_t * fm = &feature_main; \ 123 vnet_feat_##x.next = fm->next_feature; \ 124 fm->next_feature = & vnet_feat_##x; \ 126 __VA_ARGS__ vnet_feature_registration_t vnet_feat_##x 130 u32 sw_if_index,
int is_add);
135 const char *node_name);
140 u32 sw_if_index,
int enable_disable,
141 void *feature_config,
142 u32 n_feature_config_bytes);
146 u32 sw_if_index,
int enable_disable,
147 void *feature_config,
148 u32 n_feature_config_bytes);
155 if (arc_index == (
u8) ~ 0)
245 vnet_buffer (b0)->device_input_feat.saved_next_index = *next0;
246 vnet_buffer (b0)->device_input_feat.buffer_advance = buffer_advanced0;
263 u16 buffer_advanced0,
264 u16 buffer_advanced1)
279 vnet_buffer (b0)->device_input_feat.saved_next_index = *next0;
280 vnet_buffer (b1)->device_input_feat.saved_next_index = *next1;
281 vnet_buffer (b0)->device_input_feat.buffer_advance = buffer_advanced0;
282 vnet_buffer (b1)->device_input_feat.buffer_advance = buffer_advanced1;
308 u16 buffer_advanced0,
309 u16 buffer_advanced1,
310 u16 buffer_advanced2,
311 u16 buffer_advanced3)
326 vnet_buffer (b0)->device_input_feat.saved_next_index = *next0;
327 vnet_buffer (b1)->device_input_feat.saved_next_index = *next1;
328 vnet_buffer (b2)->device_input_feat.saved_next_index = *next2;
329 vnet_buffer (b3)->device_input_feat.saved_next_index = *next3;
331 vnet_buffer (b0)->device_input_feat.buffer_advance = buffer_advanced0;
332 vnet_buffer (b1)->device_input_feat.buffer_advance = buffer_advanced1;
333 vnet_buffer (b2)->device_input_feat.buffer_advance = buffer_advanced2;
334 vnet_buffer (b3)->device_input_feat.buffer_advance = buffer_advanced3;
363 #define VNET_FEATURES(...) (char*[]) { __VA_ARGS__, 0} 367 char **feature_start_nodes,
368 int num_feature_start_nodes,
370 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
u32 * config_index_by_sw_if_index
static_always_inline void vnet_feature_start_device_input_x1(u32 sw_if_index, u32 *next0, vlib_buffer_t *b0, u16 buffer_advanced0)
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
u8 feature_arc_index
Used to identify feature arcs by intermediate feature node.
vnet_feature_main_t feature_main
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)
static_always_inline void vnet_feature_next(u32 sw_if_index, u32 *next0, vlib_buffer_t *b0)
uword ** next_feature_by_name
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)
u32 vnet_get_feature_index(u8 arc, const char *s)
static void vlib_buffer_advance(vlib_buffer_t *b, word l)
Advance current data pointer by the supplied (signed!) amount.
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
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.
void vnet_interface_features_show(vlib_main_t *vm, u32 sw_if_index)
Display the set of driver features configured on a specific interface Called by "show interface" hand...
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_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, u16 buffer_advanced0, u16 buffer_advanced1, u16 buffer_advanced2, u16 buffer_advanced3)
static vnet_feature_config_main_t * vnet_get_feature_arc_config_main(u8 arc_index)
static_always_inline void * vnet_feature_next_with_data(u32 sw_if_index, u32 *next0, vlib_buffer_t *b0, u32 n_data_bytes)
struct _vnet_feature_arc_registration vnet_feature_arc_registration_t
feature registration object
vnet_feature_arc_registration_t * next_arc
feature arc configuration list
uword ** sw_if_index_has_features
bitmap of interfaces which have driver rx features configured
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, u16 buffer_advanced0, u16 buffer_advanced1)
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)