40 #ifndef included_vnet_interface_h 41 #define included_vnet_interface_h 59 typedef struct _vnet_interface_function_list_elt {
60 struct _vnet_interface_function_list_elt * next_interface_function;
62 } _vnet_interface_function_list_elt_t;
64 #define _VNET_INTERFACE_FUNCTION_DECL(f,tag) \ 66 static void __vnet_interface_function_init_##tag##_##f (void) \ 67 __attribute__((__constructor__)) ; \ 69 static void __vnet_interface_function_init_##tag##_##f (void) \ 71 vnet_main_t * vnm = vnet_get_main(); \ 72 static _vnet_interface_function_list_elt_t init_function; \ 73 init_function.next_interface_function = vnm->tag##_functions; \ 74 vnm->tag##_functions = &init_function; \ 75 init_function.fp = (void *) &f; \ 78 #define VNET_HW_INTERFACE_ADD_DEL_FUNCTION(f) \ 79 _VNET_INTERFACE_FUNCTION_DECL(f,hw_interface_add_del) 80 #define VNET_HW_INTERFACE_LINK_UP_DOWN_FUNCTION(f) \ 81 _VNET_INTERFACE_FUNCTION_DECL(f,hw_interface_link_up_down) 82 #define VNET_SW_INTERFACE_ADD_DEL_FUNCTION(f) \ 83 _VNET_INTERFACE_FUNCTION_DECL(f,sw_interface_add_del) 84 #define VNET_SW_INTERFACE_ADMIN_UP_DOWN_FUNCTION(f) \ 85 _VNET_INTERFACE_FUNCTION_DECL(f,sw_interface_admin_up_down) 88 typedef struct _vnet_device_class {
111 char ** tx_function_error_strings;
114 u32 tx_function_n_errors;
132 void (* clear_counters) (
u32 dev_class_instance);
139 u32 new_hw_class_index);
147 struct _vnet_device_class * next_class_registration;
150 u8 no_flatten_output_chains;
154 #define VNET_DEVICE_CLASS(x,...) \ 155 __VA_ARGS__ vnet_device_class_t x; \ 156 static void __vnet_add_device_class_registration_##x (void) \ 157 __attribute__((__constructor__)) ; \ 158 static void __vnet_add_device_class_registration_##x (void) \ 160 vnet_main_t * vnm = vnet_get_main(); \ 161 x.next_class_registration = vnm->device_class_registrations; \ 162 vnm->device_class_registrations = &x; \ 164 __VA_ARGS__ vnet_device_class_t x 167 typedef struct _vnet_hw_interface_class {
208 uword max_rewrite_bytes);
217 struct _vnet_hw_interface_class * next_class_registration;
221 #define VNET_HW_INTERFACE_CLASS(x,...) \ 222 __VA_ARGS__ vnet_hw_interface_class_t x; \ 223 static void __vnet_add_hw_interface_class_registration_##x (void) \ 224 __attribute__((__constructor__)) ; \ 225 static void __vnet_add_hw_interface_class_registration_##x (void) \ 227 vnet_main_t * vnm = vnet_get_main(); \ 228 x.next_class_registration = vnm->hw_interface_class_registrations; \ 229 vnm->hw_interface_class_registrations = &x; \ 231 __VA_ARGS__ vnet_hw_interface_class_t x 241 #define VNET_HW_INTERFACE_FLAG_LINK_UP (1 << 0) 243 #define VNET_HW_INTERFACE_FLAG_DUPLEX_SHIFT 1 244 #define VNET_HW_INTERFACE_FLAG_HALF_DUPLEX (1 << 1) 245 #define VNET_HW_INTERFACE_FLAG_FULL_DUPLEX (1 << 2) 246 #define VNET_HW_INTERFACE_FLAG_DUPLEX_MASK \ 247 (VNET_HW_INTERFACE_FLAG_HALF_DUPLEX | \ 248 VNET_HW_INTERFACE_FLAG_FULL_DUPLEX) 251 #define VNET_HW_INTERFACE_FLAG_SPEED_SHIFT 3 252 #define VNET_HW_INTERFACE_FLAG_SPEED_10M (1 << 3) 253 #define VNET_HW_INTERFACE_FLAG_SPEED_100M (1 << 4) 254 #define VNET_HW_INTERFACE_FLAG_SPEED_1G (1 << 5) 255 #define VNET_HW_INTERFACE_FLAG_SPEED_10G (1 << 6) 256 #define VNET_HW_INTERFACE_FLAG_SPEED_40G (1 << 7) 257 #define VNET_HW_INTERFACE_FLAG_SPEED_100G (1 << 8) 258 #define VNET_HW_INTERFACE_FLAG_SPEED_MASK \ 259 (VNET_HW_INTERFACE_FLAG_SPEED_10M | \ 260 VNET_HW_INTERFACE_FLAG_SPEED_100M | \ 261 VNET_HW_INTERFACE_FLAG_SPEED_1G | \ 262 VNET_HW_INTERFACE_FLAG_SPEED_10G | \ 263 VNET_HW_INTERFACE_FLAG_SPEED_40G | \ 264 VNET_HW_INTERFACE_FLAG_SPEED_100G) 267 #define VNET_HW_INTERFACE_FLAG_L2OUTPUT_SHIFT 9 268 #define VNET_HW_INTERFACE_FLAG_L2OUTPUT_MAPPED (1 << 9) 326 #define VNET_HW_INTERFACE_BOND_INFO_NONE ((uword *) 0) 327 #define VNET_HW_INTERFACE_BOND_INFO_SLAVE ((uword *) ~0) 368 vnet_sw_interface_type_t
type : 16;
373 #define VNET_SW_INTERFACE_FLAG_ADMIN_UP (1 << 0) 376 #define VNET_SW_INTERFACE_FLAG_PUNT (1 << 1) 378 #define VNET_SW_INTERFACE_FLAG_PROXY_ARP (1 << 2) 380 #define VNET_SW_INTERFACE_FLAG_UNNUMBERED (1 << 3) 382 #define VNET_SW_INTERFACE_FLAG_BOND_SLAVE (1 << 4) 493 #define foreach_intf_output_feat \ 494 _(IPSEC, "ipsec-output") 498 #define _(sym,str) INTF_OUTPUT_FEAT_##sym, 505 #define INTF_OUTPUT_FEAT_DONE INTF_OUTPUT_N_FEAT 509 intf_output_feat_t feature,
int is_add);
uword( vlib_node_function_t)(struct vlib_main_t *vm, struct vlib_node_runtime_t *node, struct vlib_frame_t *frame)
volatile u32 * sw_if_counter_lock
vnet_hw_interface_nodes_t * deleted_hw_interface_nodes
static void(BVT(clib_bihash)*h, BVT(clib_bihash_value)*v)
int vnet_interface_add_del_feature(struct vnet_main_t *vnm, vlib_main_t *vm, u32 sw_if_index, intf_output_feat_t feature, int is_add)
bad routing header type(not 4)") sr_error (NO_MORE_SEGMENTS
uword * sub_interface_sw_if_index_by_id
struct _vnet_device_class vnet_device_class_t
f64 max_rate_bits_per_sec
uword * pcap_drop_filter_hash
vlib_combined_counter_main_t * combined_sw_if_counters
static clib_error_t * admin_up_down_function(vnet_main_t *vm, u32 hw_if_index, u32 flags)
clib_error_t *( vnet_interface_function_t)(struct vnet_main_t *vnm, u32 if_index, u32 flags)
void vnet_pcap_drop_trace_filter_add_del(u32 error_index, int is_add)
u32 max_supported_packet_bytes
uword * hw_interface_by_name
vnet_hw_interface_t * hw_interfaces
uword * sw_if_index_by_sup_and_sub
vlib_simple_counter_main_t * sw_if_counters
uword * hw_interface_class_by_name
static void vnet_interface_counter_unlock(vnet_interface_main_t *im)
vnet_interface_counter_type_t
u32 unnumbered_sw_if_index
static void vnet_interface_counter_lock(vnet_interface_main_t *im)
clib_error_t *( vnet_subif_add_del_function_t)(struct vnet_main_t *vnm, u32 if_index, struct vnet_sw_interface_t *template, int is_add)
uword * device_class_by_name
struct vnet_hw_interface_t vnet_hw_interface_t
struct _vnet_hw_interface_class vnet_hw_interface_class_t
vnet_sw_interface_t * sw_interfaces
u32 output_feature_bitmap
vnet_hw_interface_class_t * hw_interface_classes
static clib_error_t * link_up_down_function(vnet_main_t *vm, u32 hw_if_index, u32 flags)
u32 min_supported_packet_bytes
#define foreach_intf_output_feat
vnet_device_class_t * device_classes
u32 per_packet_overhead_bytes
int vnet_interface_name_renumber(u32 sw_if_index, u32 new_show_dev_instance)