|
FD.io VPP
v21.10.1-2-g0a485f517
Vector Packet Processing
|
Go to the documentation of this file.
50 .class_name =
"interface",
54 #define log_debug(fmt,...) vlib_log_debug(if_default_log.class, fmt, __VA_ARGS__)
55 #define log_err(fmt,...) vlib_log_err(if_default_log.class, fmt, __VA_ARGS__)
98 for (
i = 0;
i < n;
i++)
101 sizeof (s[
i].sw_hw_if_index));
112 u32 n = va_arg (*va,
u32);
114 for (
i = 0;
i < n;
i++)
117 sizeof (s[
i].sw_hw_if_index));
158 st->flags = sif->
flags;
247 _vnet_interface_function_list_elt_t **
250 _vnet_interface_function_list_elt_t *
elt;
264 elt =
elt->next_interface_function;
281 if (hw_class->interface_add_del_function
283 hw_class->interface_add_del_function (vnm, hw_if_index, is_create)))
286 if (dev_class->interface_add_del_function
288 dev_class->interface_add_del_function (vnm, hw_if_index,
336 if (hw_class->link_up_down_function
337 && (
error = hw_class->link_up_down_function (vnm, hw_if_index,
386 sw_interface_admin_up_down_functions);
427 if (!dev_class->redistribute)
472 if (dev_class->admin_up_down_function
473 && (
error = dev_class->admin_up_down_function (vnm,
482 if (hw_class->admin_up_down_function
483 && (
error = hw_class->admin_up_down_function (vnm,
516 log_debug (
"hw_set_flags: hw_if_index %u flags 0x%x", hw_if_index,
flags);
518 (vnm, hw_if_index,
flags,
570 hi->if_out_arc_end_node_next_index;
627 if (template->sub.eth.flags.two_tags == 1
628 && template->sub.eth.flags.exact_match == 1
629 && (template->sub.eth.flags.inner_vlan_id_any == 1
630 || template->sub.eth.flags.outer_vlan_id_any == 1))
632 char *str =
"inner-dot1q any exact-match is unsupported";
634 log_err (
"create_sw_interface: %s", str);
642 dev_class->subif_add_del_function)
644 error = dev_class->subif_add_del_function (vnm,
hi->hw_if_index,
659 log_err (
"create_sw_interface: set flags failed\n %U",
669 log_debug (
"create_sw_interface: interface %U (sw_if_index %u) created",
683 log_debug (
"delete_sw_interface: sw_if_index %u, name '%U'",
713 log_debug (
"set_mtu: interface %U, new mtu %u",
725 bool changed =
false;
739 log_debug (
"set_protocol_mtu: interface %U l3 %u ip4 %u ip6 %u mpls %u",
779 if (
hi->max_packet_bytes != mtu)
781 hi->max_packet_bytes = mtu;
797 dev_class->tx_function_error_strings,
798 dev_class->tx_function_error_counters);
815 u32 hw_class_index,
u32 hw_instance)
827 char *tx_node_name = NULL, *output_node_name = NULL;
839 if (dev_class->format_device_name)
840 hw->
name =
format (0,
"%U", dev_class->format_device_name, dev_instance);
841 else if (hw_class->format_interface_name)
842 hw->
name =
format (0,
"%U", hw_class->format_interface_name,
845 hw->
name =
format (0,
"%s%x", hw_class->name, dev_instance);
849 sizeof (hw->
name[0]),
859 .hw_if_index = hw_index
873 if (dev_class->tx_function == 0 && dev_class->tx_fn_registrations == 0)
874 goto no_output_nodes;
876 tx_node_name = (
char *)
format (0,
"%v-tx", hw->
name);
877 output_node_name = (
char *)
format (0,
"%v-output", hw->
name);
928 if (dev_class->tx_fn_registrations)
930 node->node_fn_registrations = dev_class->tx_fn_registrations;
932 vm, dev_class->tx_fn_registrations);
935 node->function = dev_class->tx_function;
936 node->format_trace = dev_class->format_tx_trace;
960 r.runtime_data = &
rt;
961 r.runtime_data_bytes =
sizeof (
rt);
963 r.vector_size =
sizeof (
u32);
966 r.name = tx_node_name;
967 if (dev_class->tx_fn_registrations)
970 r.node_fn_registrations = dev_class->tx_fn_registrations;
973 r.function = dev_class->tx_function;
982 r.name = output_node_name;
995 "interface is deleted",
1076 vnet_sw_interface_t *si = vnet_get_sw_interface (vnm, sw_if_index);
1077 u64 sup_and_sub_key =
1078 ((u64) (si->sup_sw_if_index) << 32) | (u64) si->sub.id;
1079 hash_unset_mem_free (&im->sw_if_index_by_sup_and_sub, &sup_and_sub_key);
1080 vnet_delete_sw_interface (vnm, sw_if_index);
1089 if (dev_class->tx_function)
1105 "interface-%d-output-deleted", hw_if_index);
1136 hi->sub_interface_sw_if_index_by_id,
1138 if (WALK_STOP == fn (vnm, sw_if_index, ctx))
1182 u32 hw_class_index,
u32 hw_instance)
1188 hi->hw_class_index = hw_class_index;
1189 hi->hw_instance = hw_instance;
1195 u32 hw_class_index,
u32 redistribute)
1208 if (
hi->hw_class_index == hw_class_index)
1217 "%v must be admin down to change class from %s to %s",
1218 hi->name, old_class->name, new_class->name);
1221 if ((new_class->is_valid_class_for_interface
1222 && !new_class->is_valid_class_for_interface (vnm, hw_if_index,
1224 || (dev_class->is_valid_class_for_interface
1225 && !dev_class->is_valid_class_for_interface (vnm, hw_if_index,
1228 "%v class cannot be changed from %s to %s",
1229 hi->name, old_class->name, new_class->name);
1233 if (old_class->hw_class_change)
1234 old_class->hw_class_change (vnm, hw_if_index, old_class->index,
1240 if (new_class->hw_class_change)
1241 new_class->hw_class_change (vnm, hw_if_index, old_class->index,
1244 if (dev_class->hw_class_change)
1245 dev_class->hw_class_change (vnm, hw_if_index, new_class->index);
1266 (vnm,
hi->dev_class_index);
1268 if (dev_class->rx_redirect_to_node)
1270 dev_class->rx_redirect_to_node (vnm, hw_if_index,
node_index);
1274 return VNET_API_ERROR_UNIMPLEMENTED;
1343 "local0 interface doesn't support IP addressing");
1354 "sub-interface without exact-match doesn't support IP addressing");
1374 #define _(a) if (sizeof(o->a) > sizeof (o->unused)) \
1376 ("FATAL: size of opaque union subtype %s is %d (max %d)", \
1377 #a, sizeof(o->a), sizeof (o->unused));
1382 (0,
"FATAL: size of vlib buffer opaque %d, size of vnet opaque %d",
1391 im->sw_if_counters[VNET_INTERFACE_COUNTER_##E].name = #n; \
1392 im->sw_if_counters[VNET_INTERFACE_COUNTER_##E].stat_segment_name = "/" #p "/" #n;
1398 im->combined_sw_if_counters[VNET_INTERFACE_COUNTER_##E].name = #n; \
1399 im->combined_sw_if_counters[VNET_INTERFACE_COUNTER_##E].stat_segment_name = "/" #p "/" #n;
1418 ASSERT (
c->tx_fn_registrations == 0 ||
c->tx_function == 0);
1420 if (
c->tx_fn_registrations)
1422 vm,
c->tx_fn_registrations);
1425 c =
c->next_class_registration;
1448 if (NULL ==
c->build_rewrite)
1450 if (NULL ==
c->update_adjacency)
1454 c =
c->next_class_registration;
1482 (vnm,
hi->dev_class_index);
1484 if (dev_class->name_renumber == 0 || dev_class->format_device_name == 0)
1485 return VNET_API_ERROR_UNIMPLEMENTED;
1487 rv = dev_class->name_renumber (
hi, new_show_dev_instance);
1495 hi->name =
format (0,
"%U", dev_class->format_device_name,
1515 "unable to find hw interface for index %u",
1519 old_name = hw->
name;
1549 if (!
hi->hw_address)
1553 (0,
"Secondary MAC Addresses not supported for interface index %u",
1558 if (dev_class->mac_addr_add_del_function)
1567 if (NULL != hw_class->mac_addr_add_del_function)
1595 if (dev_class->mac_addr_change_function)
1598 dev_class->mac_addr_change_function (
hi, old_address,
1607 if (NULL != hw_class->mac_addr_change_function)
1608 hw_class->mac_addr_change_function (
hi, old_address,
mac_address);
1614 "MAC Address Change is not supported on this interface");
1622 "mac address change is not supported for interface index %u",
1642 return VNET_API_ERROR_UNEXPECTED_INTF_STATE;
1646 return VNET_API_ERROR_UNEXPECTED_INTF_STATE;
1650 return VNET_API_ERROR_UNEXPECTED_INTF_STATE;
1654 return VNET_API_ERROR_UNEXPECTED_INTF_STATE;
1662 u32 ip_sw_if_index,
u8 enable)
1682 [unnumbered_sw_if_index] =
1684 lookup_main.if_address_pool_index_by_sw_if_index[ip_sw_if_index];
1686 lookup_main.if_address_pool_index_by_sw_if_index
1687 [unnumbered_sw_if_index] =
1689 lookup_main.if_address_pool_index_by_sw_if_index[ip_sw_if_index];
1724 return (VNET_L3_PACKET_TYPE_IP4);
1726 return (VNET_L3_PACKET_TYPE_IP6);
1728 return (VNET_L3_PACKET_TYPE_MPLS);
1730 return (VNET_L3_PACKET_TYPE_ARP);
1822 if (dev_class->set_rss_queues_function)
1827 "must assign at least one valid rss queue");
1831 error = dev_class->set_rss_queues_function (vnm,
hi, bitmap);
1836 "setting rss queues is not supported on this interface");
1881 else if (
unformat (line_input,
"disable")
1899 .path =
"interface collect detailed-stats",
1900 .short_help =
"interface collect detailed-stats <enable|disable>",
@ VNET_SW_INTERFACE_FLAG_NONE
@ VNET_N_SIMPLE_INTERFACE_COUNTER
static void clib_spinlock_init(clib_spinlock_t *p)
@ VNET_INTERFACE_SET_FLAGS_HELPER_WANT_REDISTRIBUTE
vnet_interface_main_t * im
uword * sub_interface_sw_if_index_by_id
static vlib_cli_command_t collect_detailed_interface_stats_command
(constructor) VLIB_CLI_COMMAND (collect_detailed_interface_stats_command)
static u32 vlib_num_workers()
static void serialize_integer(serialize_main_t *m, u64 x, u32 n_bytes)
vlib_node_registration_t vnet_interface_output_arc_end_node
(constructor) VLIB_REGISTER_NODE (vnet_interface_output_arc_end_node)
clib_error_t * vnet_sw_interface_set_flags(vnet_main_t *vnm, u32 sw_if_index, vnet_sw_interface_flags_t flags)
void vlib_register_errors(vlib_main_t *vm, u32 node_index, u32 n_errors, char *error_strings[], vlib_error_desc_t counters[])
@ VNET_SW_INTERFACE_FLAG_ERROR
void vnet_hw_interface_init_for_class(vnet_main_t *vnm, u32 hw_if_index, u32 hw_class_index, u32 hw_instance)
vnet_config_main_t config_main
struct vnet_sub_interface_t::@374 eth
@ IP_LOOKUP_NEXT_ARP
This packet matches an "incomplete adjacency" and packets need to be passed to ARP to find rewrite st...
uword * hw_interface_class_by_name
@ VNET_SW_INTERFACE_TYPE_PIPE
enum vnet_interface_function_priority_t_ vnet_interface_function_priority_t
vnet_sw_interface_type_t type
walk_rc_t(* vnet_hw_interface_walk_t)(vnet_main_t *vnm, u32 hw_if_index, void *ctx)
Call back walk type for walking all HW indices.
u32 if_out_arc_end_node_next_index
void vnet_hw_interface_set_mtu(vnet_main_t *vnm, u32 hw_if_index, u32 mtu)
void vnet_sw_interface_set_mtu(vnet_main_t *vnm, u32 sw_if_index, u32 mtu)
void ip4_directed_broadcast(u32 sw_if_index, u8 enable)
static void * vlib_node_get_runtime_data(vlib_main_t *vm, u32 node_index)
Get node runtime private data by node index.
struct _vnet_device_class vnet_device_class_t
struct vnet_sub_interface_t::@374::@375::@377 flags
void vnet_hw_if_unregister_all_tx_queues(vnet_main_t *vnm, u32 hw_if_index)
ip_lookup_main_t lookup_main
clib_error_t * vnet_hw_interface_set_class(vnet_main_t *vnm, u32 hw_if_index, u32 hw_class_index)
static uword vlib_node_add_next(vlib_main_t *vm, uword node, uword next_node)
u8 * format_vnet_interface_output_trace(u8 *s, va_list *va)
enum vnet_interface_helper_flags_t_ vnet_interface_helper_flags_t
clib_error_t * vnet_hw_interface_set_rss_queues(vnet_main_t *vnm, vnet_hw_interface_t *hi, clib_bitmap_t *bitmap)
_vnet_interface_function_list_elt_t * sw_interface_admin_up_down_functions[VNET_ITF_FUNC_N_PRIO]
enum vnet_hw_interface_flags_t_ vnet_hw_interface_flags_t
int vnet_interface_name_renumber(u32 sw_if_index, u32 new_show_dev_instance)
ip4_main_t ip4_main
Global ip4 main structure.
void ip4_sw_interface_enable_disable(u32 sw_if_index, u32 is_enable)
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
format_function_t * format_trace
enum vnet_sw_interface_flags_t_ vnet_sw_interface_flags_t
static vnet_sw_interface_t * vnet_get_sw_interface_or_null(vnet_main_t *vnm, u32 sw_if_index)
static void serialize_vec_vnet_sw_hw_interface_state(serialize_main_t *m, va_list *va)
#define log_debug(fmt,...)
walk_rc_t(* vnet_sw_interface_walk_t)(vnet_main_t *vnm, vnet_sw_interface_t *si, void *ctx)
Call back walk type for walking SW indices on a HW interface.
static u32 vnet_create_sw_interface_no_callbacks(vnet_main_t *vnm, vnet_sw_interface_t *template)
@ VLIB_NODE_TYPE_INTERNAL
#define vec_end(v)
End (last data address) of vector.
vlib_main_t vlib_node_runtime_t * node
@ IP_LOOKUP_NEXT_GLEAN
This packet matches an "interface route" and packets need to be passed to ARP to find rewrite string ...
vnet_hw_interface_flags_t flags
@ VNET_SW_INTERFACE_TYPE_SUB
#define hash_create_string(elts, value_bytes)
#define clib_error_return(e, args...)
@ VNET_INTERFACE_OUTPUT_NEXT_TX
uword * device_class_by_name
vnet_device_class_t * device_class_registrations
#define hash_foreach(key_var, value_var, h, body)
@ VNET_FLOOD_CLASS_NORMAL
@ IP_LOOKUP_NEXT_LOCAL
This packet is for one of our own IP addresses.
@ VNET_ITF_FUNC_PRIORITY_HIGH
vlib_node_fn_registration_t * node_fn_registrations
#define hash_set_mem(h, key, value)
void unserialize_vnet_interface_state(serialize_main_t *m, va_list *va)
@ ADJ_NBR_REWRITE_FLAG_COMPLETE
An indication that the rewrite is complete, i.e.
_vnet_interface_function_list_elt_t * sw_interface_mtu_change_functions[VNET_ITF_FUNC_N_PRIO]
#define vlib_call_init_function(vm, x)
@ VNET_SW_INTERFACE_FLAG_ADMIN_UP
void vlib_validate_combined_counter(vlib_combined_counter_main_t *cm, u32 index)
validate a combined counter
#define pool_put(P, E)
Free an object E in pool P.
@ IP_LOOKUP_NEXT_MIDCHAIN
This packets follow a mid-chain adjacency.
@ VNET_HW_IF_RX_MODE_POLLING
void vnet_hw_if_unregister_all_rx_queues(vnet_main_t *vnm, u32 hw_if_index)
vlib_main_t * vm
X-connect all packets from the HOST to the PHY.
mac_address_t * ethernet_interface_add_del_address(ethernet_main_t *em, u32 hw_if_index, const u8 *address, u8 is_add)
static vnet_sw_interface_t * vnet_get_sw_interface(vnet_main_t *vnm, u32 sw_if_index)
@ VNET_HW_INTERFACE_FLAG_LINK_UP
#define VNET_HW_INTERFACE_FLAG_DUPLEX_MASK
static vnet_sw_interface_flags_t vnet_hw_interface_flags_to_sw(vnet_hw_interface_flags_t hwf)
vlib_simple_counter_main_t * sw_if_counters
#define vec_serialize(m, v, f)
static vnet_device_class_t * vnet_get_device_class(vnet_main_t *vnm, u32 dev_class_index)
vnet_hw_interface_t * hw_interfaces
@ VNET_SW_INTERFACE_FLAG_DIRECTED_BCAST
#define clib_error_report(e)
void adj_glean_update_rewrite(adj_index_t adj_index)
adj_glean_update_rewrite
VLIB_REGISTER_LOG_CLASS(if_default_log, static)
static void setup_output_node(vlib_main_t *vm, u32 node_index, vnet_hw_interface_class_t *hw_class)
vnet_hw_if_output_node_runtime_t * r
@ VLIB_NODE_RUNTIME_PERF_RESET
unformat_function_t * unformat_buffer
@ VNET_HW_INTERFACE_FLAG_NONE
f64 max_rate_bits_per_sec
static clib_error_t * vnet_interface_cli_init(vlib_main_t *vm)
#define vec_cmp(v1, v2)
Compare two vectors (only applicable to vectors of signed numbers).
void vnet_sw_interface_ip_directed_broadcast(vnet_main_t *vnm, u32 sw_if_index, u8 enable)
word vnet_sw_interface_compare(vnet_main_t *vnm, uword sw_if_index0, uword sw_if_index1)
static int vnet_sw_interface_check_table_same(u32 unnumbered_sw_if_index, u32 ip_sw_if_index)
static void setup_tx_node(vlib_main_t *vm, u32 node_index, vnet_device_class_t *dev_class)
vnet_interface_helper_flags_t_
clib_spinlock_t sw_if_counter_lock
__clib_export u8 * format_clib_error(u8 *s, va_list *va)
uword vlib_node_add_next_with_slot(vlib_main_t *vm, uword node_index, uword next_node_index, uword slot)
vnet_sw_interface_flags_t flags
void adj_mcast_update_rewrite(adj_index_t adj_index, u8 *rewrite, u8 offset)
adj_mcast_update_rewrite
static vnet_hw_interface_class_t * vnet_get_hw_interface_class(vnet_main_t *vnm, u32 hw_class_index)
void vnet_delete_sw_interface(vnet_main_t *vnm, u32 sw_if_index)
#define foreach_vlib_main()
u32 * fib_index_by_sw_if_index
Table index indexed by software interface.
@ IP_LOOKUP_NEXT_MCAST_MIDCHAIN
Multicast Midchain Adjacency.
u32 * if_address_pool_index_by_sw_if_index
Head of doubly linked list of interface addresses for each software interface.
#define pool_foreach(VAR, POOL)
Iterate through pool.
#define foreach_buffer_opaque_union_subtype
u8 * vnet_build_rewrite_for_sw_interface(vnet_main_t *vnm, u32 sw_if_index, vnet_link_t link_type, const void *dst_address)
format_function_t * format_buffer
#define hash_create_mem(elts, key_bytes, value_bytes)
#define clib_error_create(args...)
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
int collect_detailed_interface_stats_flag
void vnet_sw_interface_admin_up(vnet_main_t *vnm, u32 sw_if_index)
@ IP_LOOKUP_NEXT_DROP
Adjacency to drop this packet.
int vnet_sw_interface_is_p2p(vnet_main_t *vnm, u32 sw_if_index)
#define vec_add2(V, P, N)
Add N elements to end of vector V, return pointer to new elements in P.
#define vec_add1(V, E)
Add 1 element to end of vector (unspecified alignment).
void serialize_vnet_interface_state(serialize_main_t *m, va_list *va)
int vnet_sw_interface_update_unnumbered(u32 unnumbered_sw_if_index, u32 ip_sw_if_index, u8 enable)
void collect_detailed_interface_stats_flag_set(void)
ip_lookup_next_t lookup_next_index
Next hop after ip4-lookup.
clib_error_t * vnet_hw_interface_change_mac_address(vnet_main_t *vnm, u32 hw_if_index, const u8 *mac_address)
#define hash_unset_mem(h, key)
static vnet_sw_interface_flags_t vnet_sw_interface_get_flags(vnet_main_t *vnm, u32 sw_if_index)
#define vec_dup(V)
Return copy of vector (no header, no alignment)
static vnet_hw_interface_t * vnet_get_hw_interface(vnet_main_t *vnm, u32 hw_if_index)
vnet_main_t * vnet_get_main(void)
@ VNET_INTERFACE_TX_NEXT_DROP
static uword clib_bitmap_count_set_bits(uword *ai)
Return the number of set bits in a bitmap.
static void vnet_if_update_lookup_tables(vnet_main_t *vnm, u32 sw_if_index)
u32 * hw_if_index_by_sw_if_index
#define vec_validate_aligned(V, I, A)
Make sure vector is long enough for given index (no header, specified alignment)
static_always_inline void clib_spinlock_lock(clib_spinlock_t *p)
static clib_error_t * vnet_hw_interface_set_flags_helper(vnet_main_t *vnm, u32 hw_if_index, vnet_hw_interface_flags_t flags, vnet_interface_helper_flags_t helper_flags)
clib_error_t * vnet_create_sw_interface(vnet_main_t *vnm, vnet_sw_interface_t *template, u32 *sw_if_index)
static void unserialize_integer(serialize_main_t *m, void *x, u32 n_bytes)
#define clib_bitmap_free(v)
Free a bitmap.
static void vlib_zero_combined_counter(vlib_combined_counter_main_t *cm, u32 index)
Clear a combined counter Clears the set of per-thread counters.
static uword vnet_sw_interface_is_sub(vnet_main_t *vnm, u32 sw_if_index)
void vnet_delete_hw_interface(vnet_main_t *vnm, u32 hw_if_index)
@ IP_LOOKUP_NEXT_REWRITE
This packet is to be rewritten and forwarded to the next processing node.
vlib_node_function_t * function
Node function to call.
vnet_hw_if_rx_mode default_rx_mode
void vnet_hw_if_update_runtime_data(vnet_main_t *vnm, u32 hw_if_index)
static clib_error_t * call_sw_interface_add_del_callbacks(vnet_main_t *vnm, u32 sw_if_index, u32 is_create)
clib_error_t * vnet_interface_init(vlib_main_t *vm)
vnet_hw_interface_class_t * hw_interface_classes
static vlib_node_t * vlib_get_node(vlib_main_t *vm, u32 i)
Get vlib node by index.
vlib_node_registration_t vnet_interface_output_node
(constructor) VLIB_REGISTER_NODE (vnet_interface_output_node)
format_function_t format_vnet_sw_interface_flags
@ VNET_ITF_FUNC_PRIORITY_LOW
@ IP_LOOKUP_NEXT_PUNT
Adjacency to punt this packet.
#define ETHERNET_INTERFACE_FLAG_MTU
vnet_feature_config_main_t * cm
#define pool_get(P, E)
Allocate an object E from a pool P (unspecified alignment).
static clib_error_t * vnet_hw_interface_change_mac_address_helper(vnet_main_t *vnm, u32 hw_if_index, const u8 *mac_address)
#define vec_validate(V, I)
Make sure vector is long enough for given index (no header, unspecified alignment)
u32 * fib_index_by_sw_if_index
@ VNET_SW_INTERFACE_FLAG_UNNUMBERED
_vnet_interface_function_list_elt_t * hw_interface_link_up_down_functions[VNET_ITF_FUNC_N_PRIO]
#define VLIB_CLI_COMMAND(x,...)
static clib_error_t * collect_detailed_interface_stats_cli(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
vnet_device_class_t * device_classes
void vlib_node_rename(vlib_main_t *vm, u32 node_index, char *fmt,...)
clib_error_t * vnet_rename_interface(vnet_main_t *vnm, u32 hw_if_index, char *new_name)
static walk_rc_t sw_interface_walk_callback(vnet_main_t *vnm, u32 sw_if_index, void *ctx)
@ IP_LOOKUP_NEXT_BCAST
Broadcast Adjacency.
#define vec_unserialize(m, v, f)
#define CLIB_CACHE_LINE_BYTES
__clib_export void serialize_cstring(serialize_main_t *m, char *s)
struct _vlib_node_registration vlib_node_registration_t
vlib_combined_counter_main_t * combined_sw_if_counters
vnet_sw_interface_t * sw_interfaces
uword vlib_node_add_named_next_with_slot(vlib_main_t *vm, uword node, char *name, uword slot)
u32 ethernet_set_flags(vnet_main_t *vnm, u32 hw_if_index, u32 flags)
uword * txq_index_by_hw_if_index_and_queue_id
u32 unnumbered_sw_if_index
u16 * if_out_arc_end_next_index_by_sw_if_index
@ IP_LOOKUP_NEXT_ICMP_ERROR
This packets needs to go to ICMP error.
vnet_hw_interface_class_t * hw_interface_class_registrations
#define hash_create_vec(elts, key_bytes, value_bytes)
#define hash_get_mem(h, key)
__clib_export void unserialize_cstring(serialize_main_t *m, char **s)
_vnet_interface_function_list_elt_t * hw_interface_add_del_functions[VNET_ITF_FUNC_N_PRIO]
#define vec_free(V)
Free vector's memory (no header).
clib_error_t * vnet_sw_interface_supports_addressing(vnet_main_t *vnm, u32 sw_if_index)
static void vnet_interface_counter_unlock(vnet_interface_main_t *im)
u32 * mfib_index_by_sw_if_index
Table index indexed by software interface.
ethernet_main_t ethernet_main
void default_update_adjacency(vnet_main_t *vnm, u32 sw_if_index, u32 ai)
Default adjacency update function.
int vnet_sw_interface_is_nbma(vnet_main_t *vnm, u32 sw_if_index)
format_function_t format_vnet_sw_if_index_name
description fragment has unexpected format
static void vlib_zero_simple_counter(vlib_simple_counter_main_t *cm, u32 index)
Clear a simple counter Clears the set of per-thread u16 counters, and the u64 counter.
static clib_error_t * vnet_hw_interface_set_class_helper(vnet_main_t *vnm, u32 hw_if_index, u32 hw_class_index, u32 redistribute)
walk_rc_t(* vnet_hw_sw_interface_walk_t)(vnet_main_t *vnm, u32 sw_if_index, void *ctx)
Call back walk type for walking SW indices on a HW interface.
#define vec_validate_init_empty(V, I, INIT)
Make sure vector is long enough for given index and initialize empty space (no header,...
vnet_link_t adj_get_link_type(adj_index_t ai)
Return the link type of the adjacency.
u32 * mfib_index_by_sw_if_index
Table index indexed by software interface.
vlib_node_function_t * function
#define VLIB_INIT_FUNCTION(x)
static vnet_hw_interface_t * vnet_get_sup_hw_interface(vnet_main_t *vnm, u32 sw_if_index)
vnet_interface_per_thread_data_t * per_thread_data
u32 trace_classify_table_index
void vlib_validate_simple_counter(vlib_simple_counter_main_t *cm, u32 index)
validate a simple counter
void collect_detailed_interface_stats_flag_clear(void)
static void vnet_clear_sw_interface_tag(vnet_main_t *vnm, u32 sw_if_index)
vnet_hw_interface_nodes_t * deleted_hw_interface_nodes
@ VNET_INTERFACE_SET_FLAGS_HELPER_IS_CREATE
#define foreach_simple_interface_counter_name
#define vec_foreach(var, vec)
Vector iterator.
void ip6_sw_interface_enable_disable(u32 sw_if_index, u32 is_enable)
static clib_error_t * call_hw_interface_add_del_callbacks(vnet_main_t *vnm, u32 hw_if_index, u32 is_create)
static clib_error_t * call_elf_section_interface_callbacks(vnet_main_t *vnm, u32 if_index, u32 flags, _vnet_interface_function_list_elt_t **elts)
static vnet_hw_interface_flags_t vnet_sw_interface_flags_to_hw(vnet_sw_interface_flags_t swf)
ip_lookup_main_t lookup_main
@ VNET_SW_INTERFACE_FLAG_PUNT
static_always_inline void clib_spinlock_unlock(clib_spinlock_t *p)
static vlib_node_runtime_t * vlib_node_get_runtime(vlib_main_t *vm, u32 node_index)
Get node runtime by node index.
int vnet_hw_interface_rx_redirect_to_node(vnet_main_t *vnm, u32 hw_if_index, u32 node_index)
uword * hw_interface_by_name
word vnet_hw_interface_compare(vnet_main_t *vnm, uword hw_if_index0, uword hw_if_index1)
clib_memset(h->entries, 0, sizeof(h->entries[0]) *entries)
clib_error_t * vnet_hw_interface_add_del_mac_address(vnet_main_t *vnm, u32 hw_if_index, const u8 *mac_address, u8 is_add)
static_always_inline vnet_feature_config_main_t * vnet_feature_get_config_main(u16 arc)
void adj_nbr_update_rewrite(adj_index_t adj_index, adj_nbr_rewrite_flag_t flags, u8 *rewrite)
adj_nbr_update_rewrite
enum vnet_link_t_ vnet_link_t
Link Type: A description of the protocol of packets on the link.
vnet_l3_packet_type_t vnet_link_to_l3_proto(vnet_link_t link)
Convert a link to to an Ethertype.
void vnet_hw_interface_walk(vnet_main_t *vnm, vnet_hw_interface_walk_t fn, void *ctx)
Walk all the HW interface.
clib_error_t * vnet_hw_interface_set_flags(vnet_main_t *vnm, u32 hw_if_index, vnet_hw_interface_flags_t flags)
uword * interface_tag_by_sw_if_index
vnet_interface_output_runtime_t * rt
clib_error_t *() vlib_init_function_t(struct vlib_main_t *vm)
uword * sw_if_index_by_sup_and_sub
void vnet_sw_interface_walk(vnet_main_t *vnm, vnet_sw_interface_walk_t fn, void *ctx)
Walk all the SW interfaces in the system.
@ IP_LOOKUP_NEXT_MCAST
Multicast Adjacency.
u8 * default_build_rewrite(vnet_main_t *vnm, u32 sw_if_index, vnet_link_t link_type, const void *dst_address)
Return a complete, zero-length (aka placeholder) rewrite.
@ VNET_SW_INTERFACE_TYPE_P2P
#define foreach_combined_interface_counter_name
@ VNET_HW_INTERFACE_CLASS_FLAG_P2P
a point 2 point interface
static int vnet_hw_interface_rx_redirect_to_node_helper(vnet_main_t *vnm, u32 hw_if_index, u32 node_index, u32 redistribute)
vnet_mtu_t vnet_link_to_mtu(vnet_link_t link)
u32 vlib_register_node(vlib_main_t *vm, vlib_node_registration_t *r)
@ VNET_N_COMBINED_INTERFACE_COUNTER
_vnet_interface_function_list_elt_t * sw_interface_add_del_functions[VNET_ITF_FUNC_N_PRIO]
void vnet_hw_interface_walk_sw(vnet_main_t *vnm, u32 hw_if_index, vnet_hw_sw_interface_walk_t fn, void *ctx)
Walk the SW interfaces on a HW interface - this is the super interface and any sub-interfaces.
uword * rxq_index_by_hw_if_index_and_queue_id
@ VNET_HW_INTERFACE_CLASS_FLAG_NBMA
a non-broadcast multiple access interface
@ VNET_SW_INTERFACE_TYPE_HARDWARE
static clib_error_t * call_sw_interface_mtu_change_callbacks(vnet_main_t *vnm, u32 sw_if_index)
static vnet_sw_interface_t * vnet_get_sup_sw_interface(vnet_main_t *vnm, u32 sw_if_index)
#define VLIB_NODE_FLAG_IS_OUTPUT
static clib_error_t * vnet_sw_interface_set_flags_helper(vnet_main_t *vnm, u32 sw_if_index, vnet_sw_interface_flags_t flags, vnet_interface_helper_flags_t helper_flags)
vl_api_interface_index_t sw_if_index
static void unserialize_vec_vnet_sw_hw_interface_state(serialize_main_t *m, va_list *va)
#define hash_create(elts, value_bytes)
u8 output_feature_arc_index
enum walk_rc_t_ walk_rc_t
Walk return code.
static void vnet_interface_counter_lock(vnet_interface_main_t *im)
static ip_adjacency_t * adj_get(adj_index_t adj_index)
Get a pointer to an adjacency object from its index.
struct _vnet_hw_interface_class vnet_hw_interface_class_t
void vnet_sw_interface_admin_down(vnet_main_t *vnm, u32 sw_if_index)
u32 opaque[10]
Opaque data used by sub-graphs for their own purposes.
vlib_node_function_t * vlib_node_get_preferred_node_fn_variant(vlib_main_t *vm, vlib_node_fn_registration_t *regs)
u32 vnet_register_interface(vnet_main_t *vnm, u32 dev_class_index, u32 dev_instance, u32 hw_class_index, u32 hw_instance)
static void vlib_node_runtime_perf_counter(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame, uword n, u64 t, vlib_node_runtime_perf_call_type_t call_type)
vnet_interface_main_t interface_main
@ VNET_INTERFACE_OUTPUT_NEXT_DROP
void vnet_sw_interface_set_protocol_mtu(vnet_main_t *vnm, u32 sw_if_index, u32 mtu[])
format_function_t format_vnet_sw_interface_name
#define clib_bitmap_dup(v)
Duplicate a bitmap.
VLIB buffer representation.
manual_print typedef u8 mac_address[6]
u32 * input_node_thread_index_by_queue
vl_api_wireguard_peer_flags_t flags