|
FD.io VPP
v21.06-3-gbb25fbf28
Vector Packet Processing
|
Go to the documentation of this file.
73 u32 hw_if_index, *hw_if_indices = 0;
81 vec_add1 (hw_if_indices, hw_if_index);
84 else if (
unformat (input,
"%u", &hw_if_index))
85 vec_add1 (hw_if_indices, hw_if_index);
87 else if (
unformat (input,
"verbose"))
112 if (
vec_len (hw_if_indices) == 0)
131 else if ((
hi->bond_info) &&
159 if (dc->clear_counters)
160 dc->clear_counters (
hi->dev_instance);
242 .path =
"show hardware-interfaces",
243 .short_help =
"show hardware-interfaces [brief|verbose|detail] [bond] "
244 "[<interface> [<interface> [..]]] [<sw_idx> [<sw_idx> [..]]]",
263 .path =
"clear hardware-interfaces",
264 .short_help =
"clear hardware-interfaces "
265 "[<interface> [<interface> [..]]] [<sw_idx> [<sw_idx> [..]]]",
290 u8 show_addresses = 0;
291 u8 show_features = 0;
319 else if (
unformat (linput,
"verbose"))
331 if (show_features || show_tag || show_vtr)
360 tag ? (
char *) tag :
"(none)");
371 u32 push_dot1q = 0, tag1 = 0, tag2 = 0;
374 &vtr_op, &push_dot1q, &tag1, &tag2) != 0)
394 _vec_len (sorted_sis) = 0;
416 u32 fib_index4 = 0, fib_index6 = 0;
431 (
vm,
"%U (%s): \n unnumbered, use %U",
449 ip4_address_t *r4 = ip_interface_address_get_address (lm4, ia);
451 vlib_cli_output (vm,
" L3 %U/%d ip4 table-id %d fib-idx %d",
452 format_ip4_address, r4, ia->address_length,
454 ip4_fib_index_from_table_id (fib4->table_id));
456 vlib_cli_output (vm,
" L3 %U/%d",
457 format_ip4_address, r4, ia->address_length);
466 ip6_address_t *r6 = ip_interface_address_get_address (lm6, ia);
468 vlib_cli_output (vm,
" L3 %U/%d ip6 table-id %d fib-idx %d",
469 format_ip6_address, r6, ia->address_length,
471 ip6_fib_index_from_table_id (fib6->table_id));
473 vlib_cli_output (vm,
" L3 %U/%d",
474 format_ip6_address, r6, ia->address_length);
494 .path =
"show interface",
495 .short_help =
"show interface [address|addr|features|feat|vtr] [<interface> [<interface> [..]]] [verbose]",
505 .short_help =
"Interface commands",
511 .path =
"set interface",
512 .short_help =
"Interface commands",
528 for (j = 0; j < n_counters; j++)
537 for (j = 0; j < n_counters; j++)
557 .path =
"clear interfaces",
558 .short_help =
"clear interfaces",
630 u32 inner_vlan, outer_vlan;
632 if (
unformat (input,
"any inner-dot1q any"))
634 template->sub.eth.flags.two_tags = 1;
635 template->sub.eth.flags.outer_vlan_id_any = 1;
636 template->sub.eth.flags.inner_vlan_id_any = 1;
640 template->sub.eth.flags.one_tag = 1;
641 template->sub.eth.flags.outer_vlan_id_any = 1;
643 else if (
unformat (input,
"%d inner-dot1q any", &outer_vlan))
645 template->sub.eth.flags.two_tags = 1;
646 template->sub.eth.flags.inner_vlan_id_any = 1;
647 template->sub.eth.outer_vlan_id = outer_vlan;
649 else if (
unformat (input,
"%d inner-dot1q %d", &outer_vlan, &inner_vlan))
651 template->sub.eth.flags.two_tags = 1;
652 template->sub.eth.outer_vlan_id = outer_vlan;
653 template->sub.eth.inner_vlan_id = inner_vlan;
655 else if (
unformat (input,
"%d", &outer_vlan))
657 template->sub.eth.flags.one_tag = 1;
658 template->sub.eth.outer_vlan_id = outer_vlan;
669 if (
unformat (input,
"exact-match"))
671 template->sub.eth.flags.exact_match = 1;
687 u32 id, id_min, id_max;
699 template.sub.eth.raw_flags = 0;
701 if (
unformat (input,
"%d default", &id_min))
704 template.sub.eth.flags.default_sub = 1;
706 else if (
unformat (input,
"%d untagged", &id_min))
709 template.sub.eth.flags.no_tags = 1;
710 template.sub.eth.flags.exact_match = 1;
712 else if (
unformat (input,
"%d dot1q", &id_min))
720 else if (
unformat (input,
"%d dot1ad", &id_min))
724 template.sub.eth.flags.dot1ad = 1;
729 else if (
unformat (input,
"%d-%d", &id_min, &id_max))
731 template.sub.eth.flags.one_tag = 1;
732 template.sub.eth.flags.exact_match = 1;
736 else if (
unformat (input,
"%d", &id_min))
739 template.sub.eth.flags.one_tag = 1;
740 template.sub.eth.outer_vlan_id = id_min;
741 template.sub.eth.flags.exact_match = 1;
757 "not allowed as %v belong to a BondEthernet interface",
762 for (
id = id_min;
id <= id_max;
id++)
766 u64 sup_and_sub_key = ((
u64) (
hi->sw_if_index) << 32) | (
u64)
id;
773 clib_warning (
"sup sw_if_index %d, sub id %d already exists\n",
774 hi->sw_if_index,
id);
780 template.sup_sw_if_index =
hi->sw_if_index;
781 template.sub.id =
id;
783 template.sub.eth.outer_vlan_id =
id;
790 *kp = sup_and_sub_key;
888 .path =
"create sub-interfaces",
889 .short_help =
"create sub-interfaces <interface> "
890 "{<subId> [default|untagged]} | "
891 "{<subId>-<subId>} | "
892 "{<subId> dot1q|dot1ad <vlanId>|any [inner-dot1q <vlanId>|any] [exact-match]}",
945 .path =
"set interface state",
946 .short_help =
"set interface state <interface> [up|down|punt|enable]",
956 u32 unnumbered_sw_if_index = ~0;
957 u32 inherit_from_sw_if_index = ~0;
966 &unnumbered_sw_if_index))
972 if (~0 == unnumbered_sw_if_index)
974 if (enable && ~0 == inherit_from_sw_if_index)
976 " IP enabled interface that it uses");
979 inherit_from_sw_if_index, enable);
986 .path =
"set interface unnumbered",
987 .short_help =
"set interface unnumbered [<interface> use <interface> | del <interface>]",
1001 u32 hw_if_index, hw_class_index;
1029 .path =
"set interface hw-class",
1030 .short_help =
"Set interface hardware class",
1049 u32 new_dev_instance;
1057 if (!
unformat (input,
"%d", &new_dev_instance))
1079 .path =
"renumber interface",
1080 .short_help =
"renumber interface <interface> <new-dev-instance>",
1098 else if (
unformat (input,
"off %U",
1115 .path =
"set interface promiscuous",
1116 .short_help =
"set interface promiscuous [on|off] <interface>",
1129 if (
unformat (input,
"%d %U", &mtu,
1142 if (mtu < hi->min_supported_packet_bytes)
1144 "must be >= min pkt bytes (%d)", mtu,
1145 hi->min_supported_packet_bytes);
1147 if (mtu >
hi->max_supported_packet_bytes)
1149 hi->max_supported_packet_bytes);
1154 else if (
unformat (input,
"packet %d %U", &mtu,
1158 else if (
unformat (input,
"ip4 %d %U", &mtu,
1161 else if (
unformat (input,
"ip6 %d %U", &mtu,
1164 else if (
unformat (input,
"mpls %d %U", &mtu,
1179 .path =
"set interface mtu",
1180 .short_help =
"set interface mtu [packet|ip4|ip6|mpls] <value> <interface>",
1202 if (
vec_len (sorted_sis) == 0)
1206 _vec_len (sorted_sis) = 0;
1257 .path =
"show interface secondary-mac-address",
1258 .short_help =
"show interface secondary-mac-address [<interface>]",
1274 is_add = is_del = 0;
1299 if (is_add == is_del)
1331 .path =
"set interface secondary-mac-address",
1332 .short_help =
"set interface secondary-mac-address <interface> <mac-address> [(add|del)]",
1381 .path =
"set interface mac address",
1382 .short_help =
"set interface mac address <interface> <mac-address>",
1406 .path =
"set interface tag",
1407 .short_help =
"set interface tag <interface> <tag>",
1430 .path =
"clear interface tag",
1431 .short_help =
"clear interface tag <interface>",
1445 else if (
unformat (input,
"enable"))
1447 else if (
unformat (input,
"disable"))
1470 .path =
"set interface ip directed-broadcast",
1471 .short_help =
"set interface enable <interface> <enable|disable>",
1478 u8 queue_id_valid,
u32 queue_id,
1483 u32 *queue_indices = 0;
1492 if (queue_index == ~0)
1494 queue_id, hw->
name);
1495 vec_add1 (queue_indices, queue_index);
1500 for (
int i = 0;
i <
vec_len (queue_indices);
i++)
1521 u32 hw_if_index = (
u32) ~ 0;
1522 u32 queue_id = (
u32) ~ 0;
1524 u8 queue_id_valid = 0;
1534 else if (
unformat (line_input,
"queue %d", &queue_id))
1536 else if (
unformat (line_input,
"polling"))
1538 else if (
unformat (line_input,
"interrupt"))
1540 else if (
unformat (line_input,
"adaptive"))
1553 if (hw_if_index == (
u32) ~ 0)
1600 .path =
"set interface rx-mode",
1601 .short_help =
"set interface rx-mode <interface> [queue <n>] [polling | interrupt | adaptive]",
1626 if (current_node != prev_node)
1631 if (qptr == all_queues +
vec_len (all_queues) - 1 ||
1638 prev_node = current_node;
1672 .path =
"show interface rx-placement",
1673 .short_help =
"show interface rx-placement",
1693 "please specify valid worker thread or main");
1699 if (queue_index == ~0)
1714 u32 hw_if_index = (
u32) ~ 0;
1727 else if (
unformat (line_input,
"queue %d", &queue_id))
1744 if (hw_if_index == (
u32) ~ 0)
1803 .path =
"set interface rx-placement",
1804 .short_help =
"set interface rx-placement <interface> [queue <n>] "
1805 "[worker <n> | main]",
1829 u32 hw_if_index = (
u32) ~ 0;
1854 if (hw_if_index == (
u32) ~ 0)
1888 .path =
"set interface rss queues",
1889 .short_help =
"set interface rss queues <interface> <list <queue-list>>",
1898 int type = va_arg (*args,
int);
1943 (
vm,
"pcap %U dispatch capture enabled: %d of %d pkts...",
1958 && (
a->rx_enable +
a->tx_enable +
a->drop_enable))
1959 return VNET_API_ERROR_INVALID_VALUE;
1964 ((
a->rx_enable +
a->tx_enable +
a->drop_enable == 0)))
1965 return VNET_API_ERROR_VALUE_EXIST;
1969 && (
a->rx_enable +
a->tx_enable +
a->drop_enable)
1971 return VNET_API_ERROR_INVALID_VALUE_2;
1974 if ((
a->rx_enable +
a->tx_enable +
a->drop_enable) &&
a->filter &&
1975 (!
cm->classify_table_index_by_sw_if_index ||
1976 cm->classify_table_index_by_sw_if_index[0] == ~0))
1977 return VNET_API_ERROR_NO_SUCH_LABEL;
1979 if (
a->rx_enable +
a->tx_enable +
a->drop_enable)
1981 void *save_pcap_data;
1984 if (
a->max_bytes_per_pkt < 32 ||
a->max_bytes_per_pkt > 9000)
1985 return VNET_API_ERROR_INVALID_MEMORY_SIZE;
1996 memset (pm, 0,
sizeof (*pm));
2005 if (
a->filename == 0)
2010 stem =
format (stem,
"rx");
2012 stem =
format (stem,
"tx");
2014 stem =
format (stem,
"drop");
2015 a->filename =
format (0,
"/tmp/%v.pcap%c", stem, 0);
2023 if (
a->preallocate_data)
2034 cm->classify_table_index_by_sw_if_index[0];
2063 return VNET_API_ERROR_SYSCALL_ERROR_1;
2071 return VNET_API_ERROR_NO_SUCH_ENTRY;
2086 u32 max_bytes_per_pkt = 512;
2090 int preallocate_data = 0;
2091 int drop_enable = 0;
2106 else if (
unformat (line_input,
"tx"))
2108 else if (
unformat (line_input,
"drop"))
2110 else if (
unformat (line_input,
"off"))
2111 rx_enable = tx_enable = drop_enable = 0;
2112 else if (
unformat (line_input,
"max-bytes-per-pkt %u",
2113 &max_bytes_per_pkt))
2115 else if (
unformat (line_input,
"max %d", &max))
2117 else if (
unformat (line_input,
"packets-to-capture %d", &max))
2122 else if (
unformat (line_input,
"status %=", &status, 1))
2124 else if (
unformat (line_input,
"intfc %U",
2127 else if (
unformat (line_input,
"interface %U",
2133 else if (
unformat (line_input,
"preallocate-data %=",
2134 &preallocate_data, 1))
2136 else if (
unformat (line_input,
"free-data %=", &free_data, 1))
2138 else if (
unformat (line_input,
"intfc any")
2139 ||
unformat (line_input,
"interface any"))
2141 else if (
unformat (line_input,
"filter"))
2153 a->filename = filename;
2154 a->rx_enable = rx_enable;
2155 a->tx_enable = tx_enable;
2156 a->preallocate_data = preallocate_data;
2157 a->free_data = free_data;
2158 a->drop_enable = drop_enable;
2160 a->packets_to_capture = max;
2163 a->max_bytes_per_pkt = max_bytes_per_pkt;
2164 a->drop_err = drop_err;
2173 case VNET_API_ERROR_INVALID_VALUE:
2176 case VNET_API_ERROR_VALUE_EXIST:
2179 case VNET_API_ERROR_INVALID_VALUE_2:
2181 (0,
"can't change number of records to capture while tracing...");
2183 case VNET_API_ERROR_SYSCALL_ERROR_1:
2186 case VNET_API_ERROR_NO_SUCH_ENTRY:
2189 case VNET_API_ERROR_INVALID_MEMORY_SIZE:
2191 "Max bytes per pkt must be > 32, < 9000...");
2193 case VNET_API_ERROR_NO_SUCH_LABEL:
2195 (0,
"No classify filter configured, see 'classify filter...'");
2285 .path =
"pcap trace",
2287 "pcap trace [rx] [tx] [drop] [off] [max <nn>] [intfc <interface>|any]\n"
2288 " [file <name>] [status] [max-bytes-per-pkt <nnnn>][filter]\n"
2289 " [preallocate-data][free-data]",
#define vec_reset_length(v)
Reset vector length to zero NULL-pointer tolerant.
static void clib_spinlock_init(clib_spinlock_t *p)
static vlib_cli_command_t clear_interface_counters_command
(constructor) VLIB_CLI_COMMAND (clear_interface_counters_command)
uword last_worker_thread_index
vnet_device_main_t vnet_device_main
vnet_interface_main_t * im
static clib_error_t * show_interface_sec_mac_addr_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
uword unformat_ethernet_address(unformat_input_t *input, va_list *args)
clib_error_t * vnet_sw_interface_set_flags(vnet_main_t *vnm, u32 sw_if_index, vnet_sw_interface_flags_t flags)
uword * hw_interface_class_by_name
static vlib_cli_command_t set_hw_class_command
(constructor) VLIB_CLI_COMMAND (set_hw_class_command)
#define foreach_ip_interface_address(lm, a, sw_if_index, loop, body)
void vnet_hw_interface_set_mtu(vnet_main_t *vnm, u32 hw_if_index, u32 mtu)
@ VNET_HW_IF_RX_MODE_ADAPTIVE
static clib_error_t * show_interface_rx_placement_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
struct _vnet_device_class vnet_device_class_t
static void show_bond(vlib_main_t *vm)
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 vlib_cli_command_t clear_tag_command
(constructor) VLIB_CLI_COMMAND (clear_tag_command)
static clib_error_t * renumber_interface_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
static_always_inline int vnet_hw_if_rxq_cmp_cli_api(vnet_hw_if_rx_queue_t **a, vnet_hw_if_rx_queue_t **b)
#define vec_new(T, N)
Create new vector of given type and length (unspecified alignment, no header).
clib_error_t * vnet_hw_interface_set_rss_queues(vnet_main_t *vnm, vnet_hw_interface_t *hi, clib_bitmap_t *bitmap)
static clib_error_t * clear_tag(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
int vnet_interface_name_renumber(u32 sw_if_index, u32 new_show_dev_instance)
ip4_main_t ip4_main
Global ip4 main structure.
static clib_error_t * clear_interface_counters(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
u32 ethernet_set_flags(vnet_main_t *vnm, u32 hw_if_index, u32 flags)
int vnet_hw_if_set_rx_queue_mode(vnet_main_t *vnm, u32 queue_index, vnet_hw_if_rx_mode mode)
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
void vlib_clear_combined_counters(vlib_combined_counter_main_t *cm)
Clear a collection of combined counters.
u8 * format_l2_output_features(u8 *s, va_list *args)
__clib_export clib_error_t * pcap_close(pcap_main_t *pm)
Close PCAP file.
clib_error_t * set_hw_interface_rx_placement(u32 hw_if_index, u32 queue_id, u32 thread_index, u8 is_main)
vnet_classify_main_t vnet_classify_main
static clib_error_t * clear_hw_interfaces(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
static clib_error_t * set_interface_rx_mode(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
@ VNET_SW_INTERFACE_TYPE_SUB
static vlib_cli_command_t set_interface_promiscuous_cmd
(constructor) VLIB_CLI_COMMAND (set_interface_promiscuous_cmd)
#define clib_error_return(e, args...)
static uword vnet_swif_is_api_visible(vnet_sw_interface_t *si)
@ VNET_FLOOD_CLASS_NORMAL
static clib_error_t * promiscuous_cmd(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
static int compare_interface_names(void *a1, void *a2)
vl_api_tunnel_mode_t mode
static vlib_cli_command_t show_interface_rx_placement
(constructor) VLIB_CLI_COMMAND (show_interface_rx_placement)
@ VNET_SW_INTERFACE_FLAG_ADMIN_UP
@ VNET_HW_IF_RX_MODE_POLLING
vlib_main_t * vm
X-connect all packets from the HOST to the PHY.
static vlib_cli_command_t set_interface_mac_address_cmd
(constructor) VLIB_CLI_COMMAND (set_interface_mac_address_cmd)
static vnet_sw_interface_t * vnet_get_sw_interface(vnet_main_t *vnm, u32 sw_if_index)
vlib_simple_counter_main_t * sw_if_counters
pcap_packet_type_t packet_type
Packet type.
vnet_hw_interface_t * hw_interfaces
static vlib_cli_command_t show_hw_interfaces_command
(constructor) VLIB_CLI_COMMAND (show_hw_interfaces_command)
#define clib_error_report(e)
PCAP main state data structure.
vnet_hw_if_rx_queue_t * hw_if_rx_queues
vlib_worker_thread_t * vlib_worker_threads
static vlib_cli_command_t pcap_tx_trace_command
(constructor) VLIB_CLI_COMMAND (pcap_tx_trace_command)
static clib_error_t * vnet_interface_cli_init(vlib_main_t *vm)
static clib_error_t * set_tag(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
static ip6_fib_t * ip6_fib_get(fib_node_index_t index)
static u8 * format_vnet_pcap(u8 *s, va_list *args)
uword unformat_ethernet_interface(unformat_input_t *input, va_list *args)
void vnet_sw_interface_ip_directed_broadcast(vnet_main_t *vnm, u32 sw_if_index, u8 enable)
clib_error_t * set_hw_interface_change_rx_mode(vnet_main_t *vnm, u32 hw_if_index, u8 queue_id_valid, u32 queue_id, vnet_hw_if_rx_mode mode)
word vnet_sw_interface_compare(vnet_main_t *vnm, uword sw_if_index0, uword sw_if_index1)
static vlib_cli_command_t set_ip_directed_broadcast_command
(constructor) VLIB_CLI_COMMAND (set_ip_directed_broadcast_command)
vnet_sw_interface_flags_t flags
clib_spinlock_t lock
spinlock to protect e.g.
#define vec_elt(v, i)
Get vector value at index i.
#define hash_set(h, key, value)
static u8 * vnet_get_sw_interface_tag(vnet_main_t *vnm, u32 sw_if_index)
static clib_error_t * set_ip_directed_broadcast(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
u32 * fib_index_by_sw_if_index
Table index indexed by software interface.
#define pool_foreach(VAR, POOL)
Iterate through pool.
static clib_error_t * set_hw_class(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
unformat_function_t unformat_vlib_error
format_function_t format_vnet_hw_if_rx_mode
static vlib_cli_command_t vnet_cli_set_interface_command
(constructor) VLIB_CLI_COMMAND (vnet_cli_set_interface_command)
#define vec_add1(V, E)
Add 1 element to end of vector (unspecified alignment).
u32 vnet_hw_if_get_rx_queue_index_by_id(vnet_main_t *vnm, u32 hw_if_index, u32 queue_id)
clib_error_t * vnet_hw_interface_change_mac_address(vnet_main_t *vnm, u32 hw_if_index, const u8 *mac_address)
static clib_error_t * interface_add_del_mac_address(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
#define vec_elt_at_index(v, i)
Get vector value at index i checking that i is in bounds.
static vnet_hw_interface_t * vnet_get_hw_interface(vnet_main_t *vnm, u32 hw_if_index)
vnet_main_t * vnet_get_main(void)
static clib_error_t * set_unnumbered(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
u8 * format_mac_address_t(u8 *s, va_list *args)
#define vec_validate_aligned(V, I, A)
Make sure vector is long enough for given index (no header, specified alignment)
static vlib_cli_command_t cmd_set_if_rx_mode
(constructor) VLIB_CLI_COMMAND (cmd_set_if_rx_mode)
static clib_error_t * mtu_cmd(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
static vlib_cli_command_t cmd_set_if_rx_placement
(constructor) VLIB_CLI_COMMAND (cmd_set_if_rx_placement)
static clib_error_t * set_interface_rss_queues_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
clib_error_t * vnet_create_sw_interface(vnet_main_t *vnm, vnet_sw_interface_t *template, u32 *sw_if_index)
static vlib_cli_command_t interface_add_del_mac_address_cmd
(constructor) VLIB_CLI_COMMAND (interface_add_del_mac_address_cmd)
#define clib_bitmap_free(v)
Free a bitmap.
if(node->flags &VLIB_NODE_FLAG_TRACE) vnet_interface_output_trace(vm
void vnet_hw_if_update_runtime_data(vnet_main_t *vnm, u32 hw_if_index)
#define hash_set_mem(h, key, value)
static vlib_cli_command_t show_sw_interfaces_command
(constructor) VLIB_CLI_COMMAND (show_sw_interfaces_command)
@ VNET_HW_IF_RX_MODE_INTERRUPT
static void vnet_set_sw_interface_tag(vnet_main_t *vnm, u8 *tag, u32 sw_if_index)
sll srl srl sll sra u16x4 i
static ip4_fib_t * ip4_fib_get(u32 index)
Get the FIB at the given index.
vnet_feature_config_main_t * cm
u8 * pcap_data
Vector of pcap data.
#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
#define VLIB_CLI_COMMAND(x,...)
vnet_device_class_t * device_classes
u32 filter_classify_table_index
#define VNET_HW_INTERFACE_BOND_INFO_SLAVE
static vlib_cli_command_t set_interface_mtu_cmd
(constructor) VLIB_CLI_COMMAND (set_interface_mtu_cmd)
clib_error_t * set_interface_rss_queues(vlib_main_t *vm, u32 hw_if_index, clib_bitmap_t *bitmap)
format_function_t format_vnet_hw_interface
unformat_function_t unformat_vnet_hw_interface
static clib_error_t * set_interface_rx_placement(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
#define CLIB_CACHE_LINE_BYTES
vlib_combined_counter_main_t * combined_sw_if_counters
void vlib_cli_output(vlib_main_t *vm, char *fmt,...)
vnet_sw_interface_t * sw_interfaces
static int sw_interface_name_compare(void *a1, void *a2)
ethernet_interface_t * ethernet_get_interface(ethernet_main_t *em, u32 hw_if_index)
u32 unnumbered_sw_if_index
static clib_error_t * show_sw_interfaces(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
static vlib_cli_command_t create_sub_interfaces_command
(constructor) VLIB_CLI_COMMAND (create_sub_interfaces_command)
static vlib_cli_command_t cmd_set_interface_rss_queues
(constructor) VLIB_CLI_COMMAND (cmd_set_interface_rss_queues)
l2_output_config_t * l2output_intf_config(u32 sw_if_index)
Get a pointer to the config for the given interface.
static clib_error_t * set_interface_mac_address(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
uword first_worker_thread_index
void vnet_interface_features_show(vlib_main_t *vm, u32 sw_if_index, int verbose)
Display the set of driver features configured on a specific interface Called by "show interface" hand...
#define vec_free(V)
Free vector's memory (no header).
format_function_t format_vlib_node_name
#define hash_get_mem(h, key)
static vlib_cli_command_t set_tag_command
(constructor) VLIB_CLI_COMMAND (set_tag_command)
ethernet_main_t ethernet_main
format_function_t format_vnet_sw_if_index_name
u8 * vnet_trace_placeholder
unformat_function_t unformat_vnet_sw_interface
description fragment has unexpected format
A collection of combined counters.
#define VLIB_INIT_FUNCTION(x)
format_function_t format_vtr
u32 l2vtr_get(vlib_main_t *vlib_main, vnet_main_t *vnet_main, u32 sw_if_index, u32 *vtr_op, u32 *push_dot1q, u32 *vtr_tag1, u32 *vtr_tag2)
Get vtag tag rewrite on the given interface.
static clib_error_t * show_or_clear_hw_interfaces(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd, int is_show)
static void vnet_clear_sw_interface_tag(vnet_main_t *vnm, u32 sw_if_index)
#define vec_foreach(var, vec)
Vector iterator.
unformat_function_t unformat_vnet_sw_interface_flags
struct _vnet_classify_main vnet_classify_main_t
static uword pool_elts(void *v)
Number of active elements in a pool.
unformat_function_t unformat_hash_string
ip_lookup_main_t lookup_main
static vlib_cli_command_t set_unnumbered_command
(constructor) VLIB_CLI_COMMAND (set_unnumbered_command)
__clib_export clib_error_t * pcap_write(pcap_main_t *pm)
Write PCAP file.
#define vec_sort_with_function(vec, f)
Sort a vector using the supplied element comparison function.
word vnet_hw_interface_compare(vnet_main_t *vnm, uword hw_if_index0, uword hw_if_index1)
u32 n_packets_to_capture
Number of packets to capture.
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)
A collection of simple counters.
static vlib_main_t * vlib_get_main(void)
format_function_t format_vnet_sw_interface
clib_error_t *() vlib_init_function_t(struct vlib_main_t *vm)
#define ETHERNET_INTERFACE_FLAG_ACCEPT_ALL
uword * sw_if_index_by_sup_and_sub
#define PCAP_MAIN_INIT_DONE
char * file_name
File name of pcap output.
void vnet_sw_interface_update_unnumbered(u32 unnumbered_sw_if_index, u32 ip_sw_if_index, u8 enable)
#define clib_warning(format, args...)
static clib_error_t * parse_vlan_sub_interfaces(unformat_input_t *input, vnet_sw_interface_t *template)
Parse subinterface names.
void vnet_hw_if_set_rx_queue_thread_index(vnet_main_t *vnm, u32 queue_index, u32 thread_index)
static vlib_cli_command_t show_interface_sec_mac_addr
(constructor) VLIB_CLI_COMMAND (show_interface_sec_mac_addr)
#define clib_bitmap_foreach(i, ai)
Macro to iterate across set bits in a bitmap.
static vnet_sw_interface_t * vnet_get_sup_sw_interface(vnet_main_t *vnm, u32 sw_if_index)
static clib_error_t * pcap_trace_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
vl_api_interface_index_t sw_if_index
ethernet_interface_address_t * secondary_addrs
static clib_error_t * create_sub_interfaces(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
void vlib_clear_simple_counters(vlib_simple_counter_main_t *cm)
Clear a collection of simple counters.
static vlib_cli_command_t renumber_interface_command
(constructor) VLIB_CLI_COMMAND (renumber_interface_command)
u32 n_packets_captured
Number of packets currently captured.
vlib_error_t pcap_error_index
static vlib_cli_command_t vnet_cli_interface_command
(constructor) VLIB_CLI_COMMAND (vnet_cli_interface_command)
static void * clib_mem_alloc(uword size)
__clib_export uword unformat_bitmap_list(unformat_input_t *input, va_list *va)
unformat a list of bit ranges into a bitmap (eg "0-3,5-7,11" )
vl_api_fib_path_type_t type
static clib_error_t * set_state(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
vnet_interface_main_t interface_main
int vnet_pcap_dispatch_trace_configure(vnet_pcap_dispatch_trace_args_t *a)
static vlib_cli_command_t set_state_command
(constructor) VLIB_CLI_COMMAND (set_state_command)
void vnet_sw_interface_set_protocol_mtu(vnet_main_t *vnm, u32 sw_if_index, u32 mtu[])
@ VNET_HW_IF_RX_MODE_UNKNOWN
static vlib_cli_command_t clear_hw_interface_counters_command
(constructor) VLIB_CLI_COMMAND (clear_hw_interface_counters_command)
static clib_error_t * show_hw_interfaces(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
vl_api_wireguard_peer_flags_t flags