/* * Copyright (c) 2016 Cisco and/or its affiliates. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at: * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef included_features_h #define included_features_h #include #include #include /** feature registration object */ typedef struct _vnet_feature_arc_registration { /** next registration in list of all registrations*/ struct _vnet_feature_arc_registration *next; /** Feature Arc name */ char *arc_name; /** Start nodes */ char **start_nodes; int n_start_nodes; /** End of the arc (optional, for consistency-checking) */ char *last_in_arc; /* Feature arc index, assigned by init function */ u8 feature_arc_index; u8 *arc_index_ptr; } vnet_feature_arc_registration_t; /* Enable feature callback. */ typedef clib_error_t *(vnet_feature_enable_disable_function_t) (u32 sw_if_index, int enable_disable); /** feature registration object */ typedef struct _vnet_feature_registration { /** next registration in list of all registrations*/ struct _vnet_feature_registration *next, *next_in_arc; /** Feature arc name */ char *arc_name; /** Graph node name */ char *node_name; /** Pointer to this feature index, filled in by vnet_feature_arc_init */ u32 *feature_index_ptr; u32 feature_index; /** Constraints of the form "this feature runs before X" */ char **runs_before; /** Constraints of the form "this feature runs after Y" */ char **runs_after; /** Function to enable/disable feature **/ vnet_feature_enable_disable_function_t *enable_disable_cb; } vnet_feature_registration_t; /** constraint registration object */ typedef struct _vnet_feature_constraint_registration { /** next constraint set in list of all registrations*/ struct _vnet_feature_constraint_registration *next, *next_in_arc; /** Feature arc name */ char *arc_name; /** Feature arc index, assigned by init function */ u8 feature_arc_index; /** Node names, to run in the specified order */ char **node_names; } vnet_feature_constraint_registration_t; typedef struct vnet_feature_config_main_t_ { vnet_config_main_t config_main; u32 *config_index_by_sw_if_index; } vnet_feature_config_main_t; typedef struct { /** feature arc configuration list */ vnet_feature_arc_registration_t *next_arc; uword **arc_index_by_name; /** feature path configuration lists */ vnet_feature_registration_t *next_feature; vnet_feature_registration_t **next_feature_by_arc; vnet_feature_constraint_registration_t *next_constraint; vnet_feature_constraint_registration_t **next_constraint_by_arc; uword **next_feature_by_name; /** feature config main objects */ vnet_feature_config_main_t *feature_config_mains; /** Save partial order results for show command */ char ***feature_nodes; /** bitmap of interfaces which have driver rx features configured */ uword **sw_if_index_has_features; /** feature reference counts by interface */ i16 **feature_count_by_sw_if_index; /** Feature arc index for device-input */ u8 device_input_feature_arc_index; /** convenience */ vlib_main_t *vlib_main; vnet_main_t *vnet_main; } vnet_feature_main_t; extern vnet_feature_main_t feature_main; #ifndef CLIB_MARCH_VARIANT #define VNET_FEATURE_ARC_INIT(x,...) \ __VA_ARGS__ vnet_feature_arc_registration_t vnet_feat_arc_##x;\ static void __vnet_add_feature_arc_registration_##x (void) \ __attribute__((__constructor__)) ; \ static void __vnet_add_feature_arc_registration_##x (void) \ { \ vnet_feature_main_t * fm = &feature_main; \ vnet_feat_arc_##x.next = fm->next_arc; \ fm->next_arc = & vnet_feat_arc_##x; \ } \ static void __vnet_rm_feature_arc_registration_##x (void) \ __attribute__((__destructor__)) ; \ static void __vnet_rm_feature_arc_registration_##x (void) \ { \ vnet_feature_main_t * fm = &feature_main; \ vnet_feature_arc_registration_t *r = &vnet_feat_arc_##x; \ VLIB_REMOVE_FROM_LINKED_LIST (fm->next_arc, r, next); \ } \ __VA_ARGS__ vnet_feature_arc_registration_t vnet_feat_arc_##x #define VNET_FEATURE_INIT(x,...) \ __VA_ARGS__ vnet_feature_registration_t vnet_feat_##x; \ static void __vnet_add_feature_registration_##x (void) \ __attribute__((__constructor__)) ; \ static void __vnet_add_feature_registration_##x (void) \ { \ vnet_feature_main_t * fm = &feature_main; \ vnet_feat_##x.next = fm->next_feature; \ fm->next_feature = & vnet_feat_##x; \ } \ static void __vnet_rm_feature_registration_##x (void) \ __attribute__((__destructor__)) ; \ static void __vnet_rm_feature_registration_##x (void) \ { \ vnet_feature_main_t * fm = &feature_main; \ vnet_feature_registration_t *r = &vnet_feat_##x; \ VLIB_REMOVE_FROM_LINKED_LIST (fm->next_feature, r, next); \ } \ __VA_ARGS__ vnet_feature_registration_t vnet_feat_##x #define VNET_FEATURE_ARC_ORDER(x,...) \ __VA_ARGS__ vnet_feature_constraint_registration_t \ vnet_feature_constraint_##x; \ static void __vnet_add_constraint_registration_##x (void) \ __attribute__((__constructor__)) ; \ static void __vnet_add_constraint_registration_##x (void) \ { \ vnet_feature_main_t * fm = &feature_main; \ vnet_feature_constraint_##x.next = fm->next_constraint; \ fm->next_constraint = & vnet_feature_constraint_##x; \ } \ static void __vnet_rm_constraint_registration_##x (void) \ __attribute__
/*
 * Copyright (c) 2017 Cisco and/or its affiliates.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at:
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#ifndef __included_tw_timer_16t_2w_512sl_h__
#define __included_tw_timer_16t_2w_512sl_h__

/* ... So that a client app can create multiple wheel geometries */
#undef TW_TIMER_WHEELS
#undef TW_SLOTS_PER_RING
#undef TW_RING_SHIFT
#undef TW_RING_MASK
#undef TW_TIMERS_PER_OBJECT
#undef LOG2_TW_TIMERS_PER_OBJECT
#undef TW_SUFFIX

#define TW_TIMER_WHEELS 1
#define TW_SLOTS_PER_RING 2048
#define TW_RING_SHIFT 11
#define TW_RING_MASK (TW_SLOTS_PER_RING -1)
#define TW_TIMERS_PER_OBJECT 16
#define LOG2_TW_TIMERS_PER_OBJECT 4
#define TW_SUFFIX _16t_1w_2048sl

#include <vppinfra/tw_timer_template.h>

#endif /* __included_tw_timer_16t_2w_512sl_h__ */

/*
 * fd.io coding-style-patch-verification: ON
 *
 * Local Variables:
 * eval: (c-set-style "gnu")
 * End:
 */
dex = b0->current_config_index; vnet_get_config_data (&cm->config_main, &b0->current_config_index, next0, /* # bytes of config data */ 0); vnet_get_config_data (&cm->config_main, &b1->current_config_index, next1, /* # bytes of config data */ 0); vnet_get_config_data (&cm->config_main, &b2->current_config_index, next2, /* # bytes of config data */ 0); vnet_get_config_data (&cm->config_main, &b3->current_config_index, next3, /* # bytes of config data */ 0); } } #define VNET_FEATURES(...) (char*[]) { __VA_ARGS__, 0} 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, vnet_feature_constraint_registration_t * first_const_set, char ***in_feature_nodes); void vnet_interface_features_show (vlib_main_t * vm, u32 sw_if_index, int verbose); #endif /* included_feature_h */ /* * fd.io coding-style-patch-verification: ON * * Local Variables: * eval: (c-set-style "gnu") * End: */