|
FD.io VPP
v21.10.1-2-g0a485f517
Vector Packet Processing
|
Go to the documentation of this file.
19 #include <sys/ioctl.h>
46 else if (
unformat (line_input,
"gso"))
48 else if (
unformat (line_input,
"elog"))
50 else if (
unformat (line_input,
"bind"))
52 else if (
unformat (line_input,
"rx-queue-size %u", &
size))
54 else if (
unformat (line_input,
"tx-queue-size %u", &
size))
56 else if (
unformat (line_input,
"num-tx-queues %u", &
size))
58 else if (
unformat (line_input,
"num-rx-queues %u", &
size))
77 .path =
"create interface vmxnet3",
78 .short_help =
"create interface vmxnet3 <pci-address>"
79 " [rx-queue-size <size>] [tx-queue-size <size>]"
80 " [num-tx-queues <number>] [num-rx-queues <number>] [bind]"
116 "please specify interface name or sw_if_index");
131 .path =
"delete interface vmxnet3",
132 .short_help =
"delete interface vmxnet3 "
133 "{<interface> | sw_if_index <sw_idx>}",
148 int enable_elog = 0, disable_elog = 0;
158 else if (
unformat (line_input,
"elog-on"))
160 else if (
unformat (line_input,
"elog-off"))
173 "please specify interface name or sw_if_index");
182 vd->
flags |= VMXNET3_DEVICE_F_ELOG;
185 vd->
flags &= ~VMXNET3_DEVICE_F_ELOG;
192 .path =
"test vmxnet3",
193 .short_help =
"test vmxnet3 <interface> | sw_if_index <sw_idx> [irq] "
194 "[elog-on] [elog-off]",
209 vmxnet3_rx_desc *rxd;
210 vmxnet3_rx_comp *rx_comp;
212 vmxnet3_tx_desc *txd;
213 vmxnet3_tx_comp *tx_comp;
262 " ring %u size %u fill %u "
263 "consume %u produce %u", rid,
270 "slot",
"address",
"flags");
271 for (desc_idx = 0; desc_idx < rxq->
size; desc_idx++)
273 rxd = &rxq->
rx_desc[rid][desc_idx];
275 desc_idx, rxd->address, rxd->flags);
278 else if (show_one_table)
280 if (((
which == VMXNET3_SHOW_RX_DESC0) && (rid == 0)) ||
281 ((
which == VMXNET3_SHOW_RX_DESC1) && (rid == 1)))
285 "slot",
"address",
"flags");
290 slot, rxd->address, rxd->flags);
293 for (desc_idx = 0; desc_idx < rxq->
size; desc_idx++)
295 rxd = &rxq->
rx_desc[rid][desc_idx];
297 desc_idx, rxd->address,
309 "slot",
"index",
"rss",
"len",
"flags");
310 for (desc_idx = 0; desc_idx < rxq->
size; desc_idx++)
312 rx_comp = &rxq->
rx_comp[desc_idx];
314 desc_idx, rx_comp->index, rx_comp->rss,
315 rx_comp->len, rx_comp->flags);
318 else if (show_one_table)
320 if (
which == VMXNET3_SHOW_RX_COMP)
324 "slot",
"index",
"rss",
"len",
"flags");
329 slot, rx_comp->index, rx_comp->rss,
330 rx_comp->len, rx_comp->flags);
333 for (desc_idx = 0; desc_idx < rxq->
size; desc_idx++)
335 rx_comp = &rxq->
rx_comp[desc_idx];
337 " %5u 0x%08x %10u %10u 0x%08x",
338 desc_idx, rx_comp->index, rx_comp->rss,
339 rx_comp->len, rx_comp->flags);
360 "slot",
"address",
"flags0",
"flags1");
361 for (desc_idx = 0; desc_idx < txq->
size; desc_idx++)
365 desc_idx, txd->address, txd->flags[0],
371 "slot",
"index",
"flags");
372 for (desc_idx = 0; desc_idx < txq->
size; desc_idx++)
374 tx_comp = &txq->
tx_comp[desc_idx];
376 desc_idx, tx_comp->index, tx_comp->flags);
379 else if (show_one_table)
381 if (
which == VMXNET3_SHOW_TX_DESC)
385 "slot",
"address",
"flags0",
"flags1");
390 slot, txd->address, txd->flags[0],
394 for (desc_idx = 0; desc_idx < txq->
size; desc_idx++)
398 desc_idx, txd->address, txd->flags[0],
402 else if (
which == VMXNET3_SHOW_TX_COMP)
406 "slot",
"index",
"flags");
411 slot, tx_comp->index, tx_comp->flags);
414 for (desc_idx = 0; desc_idx < txq->
size; desc_idx++)
416 tx_comp = &txq->
tx_comp[desc_idx];
418 desc_idx, tx_comp->index,
435 u32 hw_if_index, *hw_if_indices = 0;
437 u8 show_descr = 0, show_one_table = 0, show_one_slot = 0;
452 vec_add1 (hw_if_indices, hw_if_index);
464 which = VMXNET3_SHOW_RX_COMP;
472 "slot size must be < rx queue "
473 "size %u", rxq->
size);
479 else if (
unformat (input,
"rx-desc-0"))
482 which = VMXNET3_SHOW_RX_DESC0;
490 "slot size must be < rx queue "
491 "size %u", rxq->
size);
497 else if (
unformat (input,
"rx-desc-1"))
500 which = VMXNET3_SHOW_RX_DESC1;
508 "slot size must be < rx queue "
509 "size %u", rxq->
size);
515 else if (
unformat (input,
"tx-comp"))
518 which = VMXNET3_SHOW_TX_COMP;
526 "slot size must be < tx queue "
527 "size %u", txq->
size);
533 else if (
unformat (input,
"tx-desc"))
536 which = VMXNET3_SHOW_TX_DESC;
544 "slot size must be < tx queue "
545 "size %u", txq->
size);
566 if (
vec_len (hw_if_indices) == 0)
573 show_one_slot,
slot);
582 .path =
"show vmxnet3",
583 .short_help =
"show vmxnet3 [[<interface>] ([desc] | ([rx-comp] | "
584 "[rx-desc-0] | [rx-desc-1] | [tx-comp] | [tx-desc]) [<slot>])]",
vmxnet3_main_t vmxnet3_main
static u32 vlib_num_workers()
void vmxnet3_create_if(vlib_main_t *vm, vmxnet3_create_if_args_t *args)
static vlib_cli_command_t show_vmxnet3_command
(constructor) VLIB_CLI_COMMAND (show_vmxnet3_command)
static clib_error_t * vmxnet3_create_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
clib_error_t * vmxnet3_cli_init(vlib_main_t *vm)
vmxnet3_tx_comp * tx_comp
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
u8 * format_ethernet_address(u8 *s, va_list *args)
vlib_log_class_t vlib_log_register_class(char *class, char *subclass)
#define clib_error_return(e, args...)
unformat_function_t unformat_vlib_pci_addr
clib_error_t * vmxnet3_plugin_api_hookup(vlib_main_t *vm)
vlib_main_t * vm
X-connect all packets from the HOST to the PHY.
static vlib_cli_command_t vmxnet3_test_command
(constructor) VLIB_CLI_COMMAND (vmxnet3_test_command)
static clib_error_t * vmxnet3_test_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
static clib_error_t * show_vmxnet3_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
#define pool_foreach(VAR, POOL)
Iterate through pool.
static vlib_cli_command_t vmxnet3_create_command
(constructor) VLIB_CLI_COMMAND (vmxnet3_create_command)
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
#define vec_add1(V, E)
Add 1 element to end of vector (unspecified alignment).
#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)
vlib_log_class_t log_default
static vnet_hw_interface_t * vnet_get_sup_hw_interface_api_visible_or_null(vnet_main_t *vnm, u32 sw_if_index)
vmxnet3_tx_comp_ring tx_comp_ring
#define vec_foreach_index(var, v)
Iterate over vector indices.
format_function_t format_vnet_hw_if_index_name
static clib_error_t * vmxnet3_delete_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
vmxnet3_rx_comp_ring rx_comp_ring
vmxnet3_per_thread_data_t * per_thread_data
#define vec_validate(V, I)
Make sure vector is long enough for given index (no header, unspecified alignment)
#define VLIB_CLI_COMMAND(x,...)
static void show_vmxnet3(vlib_main_t *vm, u32 *hw_if_indices, u8 show_descr, u8 show_one_table, u32 which, u8 show_one_slot, u32 slot)
unformat_function_t unformat_vnet_hw_interface
void vlib_cli_output(vlib_main_t *vm, char *fmt,...)
vmxnet3_rx_comp * rx_comp
#define VMXNET3_RX_RING_SIZE
#define vec_free(V)
Free vector's memory (no header).
format_function_t format_vlib_pci_addr
format_function_t format_vnet_sw_if_index_name
unformat_function_t unformat_vnet_sw_interface
#define VLIB_INIT_FUNCTION(x)
vmxnet3_rx_ring rx_ring[VMXNET3_RX_RING_SIZE]
clib_memset(h->entries, 0, sizeof(h->entries[0]) *entries)
clib_error_t *() vlib_init_function_t(struct vlib_main_t *vm)
vmxnet3_tx_desc * tx_desc
static vlib_cli_command_t vmxnet3_delete_command
(constructor) VLIB_CLI_COMMAND (vmxnet3_delete_command)
void vmxnet3_delete_if(vlib_main_t *vm, vmxnet3_device_t *vd)
static vlib_thread_main_t * vlib_get_thread_main()
vl_api_interface_index_t sw_if_index
vmxnet3_device_t * devices
vmxnet3_rx_desc * rx_desc[VMXNET3_RX_RING_SIZE]
vnet_device_class_t vmxnet3_device_class