{
if (unformat (line_input, "%U", unformat_vlib_pci_addr, &args.addr))
;
+ else if (unformat (line_input, "gso"))
+ args.enable_gso = 1;
else if (unformat (line_input, "elog"))
args.enable_elog = 1;
else if (unformat (line_input, "bind"))
else if (unformat (line_input, "num-rx-queues %u", &size))
args.rxq_num = size;
else
- return clib_error_return (0, "unknown input `%U'",
- format_unformat_error, input);
+ {
+ unformat_free (line_input);
+ return clib_error_return (0, "unknown input `%U'",
+ format_unformat_error, input);
+ }
}
unformat_free (line_input);
-
vmxnet3_create_if (vm, &args);
+ if (args.error == 0)
+ vlib_cli_output (vm, "%U\n", format_vnet_sw_if_index_name,
+ vnet_get_main (), args.sw_if_index);
return args.error;
}
VLIB_CLI_COMMAND (vmxnet3_create_command, static) = {
.path = "create interface vmxnet3",
.short_help = "create interface vmxnet3 <pci-address>"
- "[rx-queue-size <size>] [tx-queue-size <size>]"
- "[num-tx-queues <number>] [num-rx-queues <number>] [bind]",
+ " [rx-queue-size <size>] [tx-queue-size <size>]"
+ " [num-tx-queues <number>] [num-rx-queues <number>] [bind]"
+ " [gso]",
.function = vmxnet3_create_command_fn,
};
/* *INDENT-ON* */
return clib_error_return (0,
"please specify interface name or sw_if_index");
- hw = vnet_get_sup_hw_interface (vnm, sw_if_index);
+ hw = vnet_get_sup_hw_interface_api_visible_or_null (vnm, sw_if_index);
if (hw == NULL || vmxnet3_device_class.index != hw->dev_class_index)
return clib_error_return (0, "not a vmxnet3 interface");
return clib_error_return (0,
"please specify interface name or sw_if_index");
- hw = vnet_get_sup_hw_interface (vnm, sw_if_index);
+ hw = vnet_get_sup_hw_interface_api_visible_or_null (vnm, sw_if_index);
if (hw == NULL || vmxnet3_device_class.index != hw->dev_class_index)
return clib_error_return (0, "not a vmxnet3 interface");
vmxnet3_tx_comp *tx_comp;
u16 qid;
+ vlib_cli_output (vm, "Global:");
+ for (u32 tid = 0; tid <= vlib_num_workers (); tid++)
+ {
+ vmxnet3_per_thread_data_t *ptd =
+ vec_elt_at_index (vmxm->per_thread_data, tid);
+ vlib_cli_output (vm, " Thread %u: polling queue count %u", tid,
+ ptd->polling_q_count);
+ }
+
if (!hw_if_indices)
return;
- vlib_cli_output (vm, "LRO/TSO configured: %u", vmxm->lro_configured);
for (i = 0; i < vec_len (hw_if_indices); i++)
{
hi = vnet_get_hw_interface (vnm, hw_if_indices[i]);
format_vnet_hw_if_index_name, vnm, hw_if_indices[i],
hw_if_indices[i]);
vlib_cli_output (vm, " Version: %u", vd->version);
- vlib_cli_output (vm, " LRO/TSO enable: %u", vd->lro_enable);
+ vlib_cli_output (vm, " GSO enable: %u", vd->gso_enable);
vlib_cli_output (vm, " PCI Address: %U", format_vlib_pci_addr,
&vd->pci_addr);
vlib_cli_output (vm, " Mac Address: %U", format_ethernet_address,
if (vec_len (hw_if_indices) == 0)
{
- pool_foreach (vd, vmxm->devices,
- vec_add1 (hw_if_indices, vd->hw_if_index);
- );
+ pool_foreach (vd, vmxm->devices)
+ vec_add1 (hw_if_indices, vd->hw_if_index);
}
show_vmxnet3 (vm, hw_if_indices, show_descr, show_one_table, which,
vmxnet3_cli_init (vlib_main_t * vm)
{
vmxnet3_main_t *vmxm = &vmxnet3_main;
+ vlib_thread_main_t *tm = vlib_get_thread_main ();
/* initialize binary API */
vmxnet3_plugin_api_hookup (vm);
vmxm->log_default = vlib_log_register_class ("vmxnet3", 0);
- return 0;
-}
-
-VLIB_INIT_FUNCTION (vmxnet3_cli_init);
-
-static clib_error_t *
-vmxnet3_config (vlib_main_t * vm, unformat_input_t * input)
-{
- vmxnet3_main_t *vmxm = &vmxnet3_main;
-
- while (unformat_check_input (input) != UNFORMAT_END_OF_INPUT)
- {
- if (unformat (input, "lro"))
- vmxm->lro_configured = 1;
- else
- return clib_error_return (0, "unknown input `%U'",
- format_unformat_error, input);
- }
+ vec_validate (vmxm->per_thread_data, tm->n_vlib_mains - 1);
return 0;
}
-/* vmxnet3 { ... } configuration. */
-VLIB_CONFIG_FUNCTION (vmxnet3_config, "vmxnet3");
+VLIB_INIT_FUNCTION (vmxnet3_cli_init);
/*
* fd.io coding-style-patch-verification: ON