X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fvnet%2Fdevices%2Ftap%2Ftap.c;h=a76b4e0c16a9efaf1b6fe867cff62faa3d636b24;hb=9e2a78564f0fc07f1ea3d15a31fa7ca3a0f6424d;hp=fa5eef19c0db3d371d81ad0c586c2bd68da4f607;hpb=00dd39044e64b4a7a33d204ef7d19aac819d71f5;p=vpp.git 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: