summaryrefslogtreecommitdiffstats
path: root/src/vnet/devices/tap/tap.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/vnet/devices/tap/tap.c')
-rw-r--r--src/vnet/devices/tap/tap.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/vnet/devices/tap/tap.c b/src/vnet/devices/tap/tap.c
index fa5eef19c0d..a76b4e0c16a 100644
--- a/src/vnet/devices/tap/tap.c
+++ b/src/vnet/devices/tap/tap.c
@@ -730,6 +730,12 @@ tap_create_if (vlib_main_t * vm, tap_create_if_args_t * args)
{
hw->flags |= VNET_HW_INTERFACE_FLAG_SUPPORTS_TX_L4_CKSUM_OFFLOAD;
}
+ if ((args->tap_flags & TAP_FLAG_GSO)
+ && (args->tap_flags & TAP_FLAG_GRO_COALESCE))
+ {
+ vif->packet_coalesce = 1;
+ virtio_set_packet_coalesce (vif);
+ }
vnet_hw_interface_set_input_node (vnm, vif->hw_if_index,
virtio_input_node.index);
@@ -827,6 +833,7 @@ tap_csum_offload_enable_disable (vlib_main_t * vm, u32 sw_if_index,
vec_foreach_index (i, vif->tap_fds)
_IOCTL (vif->tap_fds[i], TUNSETOFFLOAD, offload);
vif->gso_enabled = 0;
+ vif->packet_coalesce = 0;
vif->csum_offload_enabled = enable_disable ? 1 : 0;
if ((hw->flags & VNET_HW_INTERFACE_FLAG_SUPPORTS_GSO) != 0)
@@ -862,7 +869,8 @@ error:
}
int
-tap_gso_enable_disable (vlib_main_t * vm, u32 sw_if_index, int enable_disable)
+tap_gso_enable_disable (vlib_main_t * vm, u32 sw_if_index, int enable_disable,
+ int is_packet_coalesce)
{
vnet_main_t *vnm = vnet_get_main ();
virtio_main_t *mm = &virtio_main;
@@ -892,6 +900,11 @@ tap_gso_enable_disable (vlib_main_t * vm, u32 sw_if_index, int enable_disable)
hw->flags |= VNET_HW_INTERFACE_FLAG_SUPPORTS_GSO |
VNET_HW_INTERFACE_FLAG_SUPPORTS_TX_L4_CKSUM_OFFLOAD;
}
+ if (is_packet_coalesce)
+ {
+ vif->packet_coalesce = 1;
+ virtio_set_packet_coalesce (vif);
+ }
}
else
{
@@ -900,6 +913,7 @@ tap_gso_enable_disable (vlib_main_t * vm, u32 sw_if_index, int enable_disable)
hw->flags &= ~(VNET_HW_INTERFACE_FLAG_SUPPORTS_GSO |
VNET_HW_INTERFACE_FLAG_SUPPORTS_TX_L4_CKSUM_OFFLOAD);
}
+ vif->packet_coalesce = 0;
}
error: