Code Review
/
vpp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
nat: use proper type for counters
[vpp.git]
/
src
/
plugins
/
vmxnet3
/
vmxnet3.c
diff --git
a/src/plugins/vmxnet3/vmxnet3.c
b/src/plugins/vmxnet3/vmxnet3.c
index
de10023
..
9209c3e
100644
(file)
--- a/
src/plugins/vmxnet3/vmxnet3.c
+++ b/
src/plugins/vmxnet3/vmxnet3.c
@@
-220,7
+220,7
@@
vmxnet3_provision_driver_shared (vlib_main_t * vm, vmxnet3_device_t * vd)
shared->misc.guest_info |= VMXNET3_GOS_TYPE_LINUX;
shared->misc.version_support = VMXNET3_VERSION_SELECT;
shared->misc.upt_features = VMXNET3_F_RXCSUM;
shared->misc.guest_info |= VMXNET3_GOS_TYPE_LINUX;
shared->misc.version_support = VMXNET3_VERSION_SELECT;
shared->misc.upt_features = VMXNET3_F_RXCSUM;
- if (vd->
lr
o_enable)
+ if (vd->
gs
o_enable)
shared->misc.upt_features |= VMXNET3_F_LRO;
if (vd->num_rx_queues > 1)
{
shared->misc.upt_features |= VMXNET3_F_LRO;
if (vd->num_rx_queues > 1)
{
@@
-405,8
+405,6
@@
static clib_error_t *
vmxnet3_device_init (vlib_main_t * vm, vmxnet3_device_t * vd,
vmxnet3_create_if_args_t * args)
{
vmxnet3_device_init (vlib_main_t * vm, vmxnet3_device_t * vd,
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 ();
clib_error_t *error = 0;
u32 ret, i, size;
vlib_thread_main_t *tm = vlib_get_thread_main ();
@@
-453,11
+451,19
@@
vmxnet3_device_init (vlib_main_t * vm, vmxnet3_device_t * vd,
return error;
}
return error;
}
- /*
LR
O is only supported for version >= 3 */
- if (
(vmxm->lro_configured) && (vd->version >= 3)
)
+ /*
GS
O is only supported for version >= 3 */
+ if (
args->enable_gso
)
{
{
- vd->lro_enable = 1;
- vnm->interface_main.gso_interface_count++;
+ if (vd->version >= 3)
+ vd->gso_enable = 1;
+ else
+ {
+ error =
+ clib_error_return (0,
+ "GSO is not supported because hardware version"
+ " is %u. It must be >= 3", vd->version);
+ return error;
+ }
}
vmxnet3_reg_write (vd, 1, VMXNET3_REG_CMD, VMXNET3_CMD_GET_LINK);
}
vmxnet3_reg_write (vd, 1, VMXNET3_REG_CMD, VMXNET3_CMD_GET_LINK);
@@
-744,6
+750,10
@@
vmxnet3_create_if (vlib_main_t * vm, vmxnet3_create_if_args_t * args)
vmxnet3_log_error (vd,
"No sufficient interrupt lines (%u) for rx queues",
num_intr);
vmxnet3_log_error (vd,
"No sufficient interrupt lines (%u) for rx queues",
num_intr);
+ error =
+ clib_error_return (0,
+ "No sufficient interrupt lines (%u) for rx queues",
+ num_intr);
goto error;
}
if ((error = vlib_pci_register_msix_handler (vm, h, 0, vd->num_rx_queues,
goto error;
}
if ((error = vlib_pci_register_msix_handler (vm, h, 0, vd->num_rx_queues,
@@
-798,8
+808,9
@@
vmxnet3_create_if (vlib_main_t * vm, vmxnet3_create_if_args_t * args)
vnet_hw_interface_t *hw = vnet_get_hw_interface (vnm, vd->hw_if_index);
hw->flags |= VNET_HW_INTERFACE_FLAG_SUPPORTS_INT_MODE;
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)
- hw->flags |= VNET_HW_INTERFACE_FLAG_SUPPORTS_GSO;
+ if (vd->gso_enable)
+ hw->flags |= (VNET_HW_INTERFACE_FLAG_SUPPORTS_GSO |
+ VNET_HW_INTERFACE_FLAG_SUPPORTS_TX_L4_CKSUM_OFFLOAD);
vnet_hw_interface_set_input_node (vnm, vd->hw_if_index,
vmxnet3_input_node.index);
vnet_hw_interface_set_input_node (vnm, vd->hw_if_index,
vmxnet3_input_node.index);
@@
-919,8
+930,6
@@
vmxnet3_delete_if (vlib_main_t * vm, vmxnet3_device_t * vd)
clib_memset (vd, 0, sizeof (*vd));
pool_put (vmxm->devices, vd);
clib_memset (vd, 0, sizeof (*vd));
pool_put (vmxm->devices, vd);
- if (vd->lro_enable)
- vnm->interface_main.gso_interface_count--;
}
/*
}
/*