40 #ifndef included_vnet_interface_h 41 #define included_vnet_interface_h 58 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
112 char **tx_function_error_strings;
115 u32 tx_function_n_errors;
119 u32 new_dev_instance);
134 void (*clear_counters) (
u32 dev_class_instance);
142 u32 hw_if_index,
u32 new_hw_class_index);
145 void (*rx_redirect_to_node) (
struct vnet_main_t * vnm,
146 u32 hw_if_index,
u32 node_index);
149 struct _vnet_device_class *next_class_registration;
152 u8 no_flatten_output_chains;
156 #define VNET_DEVICE_CLASS(x,...) \ 157 __VA_ARGS__ vnet_device_class_t x; \ 158 static void __vnet_add_device_class_registration_##x (void) \ 159 __attribute__((__constructor__)) ; \ 160 static void __vnet_add_device_class_registration_##x (void) \ 162 vnet_main_t * vnm = vnet_get_main(); \ 163 x.next_class_registration = vnm->device_class_registrations; \ 164 vnm->device_class_registrations = &x; \ 166 __VA_ARGS__ vnet_device_class_t x 168 #define VLIB_DEVICE_TX_FUNCTION_CLONE_TEMPLATE(arch, fn, tgt) \ 170 __attribute__ ((flatten)) \ 171 __attribute__ ((target (tgt))) \ 173 fn ## _ ## arch ( vlib_main_t * vm, \ 174 vlib_node_runtime_t * node, \ 175 vlib_frame_t * frame) \ 176 { return fn (vm, node, frame); } 178 #define VLIB_DEVICE_TX_FUNCTION_MULTIARCH_CLONE(fn) \ 179 foreach_march_variant(VLIB_DEVICE_TX_FUNCTION_CLONE_TEMPLATE, fn) 182 #define VLIB_MULTIARCH_CLONE_AND_SELECT_FN(fn,...) 183 #define VLIB_DEVICE_TX_FUNCTION_MULTIARCH(dev, fn) 185 #define VLIB_DEVICE_TX_FUNCTION_MULTIARCH(dev, fn) \ 186 VLIB_DEVICE_TX_FUNCTION_MULTIARCH_CLONE(fn) \ 187 CLIB_MULTIARCH_SELECT_FN(fn, static inline) \ 188 static void __attribute__((__constructor__)) \ 189 __vlib_device_tx_function_multiarch_select_##dev (void) \ 190 { dev.tx_function = fn ## _multiarch_select(); } 195 typedef struct _vnet_hw_interface_class
236 void *rewrite,
uword max_rewrite_bytes);
244 void (*hw_class_change) (
struct vnet_main_t * vnm,
u32 hw_if_index,
245 u32 old_class_index,
u32 new_class_index);
248 struct _vnet_hw_interface_class *next_class_registration;
252 #define VNET_HW_INTERFACE_CLASS(x,...) \ 253 __VA_ARGS__ vnet_hw_interface_class_t x; \ 254 static void __vnet_add_hw_interface_class_registration_##x (void) \ 255 __attribute__((__constructor__)) ; \ 256 static void __vnet_add_hw_interface_class_registration_##x (void) \ 258 vnet_main_t * vnm = vnet_get_main(); \ 259 x.next_class_registration = vnm->hw_interface_class_registrations; \ 260 vnm->hw_interface_class_registrations = &x; \ 262 __VA_ARGS__ vnet_hw_interface_class_t x 273 #define VNET_HW_INTERFACE_FLAG_LINK_UP (1 << 0) 275 #define VNET_HW_INTERFACE_FLAG_DUPLEX_SHIFT 1 276 #define VNET_HW_INTERFACE_FLAG_HALF_DUPLEX (1 << 1) 277 #define VNET_HW_INTERFACE_FLAG_FULL_DUPLEX (1 << 2) 278 #define VNET_HW_INTERFACE_FLAG_DUPLEX_MASK \ 279 (VNET_HW_INTERFACE_FLAG_HALF_DUPLEX | \ 280 VNET_HW_INTERFACE_FLAG_FULL_DUPLEX) 283 #define VNET_HW_INTERFACE_FLAG_SPEED_SHIFT 3 284 #define VNET_HW_INTERFACE_FLAG_SPEED_10M (1 << 3) 285 #define VNET_HW_INTERFACE_FLAG_SPEED_100M (1 << 4) 286 #define VNET_HW_INTERFACE_FLAG_SPEED_1G (1 << 5) 287 #define VNET_HW_INTERFACE_FLAG_SPEED_10G (1 << 6) 288 #define VNET_HW_INTERFACE_FLAG_SPEED_40G (1 << 7) 289 #define VNET_HW_INTERFACE_FLAG_SPEED_100G (1 << 8) 290 #define VNET_HW_INTERFACE_FLAG_SPEED_MASK \ 291 (VNET_HW_INTERFACE_FLAG_SPEED_10M | \ 292 VNET_HW_INTERFACE_FLAG_SPEED_100M | \ 293 VNET_HW_INTERFACE_FLAG_SPEED_1G | \ 294 VNET_HW_INTERFACE_FLAG_SPEED_10G | \ 295 VNET_HW_INTERFACE_FLAG_SPEED_40G | \ 296 VNET_HW_INTERFACE_FLAG_SPEED_100G) 299 #define VNET_HW_INTERFACE_FLAG_L2OUTPUT_SHIFT 9 300 #define VNET_HW_INTERFACE_FLAG_L2OUTPUT_MAPPED (1 << 9) 358 #define VNET_HW_INTERFACE_BOND_INFO_NONE ((uword *) 0) 359 #define VNET_HW_INTERFACE_BOND_INFO_SLAVE ((uword *) ~0) 410 vnet_sw_interface_type_t
type:16;
415 #define VNET_SW_INTERFACE_FLAG_ADMIN_UP (1 << 0) 418 #define VNET_SW_INTERFACE_FLAG_PUNT (1 << 1) 420 #define VNET_SW_INTERFACE_FLAG_PROXY_ARP (1 << 2) 422 #define VNET_SW_INTERFACE_FLAG_UNNUMBERED (1 << 3) 424 #define VNET_SW_INTERFACE_FLAG_BOND_SLAVE (1 << 4) 539 #define foreach_intf_output_feat \ 540 _(IPSEC, "ipsec-output") 545 #define _(sym,str) INTF_OUTPUT_FEAT_##sym, 552 #define INTF_OUTPUT_FEAT_DONE INTF_OUTPUT_N_FEAT 556 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
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
PCAP utility definitions.
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
PCAP main state data structure.
vlib_combined_counter_main_t * combined_sw_if_counters
clib_error_t *( vnet_interface_function_t)(struct vnet_main_t *vnm, u32 if_index, u32 flags)
A collection of simple counters.
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
static clib_error_t * link_up_down_function(vnet_main_t *vm, u32 hw_if_index, u32 flags)
vlib_simple_counter_main_t * sw_if_counters
vnet_device_class_t vnet_local_interface_device_class
uword * hw_interface_class_by_name
static clib_error_t * admin_up_down_function(vnet_main_t *vm, u32 hw_if_index, u32 flags)
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
A collection of combined counters.
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)