|
FD.io VPP
v21.06-3-gbb25fbf28
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;
253 " ring %u size %u fill %u "
254 "consume %u produce %u", rid,
261 "slot",
"address",
"flags");
262 for (desc_idx = 0; desc_idx < rxq->
size; desc_idx++)
264 rxd = &rxq->
rx_desc[rid][desc_idx];
266 desc_idx, rxd->address, rxd->flags);
269 else if (show_one_table)
271 if (((
which == VMXNET3_SHOW_RX_DESC0) && (rid == 0)) ||
272 ((
which == VMXNET3_SHOW_RX_DESC1) && (rid == 1)))
276 "slot",
"address",
"flags");
281 slot, rxd->address, rxd->flags);
284 for (desc_idx = 0; desc_idx < rxq->
size; desc_idx++)
286 rxd = &rxq->
rx_desc[rid][desc_idx];
288 desc_idx, rxd->address,
300 "slot",
"index",
"rss",
"len",
"flags");
301 for (desc_idx = 0; desc_idx < rxq->
size; desc_idx++)
303 rx_comp = &rxq->
rx_comp[desc_idx];
305 desc_idx, rx_comp->index, rx_comp->rss,
306 rx_comp->len, rx_comp->flags);
309 else if (show_one_table)
311 if (
which == VMXNET3_SHOW_RX_COMP)
315 "slot",
"index",
"rss",
"len",
"flags");
320 slot, rx_comp->index, rx_comp->rss,
321 rx_comp->len, rx_comp->flags);
324 for (desc_idx = 0; desc_idx < rxq->
size; desc_idx++)
326 rx_comp = &rxq->
rx_comp[desc_idx];
328 " %5u 0x%08x %10u %10u 0x%08x",
329 desc_idx, rx_comp->index, rx_comp->rss,
330 rx_comp->len, rx_comp->flags);
351 "slot",
"address",
"flags0",
"flags1");
352 for (desc_idx = 0; desc_idx < txq->
size; desc_idx++)
356 desc_idx, txd->address, txd->flags[0],
362 "slot",
"index",
"flags");
363 for (desc_idx = 0; desc_idx < txq->
size; desc_idx++)
365 tx_comp = &txq->
tx_comp[desc_idx];
367 desc_idx, tx_comp->index, tx_comp->flags);
370 else if (show_one_table)
372 if (
which == VMXNET3_SHOW_TX_DESC)
376 "slot",
"address",
"flags0",
"flags1");
381 slot, txd->address, txd->flags[0],
385 for (desc_idx = 0; desc_idx < txq->
size; desc_idx++)
389 desc_idx, txd->address, txd->flags[0],
393 else if (
which == VMXNET3_SHOW_TX_COMP)
397 "slot",
"index",
"flags");
402 slot, tx_comp->index, tx_comp->flags);
405 for (desc_idx = 0; desc_idx < txq->
size; desc_idx++)
407 tx_comp = &txq->
tx_comp[desc_idx];
409 desc_idx, tx_comp->index,
426 u32 hw_if_index, *hw_if_indices = 0;
428 u8 show_descr = 0, show_one_table = 0, show_one_slot = 0;
443 vec_add1 (hw_if_indices, hw_if_index);
455 which = VMXNET3_SHOW_RX_COMP;
463 "slot size must be < rx queue "
464 "size %u", rxq->
size);
470 else if (
unformat (input,
"rx-desc-0"))
473 which = VMXNET3_SHOW_RX_DESC0;
481 "slot size must be < rx queue "
482 "size %u", rxq->
size);
488 else if (
unformat (input,
"rx-desc-1"))
491 which = VMXNET3_SHOW_RX_DESC1;
499 "slot size must be < rx queue "
500 "size %u", rxq->
size);
506 else if (
unformat (input,
"tx-comp"))
509 which = VMXNET3_SHOW_TX_COMP;
517 "slot size must be < tx queue "
518 "size %u", txq->
size);
524 else if (
unformat (input,
"tx-desc"))
527 which = VMXNET3_SHOW_TX_DESC;
535 "slot size must be < tx queue "
536 "size %u", txq->
size);
557 if (
vec_len (hw_if_indices) == 0)
564 show_one_slot,
slot);
573 .path =
"show vmxnet3",
574 .short_help =
"show vmxnet3 [[<interface>] ([desc] | ([rx-comp] | "
575 "[rx-desc-0] | [rx-desc-1] | [tx-comp] | [tx-desc]) [<slot>])]",
vmxnet3_main_t vmxnet3_main
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
sll srl srl sll sra u16x4 i
#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)
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