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;
52 u32 *feature_index_ptr;
102 #define VNET_FEATURE_ARC_INIT(x,...) \ 103 __VA_ARGS__ vnet_feature_arc_registration_t vnet_feat_arc_##x;\ 104 static void __vnet_add_feature_arc_registration_##x (void) \ 105 __attribute__((__constructor__)) ; \ 106 static void __vnet_add_feature_arc_registration_##x (void) \ 108 vnet_feature_main_t * fm = &feature_main; \ 109 vnet_feat_arc_##x.next = fm->next_arc; \ 110 fm->next_arc = & vnet_feat_arc_##x; \ 112 __VA_ARGS__ vnet_feature_arc_registration_t vnet_feat_arc_##x 114 #define VNET_FEATURE_INIT(x,...) \ 115 __VA_ARGS__ vnet_feature_registration_t vnet_feat_##x; \ 116 static void __vnet_add_feature_registration_##x (void) \ 117 __attribute__((__constructor__)) ; \ 118 static void __vnet_add_feature_registration_##x (void) \ 120 vnet_feature_main_t * fm = &feature_main; \ 121 vnet_feat_##x.next = fm->next_feature; \ 122 fm->next_feature = & vnet_feat_##x; \ 124 __VA_ARGS__ vnet_feature_registration_t vnet_feat_##x 128 u32 sw_if_index,
int is_add);
133 const char *node_name);
138 u32 sw_if_index,
int enable_disable,
139 void *feature_config,
140 u32 n_feature_config_bytes);
144 u32 sw_if_index,
int enable_disable,
145 void *feature_config,
146 u32 n_feature_config_bytes);
153 if (arc_index == (
u8) ~ 0)
245 vnet_buffer (b0)->device_input_feat.saved_next_index = *next0;
247 vnet_buffer (b0)->device_input_feat.buffer_advance = adv;
279 vnet_buffer (b0)->device_input_feat.saved_next_index = *next0;
281 vnet_buffer (b0)->device_input_feat.buffer_advance = adv;
284 vnet_buffer (b1)->device_input_feat.saved_next_index = *next1;
286 vnet_buffer (b1)->device_input_feat.buffer_advance = adv;
326 vnet_buffer (b0)->device_input_feat.saved_next_index = *next0;
328 vnet_buffer (b0)->device_input_feat.buffer_advance = adv;
331 vnet_buffer (b1)->device_input_feat.saved_next_index = *next1;
333 vnet_buffer (b1)->device_input_feat.buffer_advance = adv;
336 vnet_buffer (b2)->device_input_feat.saved_next_index = *next2;
338 vnet_buffer (b2)->device_input_feat.buffer_advance = adv;
341 vnet_buffer (b3)->device_input_feat.saved_next_index = *next3;
343 vnet_buffer (b3)->device_input_feat.buffer_advance = adv;
368 #define VNET_FEATURES(...) (char*[]) { __VA_ARGS__, 0} 372 char **feature_start_nodes,
373 int num_feature_start_nodes,
375 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
u8 feature_arc_index
Used to identify feature arcs by intermediate feature node.
vnet_feature_main_t feature_main
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)
static_always_inline void vnet_feature_next(u32 sw_if_index, u32 *next0, vlib_buffer_t *b0)
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)
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.
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 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
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)