{
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"))
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* */
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,
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);
- }
-
- return 0;
-}
-
-/* vmxnet3 { ... } configuration. */
-VLIB_CONFIG_FUNCTION (vmxnet3_config, "vmxnet3");
-
/*
* fd.io coding-style-patch-verification: ON
*
{
ASSERT (!(rxd->flags & VMXNET3_RXF_BTYPE));
/* start segment */
- if ((vd->lro_enable) &&
+ if (vd->gso_enable &&
(rx_comp->flags & VMXNET3_RXCF_CT) == VMXNET3_RXCOMP_TYPE_LRO)
{
vmxnet3_rx_comp_ext *lro = (vmxnet3_rx_comp_ext *) rx_comp;
* We should not be getting GSO outbound traffic unless it is
* lro is enable
*/
- ASSERT (vd->lro_enable == 1);
+ ASSERT (vd->gso_enable == 1);
gso_size = vnet_buffer2 (b0)->gso_size;
hdr_len = vnet_buffer (b0)->l4_hdr_offset +
sizeof (ethernet_header_t);
*------------------------------------------------------------------
*/
-option version = "1.0.0";
+option version = "1.0.1";
/** \brief
@param client_index - opaque cookie to identify the sender
@param txq_num - number of transmit queues (optional - default is 1)
@param bind - automatically bind PCI to vfio-pci module
(optional - default is 0)
+ @param enable_gso - enable gso (optional - default is 0)
*/
define vmxnet3_create
u16 txq_size;
u16 txq_num;
u8 bind;
+ u8 enable_gso;
};
/** \brief
shared->misc.guest_info |= VMXNET3_GOS_TYPE_LINUX;
shared->misc.version_support = VMXNET3_VERSION_SELECT;
shared->misc.upt_features = VMXNET3_F_RXCSUM;
- if (vd->lro_enable)
+ if (vd->gso_enable)
shared->misc.upt_features |= VMXNET3_F_LRO;
if (vd->num_rx_queues > 1)
{
vmxnet3_create_if_args_t * args)
{
vnet_main_t *vnm = vnet_get_main ();
- vmxnet3_main_t *vmxm = &vmxnet3_main;
clib_error_t *error = 0;
u32 ret, i, size;
vlib_thread_main_t *tm = vlib_get_thread_main ();
return error;
}
- /* LRO is only supported for version >= 3 */
- if ((vmxm->lro_configured) && (vd->version >= 3))
+ /* GSO is only supported for version >= 3 */
+ if (args->enable_gso && (vd->version >= 3))
{
- vd->lro_enable = 1;
+ vd->gso_enable = 1;
vnm->interface_main.gso_interface_count++;
}
vnet_hw_interface_t *hw = vnet_get_hw_interface (vnm, vd->hw_if_index);
hw->flags |= VNET_HW_INTERFACE_FLAG_SUPPORTS_INT_MODE;
- if (vd->lro_enable)
+ if (vd->gso_enable)
hw->flags |= VNET_HW_INTERFACE_FLAG_SUPPORTS_GSO;
vnet_hw_interface_set_input_node (vnm, vd->hw_if_index,
clib_memset (vd, 0, sizeof (*vd));
pool_put (vmxm->devices, vd);
- if (vd->lro_enable)
+ if (vd->gso_enable)
vnm->interface_main.gso_interface_count--;
}
void *queues;
vmxnet3_rss_shared *rss;
u32 link_speed;
- u8 lro_enable;
+ u8 gso_enable;
vmxnet3_tx_stats *tx_stats;
vmxnet3_rx_stats *rx_stats;
} vmxnet3_device_t;
vmxnet3_device_t *devices;
u16 msg_id_base;
vlib_log_class_t log_default;
- u8 lro_configured;
} vmxnet3_main_t;
extern vmxnet3_main_t vmxnet3_main;
u16 txq_size;
u16 txq_num;
u8 bind;
+ u8 enable_gso;
/* return */
i32 rv;
u32 sw_if_index;
args.txq_num = ntohs (mp->txq_num);
args.rxq_num = ntohs (mp->rxq_num);
args.bind = mp->bind;
+ args.enable_gso = mp->enable_gso;
vmxnet3_create_if (vm, &args);
rv = args.rv;
s = format (s, "elog ");
if (mp->bind)
s = format (s, "bind ");
+ if (mp->enable_gso)
+ s = format (s, "gso ");
if (mp->rxq_size)
s = format (s, "rx-queue-size %u ", ntohs (mp->rxq_size));
if (mp->txq_size)
args.enable_elog = 1;
else if (unformat (i, "bind"))
args.bind = 1;
+ else if (unformat (i, "gso"))
+ args.enable_gso = 1;
else if (unformat (i, "rx-queue-size %u", &size))
args.rxq_size = size;
else if (unformat (i, "tx-queue-size %u", &size))
mp->txq_num = clib_host_to_net_u16 (args.txq_num);
mp->rxq_num = clib_host_to_net_u16 (args.rxq_num);
mp->bind = args.bind;
+ mp->enable_gso = args.enable_gso;
S (mp);
W (ret);
#define foreach_vpe_api_msg \
_(vmxnet3_create, "<pci-address> [rx-queue-size <size>] " \
"[tx-queue-size <size>] [num-tx-queues <num>]" \
- "[num-rx-queues <num>] [bind]") \
+ "[num-rx-queues <num>] [bind] [gso]") \
_(vmxnet3_delete, "sw_if_index <sw_if_index>") \
_(vmxnet3_dump, "")